ASN1_BIT_STRING_set:
   17|     60|{
   18|     60|    return ASN1_STRING_set(x, d, len);
   19|     60|}
ossl_i2c_ASN1_BIT_STRING:
   22|   256k|{
   23|   256k|    int ret, j, bits, len;
   24|   256k|    unsigned char *p, *d;
   25|       |
   26|   256k|    if (a == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 256k]
  ------------------
   27|      0|        return 0;
   28|       |
   29|   256k|    len = a->length;
   30|       |
   31|   256k|    if (len > 0) {
  ------------------
  |  Branch (31:9): [True: 179k, False: 77.6k]
  ------------------
   32|   179k|        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
  ------------------
  |  |  161|   179k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  |  Branch (32:13): [True: 151k, False: 27.7k]
  ------------------
   33|   151k|            bits = (int)a->flags & 0x07;
   34|   151k|        } else {
   35|  27.7k|            for (; len > 0; len--) {
  ------------------
  |  Branch (35:20): [True: 27.7k, False: 0]
  ------------------
   36|  27.7k|                if (a->data[len - 1])
  ------------------
  |  Branch (36:21): [True: 27.7k, False: 0]
  ------------------
   37|  27.7k|                    break;
   38|  27.7k|            }
   39|       |
   40|  27.7k|            if (len == 0) {
  ------------------
  |  Branch (40:17): [True: 0, False: 27.7k]
  ------------------
   41|      0|                bits = 0;
   42|  27.7k|            } else {
   43|  27.7k|                j = a->data[len - 1];
   44|  27.7k|                if (j & 0x01)
  ------------------
  |  Branch (44:21): [True: 0, False: 27.7k]
  ------------------
   45|      0|                    bits = 0;
   46|  27.7k|                else if (j & 0x02)
  ------------------
  |  Branch (46:26): [True: 0, False: 27.7k]
  ------------------
   47|      0|                    bits = 1;
   48|  27.7k|                else if (j & 0x04)
  ------------------
  |  Branch (48:26): [True: 0, False: 27.7k]
  ------------------
   49|      0|                    bits = 2;
   50|  27.7k|                else if (j & 0x08)
  ------------------
  |  Branch (50:26): [True: 0, False: 27.7k]
  ------------------
   51|      0|                    bits = 3;
   52|  27.7k|                else if (j & 0x10)
  ------------------
  |  Branch (52:26): [True: 0, False: 27.7k]
  ------------------
   53|      0|                    bits = 4;
   54|  27.7k|                else if (j & 0x20)
  ------------------
  |  Branch (54:26): [True: 27.7k, False: 0]
  ------------------
   55|  27.7k|                    bits = 5;
   56|      0|                else if (j & 0x40)
  ------------------
  |  Branch (56:26): [True: 0, False: 0]
  ------------------
   57|      0|                    bits = 6;
   58|      0|                else if (j & 0x80)
  ------------------
  |  Branch (58:26): [True: 0, False: 0]
  ------------------
   59|      0|                    bits = 7;
   60|      0|                else
   61|      0|                    bits = 0;       /* should not happen */
   62|  27.7k|            }
   63|  27.7k|        }
   64|   179k|    } else
   65|  77.6k|        bits = 0;
   66|       |
   67|   256k|    ret = 1 + len;
   68|   256k|    if (pp == NULL)
  ------------------
  |  Branch (68:9): [True: 223k, False: 33.2k]
  ------------------
   69|   223k|        return ret;
   70|       |
   71|  33.2k|    p = *pp;
   72|       |
   73|  33.2k|    *(p++) = (unsigned char)bits;
   74|  33.2k|    d = a->data;
   75|  33.2k|    if (len > 0) {
  ------------------
  |  Branch (75:9): [True: 24.6k, False: 8.63k]
  ------------------
   76|  24.6k|        memcpy(p, d, len);
   77|  24.6k|        p += len;
   78|  24.6k|        p[-1] &= (0xff << bits);
   79|  24.6k|    }
   80|  33.2k|    *pp = p;
   81|  33.2k|    return ret;
   82|   256k|}
ossl_c2i_ASN1_BIT_STRING:
   86|   183k|{
   87|   183k|    ASN1_BIT_STRING *ret = NULL;
   88|   183k|    const unsigned char *p;
   89|   183k|    unsigned char *s;
   90|   183k|    int i = 0;
   91|       |
   92|   183k|    if (len < 1) {
  ------------------
  |  Branch (92:9): [True: 21, False: 183k]
  ------------------
   93|     21|        i = ASN1_R_STRING_TOO_SHORT;
  ------------------
  |  |  116|     21|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
   94|     21|        goto err;
   95|     21|    }
   96|       |
   97|   183k|    if (len > INT_MAX) {
  ------------------
  |  Branch (97:9): [True: 0, False: 183k]
  ------------------
   98|      0|        i = ASN1_R_STRING_TOO_LONG;
  ------------------
  |  |  115|      0|# define ASN1_R_STRING_TOO_LONG                           151
  ------------------
   99|      0|        goto err;
  100|      0|    }
  101|       |
  102|   183k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (102:9): [True: 0, False: 183k]
  |  Branch (102:24): [True: 66.9k, False: 116k]
  ------------------
  103|  66.9k|        if ((ret = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (103:13): [True: 0, False: 66.9k]
  ------------------
  104|      0|            return NULL;
  105|  66.9k|    } else
  106|   116k|        ret = (*a);
  107|       |
  108|   183k|    p = *pp;
  109|   183k|    i = *(p++);
  110|   183k|    if (i > 7) {
  ------------------
  |  Branch (110:9): [True: 35, False: 183k]
  ------------------
  111|     35|        i = ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
  ------------------
  |  |   72|     35|# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT              220
  ------------------
  112|     35|        goto err;
  113|     35|    }
  114|       |    /*
  115|       |     * We do this to preserve the settings.  If we modify the settings, via
  116|       |     * the _set_bit function, we will recalculate on output
  117|       |     */
  118|   183k|    ossl_asn1_string_set_bits_left(ret, i);
  119|       |
  120|   183k|    if (len-- > 1) {            /* using one because of the bits left byte */
  ------------------
  |  Branch (120:9): [True: 119k, False: 64.2k]
  ------------------
  121|   119k|        s = OPENSSL_malloc((int)len);
  ------------------
  |  |  102|   119k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   119k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   119k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|   119k|        if (s == NULL) {
  ------------------
  |  Branch (122:13): [True: 0, False: 119k]
  ------------------
  123|      0|            goto err;
  124|      0|        }
  125|   119k|        memcpy(s, p, (int)len);
  126|   119k|        s[len - 1] &= (0xff << i);
  127|   119k|        p += len;
  128|   119k|    } else
  129|  64.2k|        s = NULL;
  130|       |
  131|   183k|    ASN1_STRING_set0(ret, s, (int)len);
  132|   183k|    ret->type = V_ASN1_BIT_STRING;
  ------------------
  |  |   65|   183k|# define V_ASN1_BIT_STRING               3
  ------------------
  133|   183k|    if (a != NULL)
  ------------------
  |  Branch (133:9): [True: 183k, False: 0]
  ------------------
  134|   183k|        (*a) = ret;
  135|   183k|    *pp = p;
  136|   183k|    return ret;
  137|     56| err:
  138|     56|    if (i != 0)
  ------------------
  |  Branch (138:9): [True: 56, False: 0]
  ------------------
  139|     56|        ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|     56|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     56|    (ERR_new(),                                                 \
  |  |  |  |  404|     56|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     56|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     56|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     56|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     56|     ERR_set_error)
  |  |  ------------------
  ------------------
  140|     56|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (140:9): [True: 0, False: 56]
  |  Branch (140:24): [True: 37, False: 19]
  ------------------
  141|     37|        ASN1_BIT_STRING_free(ret);
  142|     56|    return NULL;
  143|   183k|}
ASN1_BIT_STRING_set_bit:
  149|  6.94k|{
  150|  6.94k|    int w, v, iv;
  151|  6.94k|    unsigned char *c;
  152|       |
  153|  6.94k|    if (n < 0)
  ------------------
  |  Branch (153:9): [True: 0, False: 6.94k]
  ------------------
  154|      0|        return 0;
  155|       |
  156|  6.94k|    w = n / 8;
  157|  6.94k|    v = 1 << (7 - (n & 0x07));
  158|  6.94k|    iv = ~v;
  159|  6.94k|    if (!value)
  ------------------
  |  Branch (159:9): [True: 0, False: 6.94k]
  ------------------
  160|      0|        v = 0;
  161|       |
  162|  6.94k|    if (a == NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 6.94k]
  ------------------
  163|      0|        return 0;
  164|       |
  165|  6.94k|    a->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear, set on write */
  ------------------
  |  |  161|  6.94k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  166|       |
  167|  6.94k|    if ((a->length < (w + 1)) || (a->data == NULL)) {
  ------------------
  |  Branch (167:9): [True: 6.94k, False: 0]
  |  Branch (167:34): [True: 0, False: 0]
  ------------------
  168|  6.94k|        if (!value)
  ------------------
  |  Branch (168:13): [True: 0, False: 6.94k]
  ------------------
  169|      0|            return 1;         /* Don't need to set */
  170|  6.94k|        c = OPENSSL_clear_realloc(a->data, a->length, w + 1);
  ------------------
  |  |  111|  6.94k|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.94k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.94k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  171|  6.94k|        if (c == NULL)
  ------------------
  |  Branch (171:13): [True: 0, False: 6.94k]
  ------------------
  172|      0|            return 0;
  173|  6.94k|        if (w + 1 - a->length > 0)
  ------------------
  |  Branch (173:13): [True: 6.94k, False: 0]
  ------------------
  174|  6.94k|            memset(c + a->length, 0, w + 1 - a->length);
  175|  6.94k|        a->data = c;
  176|  6.94k|        a->length = w + 1;
  177|  6.94k|    }
  178|  6.94k|    a->data[w] = ((a->data[w]) & iv) | v;
  179|  6.94k|    while ((a->length > 0) && (a->data[a->length - 1] == 0))
  ------------------
  |  Branch (179:12): [True: 6.94k, False: 0]
  |  Branch (179:31): [True: 0, False: 6.94k]
  ------------------
  180|      0|        a->length--;
  181|  6.94k|    return 1;
  182|  6.94k|}
ASN1_BIT_STRING_get_bit:
  185|  1.32k|{
  186|  1.32k|    int w, v;
  187|       |
  188|  1.32k|    if (n < 0)
  ------------------
  |  Branch (188:9): [True: 0, False: 1.32k]
  ------------------
  189|      0|        return 0;
  190|       |
  191|  1.32k|    w = n / 8;
  192|  1.32k|    v = 1 << (7 - (n & 0x07));
  193|  1.32k|    if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL))
  ------------------
  |  Branch (193:9): [True: 0, False: 1.32k]
  |  Branch (193:24): [True: 185, False: 1.13k]
  |  Branch (193:49): [True: 0, False: 1.13k]
  ------------------
  194|    185|        return 0;
  195|  1.13k|    return ((a->data[w] & v) != 0);
  196|  1.32k|}

ASN1_item_d2i_bio_ex:
   60|  10.4k|{
   61|  10.4k|    BUF_MEM *b = NULL;
   62|  10.4k|    const unsigned char *p;
   63|  10.4k|    void *ret = NULL;
   64|  10.4k|    int len;
   65|       |
   66|  10.4k|    if (in == NULL)
  ------------------
  |  Branch (66:9): [True: 0, False: 10.4k]
  ------------------
   67|      0|        return NULL;
   68|  10.4k|    len = asn1_d2i_read_bio(in, &b);
   69|  10.4k|    if (len < 0)
  ------------------
  |  Branch (69:9): [True: 408, False: 10.0k]
  ------------------
   70|    408|        goto err;
   71|       |
   72|  10.0k|    p = (const unsigned char *)b->data;
   73|  10.0k|    ret = ASN1_item_d2i_ex(x, &p, len, it, libctx, propq);
   74|  10.4k| err:
   75|  10.4k|    BUF_MEM_free(b);
   76|  10.4k|    return ret;
   77|  10.0k|}
asn1_d2i_read_bio:
  110|   124k|{
  111|   124k|    BUF_MEM *b;
  112|   124k|    unsigned char *p;
  113|   124k|    int i;
  114|   124k|    size_t want = HEADER_SIZE;
  ------------------
  |  |  107|   124k|#define HEADER_SIZE   8
  ------------------
  115|   124k|    uint32_t eos = 0;
  116|   124k|    size_t off = 0;
  117|   124k|    size_t len = 0;
  118|   124k|    size_t diff;
  119|       |
  120|   124k|    const unsigned char *q;
  121|   124k|    long slen;
  122|   124k|    int inf, tag, xclass;
  123|       |
  124|   124k|    b = BUF_MEM_new();
  125|   124k|    if (b == NULL) {
  ------------------
  |  Branch (125:9): [True: 0, False: 124k]
  ------------------
  126|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  127|      0|        return -1;
  128|      0|    }
  129|       |
  130|   124k|    ERR_set_mark();
  131|  8.18M|    for (;;) {
  132|  8.18M|        diff = len - off;
  133|  8.18M|        if (want >= diff) {
  ------------------
  |  Branch (133:13): [True: 8.18M, False: 5.10k]
  ------------------
  134|  8.18M|            want -= diff;
  135|       |
  136|  8.18M|            if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
  ------------------
  |  Branch (136:17): [True: 0, False: 8.18M]
  |  Branch (136:37): [True: 0, False: 8.18M]
  ------------------
  137|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|      0|                goto err;
  139|      0|            }
  140|  8.18M|            i = BIO_read(in, &(b->data[len]), want);
  141|  8.18M|            if (i < 0 && diff == 0) {
  ------------------
  |  Branch (141:17): [True: 12.5k, False: 8.16M]
  |  Branch (141:26): [True: 72, False: 12.4k]
  ------------------
  142|     72|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|     72|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     72|    (ERR_new(),                                                 \
  |  |  |  |  404|     72|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     72|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     72|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     72|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     72|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|     72|                goto err;
  144|     72|            }
  145|  8.18M|            if (i > 0) {
  ------------------
  |  Branch (145:17): [True: 8.10M, False: 77.9k]
  ------------------
  146|  8.10M|                if (len + i < len) {
  ------------------
  |  Branch (146:21): [True: 0, False: 8.10M]
  ------------------
  147|      0|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|                    goto err;
  149|      0|                }
  150|  8.10M|                len += i;
  151|  8.10M|                if ((size_t)i < want)
  ------------------
  |  Branch (151:21): [True: 41.7k, False: 8.06M]
  ------------------
  152|  41.7k|                    continue;
  153|       |
  154|  8.10M|            }
  155|  8.18M|        }
  156|       |        /* else data already loaded */
  157|       |
  158|  8.14M|        p = (unsigned char *)&(b->data[off]);
  159|  8.14M|        q = p;
  160|  8.14M|        diff = len - off;
  161|  8.14M|        if (diff == 0)
  ------------------
  |  Branch (161:13): [True: 0, False: 8.14M]
  ------------------
  162|      0|            goto err;
  163|  8.14M|        inf = ASN1_get_object(&q, &slen, &tag, &xclass, diff);
  164|  8.14M|        if (inf & 0x80) {
  ------------------
  |  Branch (164:13): [True: 508k, False: 7.63M]
  ------------------
  165|   508k|            unsigned long e;
  166|       |
  167|   508k|            e = ERR_GET_REASON(ERR_peek_last_error());
  168|   508k|            if (e != ASN1_R_TOO_LONG)
  ------------------
  |  |  120|   508k|# define ASN1_R_TOO_LONG                                  155
  ------------------
  |  Branch (168:17): [True: 86, False: 508k]
  ------------------
  169|     86|                goto err;
  170|   508k|            ERR_pop_to_mark();
  171|   508k|        }
  172|  8.14M|        i = q - p;            /* header length */
  173|  8.14M|        off += i;               /* end of data */
  174|       |
  175|  8.14M|        if (inf & 1) {
  ------------------
  |  Branch (175:13): [True: 1.23M, False: 6.90M]
  ------------------
  176|       |            /* no data body so go round again */
  177|  1.23M|            if (eos == UINT32_MAX) {
  ------------------
  |  Branch (177:17): [True: 0, False: 1.23M]
  ------------------
  178|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|                goto err;
  180|      0|            }
  181|  1.23M|            eos++;
  182|  1.23M|            want = HEADER_SIZE;
  ------------------
  |  |  107|  1.23M|#define HEADER_SIZE   8
  ------------------
  183|  6.90M|        } else if (eos && (slen == 0) && (tag == V_ASN1_EOC)) {
  ------------------
  |  |   62|  5.14M|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (183:20): [True: 6.87M, False: 33.6k]
  |  Branch (183:27): [True: 5.14M, False: 1.72M]
  |  Branch (183:42): [True: 434k, False: 4.71M]
  ------------------
  184|       |            /* eos value, so go back and read another header */
  185|   434k|            eos--;
  186|   434k|            if (eos == 0)
  ------------------
  |  Branch (186:17): [True: 90.3k, False: 344k]
  ------------------
  187|  90.3k|                break;
  188|   344k|            else
  189|   344k|                want = HEADER_SIZE;
  ------------------
  |  |  107|   344k|#define HEADER_SIZE   8
  ------------------
  190|  6.47M|        } else {
  191|       |            /* suck in slen bytes of data */
  192|  6.47M|            want = slen;
  193|  6.47M|            if (want > (len - off)) {
  ------------------
  |  Branch (193:17): [True: 508k, False: 5.96M]
  ------------------
  194|   508k|                size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE;
  ------------------
  |  |  108|   508k|#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
  ------------------
  195|       |
  196|   508k|                want -= (len - off);
  197|   508k|                if (want > INT_MAX /* BIO_read takes an int length */  ||
  ------------------
  |  Branch (197:21): [True: 39, False: 508k]
  ------------------
  198|   508k|                    len + want < len) {
  ------------------
  |  Branch (198:21): [True: 0, False: 508k]
  ------------------
  199|     39|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|     39|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     39|    (ERR_new(),                                                 \
  |  |  |  |  404|     39|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     39|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     39|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     39|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     39|     ERR_set_error)
  |  |  ------------------
  ------------------
  200|     39|                    goto err;
  201|     39|                }
  202|  1.01M|                while (want > 0) {
  ------------------
  |  Branch (202:24): [True: 510k, False: 508k]
  ------------------
  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|   510k|                    size_t chunk = want > chunk_max ? chunk_max : want;
  ------------------
  |  Branch (209:36): [True: 2.01k, False: 508k]
  ------------------
  210|       |
  211|   510k|                    if (!BUF_MEM_grow_clean(b, len + chunk)) {
  ------------------
  |  Branch (211:25): [True: 0, False: 510k]
  ------------------
  212|      0|                        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|                        goto err;
  214|      0|                    }
  215|   510k|                    want -= chunk;
  216|  1.02M|                    while (chunk > 0) {
  ------------------
  |  Branch (216:28): [True: 510k, False: 510k]
  ------------------
  217|   510k|                        i = BIO_read(in, &(b->data[len]), chunk);
  218|   510k|                        if (i <= 0) {
  ------------------
  |  Branch (218:29): [True: 222, False: 510k]
  ------------------
  219|    222|                            ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|    222|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    222|    (ERR_new(),                                                 \
  |  |  |  |  404|    222|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    222|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    222|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    222|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    222|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|    222|                            goto err;
  221|    222|                        }
  222|       |                    /*
  223|       |                     * This can't overflow because |len+want| didn't
  224|       |                     * overflow.
  225|       |                     */
  226|   510k|                        len += i;
  227|   510k|                        chunk -= i;
  228|   510k|                    }
  229|   510k|                    if (chunk_max < INT_MAX/2)
  ------------------
  |  Branch (229:25): [True: 510k, False: 0]
  ------------------
  230|   510k|                        chunk_max *= 2;
  231|   510k|                }
  232|   508k|            }
  233|  6.47M|            if (off + slen < off) {
  ------------------
  |  Branch (233:17): [True: 0, False: 6.47M]
  ------------------
  234|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|                goto err;
  236|      0|            }
  237|  6.47M|            off += slen;
  238|  6.47M|            if (eos == 0) {
  ------------------
  |  Branch (238:17): [True: 33.4k, False: 6.43M]
  ------------------
  239|  33.4k|                break;
  240|  33.4k|            } else
  241|  6.43M|                want = HEADER_SIZE;
  ------------------
  |  |  107|  6.43M|#define HEADER_SIZE   8
  ------------------
  242|  6.47M|        }
  243|  8.14M|    }
  244|       |
  245|   123k|    if (off > INT_MAX) {
  ------------------
  |  Branch (245:9): [True: 0, False: 123k]
  ------------------
  246|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  247|      0|        goto err;
  248|      0|    }
  249|       |
  250|   123k|    *pb = b;
  251|   123k|    return off;
  252|    419| err:
  253|    419|    ERR_clear_last_mark();
  254|    419|    BUF_MEM_free(b);
  255|    419|    return -1;
  256|   123k|}

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

ASN1_item_dup:
   51|  20.9k|{
   52|  20.9k|    ASN1_aux_cb *asn1_cb = NULL;
   53|  20.9k|    unsigned char *b = NULL;
   54|  20.9k|    const unsigned char *p;
   55|  20.9k|    long i;
   56|  20.9k|    ASN1_VALUE *ret;
   57|  20.9k|    OSSL_LIB_CTX *libctx = NULL;
   58|  20.9k|    const char *propq = NULL;
   59|       |
   60|  20.9k|    if (x == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 20.9k]
  ------------------
   61|      0|        return NULL;
   62|       |
   63|  20.9k|    if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   81|  41.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
                  if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   82|  34.8k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (63:9): [True: 6.97k, False: 13.9k]
  |  Branch (63:45): [True: 0, False: 13.9k]
  ------------------
   64|  20.9k|        || it->itype == ASN1_ITYPE_NDEF_SEQUENCE) {
  ------------------
  |  |   86|  13.9k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (64:12): [True: 0, False: 13.9k]
  ------------------
   65|  6.97k|        const ASN1_AUX *aux = it->funcs;
   66|       |
   67|  6.97k|        asn1_cb = aux != NULL ? aux->asn1_cb : NULL;
  ------------------
  |  Branch (67:19): [True: 0, False: 6.97k]
  ------------------
   68|  6.97k|    }
   69|       |
   70|  20.9k|    if (asn1_cb != NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 20.9k]
  ------------------
   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|  20.9k|    i = ASN1_item_i2d(x, &b, it);
   78|  20.9k|    if (i < 0 || b == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 20.9k]
  |  Branch (78:18): [True: 0, False: 20.9k]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|  20.9k|    p = b;
   83|  20.9k|    ret = ASN1_item_d2i_ex(NULL, &p, i, it, libctx, propq);
   84|  20.9k|    OPENSSL_free(b);
  ------------------
  |  |  115|  20.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  20.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  20.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  20.9k|    if (asn1_cb != NULL
  ------------------
  |  Branch (86:9): [True: 0, False: 20.9k]
  ------------------
   87|  20.9k|        && !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|  20.9k|    return ret;
   91|       |
   92|      0| auxerr:
   93|      0|    ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                  ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
  ------------------
  |  |   83|      0|# define ERR_LIB_ASN1            13
  ------------------
                  ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
  ------------------
  |  |   27|      0|# define ASN1_R_AUX_ERROR                                 100
  ------------------
   94|      0|    return NULL;
   95|  20.9k|}

ASN1_GENERALIZEDTIME_set:
   58|  7.77k|{
   59|  7.77k|    return ASN1_GENERALIZEDTIME_adj(s, t, 0, 0);
   60|  7.77k|}
ASN1_GENERALIZEDTIME_adj:
   65|  7.77k|{
   66|  7.77k|    struct tm *ts;
   67|  7.77k|    struct tm data;
   68|       |
   69|  7.77k|    ts = OPENSSL_gmtime(&t, &data);
   70|  7.77k|    if (ts == NULL)
  ------------------
  |  Branch (70:9): [True: 0, False: 7.77k]
  ------------------
   71|      0|        return NULL;
   72|       |
   73|  7.77k|    if (offset_day || offset_sec) {
  ------------------
  |  Branch (73:9): [True: 0, False: 7.77k]
  |  Branch (73:23): [True: 0, False: 7.77k]
  ------------------
   74|      0|        if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
  ------------------
  |  Branch (74:13): [True: 0, False: 0]
  ------------------
   75|      0|            return NULL;
   76|      0|    }
   77|       |
   78|  7.77k|    return ossl_asn1_time_from_tm(s, ts, V_ASN1_GENERALIZEDTIME);
  ------------------
  |  |   83|  7.77k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
   79|  7.77k|}
ASN1_GENERALIZEDTIME_print:
   82|    409|{
   83|    409|    if (tm->type != V_ASN1_GENERALIZEDTIME)
  ------------------
  |  |   83|    409|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (83:9): [True: 0, False: 409]
  ------------------
   84|      0|        return 0;
   85|    409|    return ASN1_TIME_print(bp, tm);
   86|    409|}

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

ASN1_INTEGER_dup:
   19|    134|{
   20|    134|    return ASN1_STRING_dup(x);
   21|    134|}
ASN1_INTEGER_cmp:
   24|     90|{
   25|     90|    int neg, ret;
   26|       |    /* Compare signs */
   27|     90|    neg = x->type & V_ASN1_NEG;
  ------------------
  |  |   97|     90|# define V_ASN1_NEG                      0x100
  ------------------
   28|     90|    if (neg != (y->type & V_ASN1_NEG)) {
  ------------------
  |  |   97|     90|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (28:9): [True: 36, False: 54]
  ------------------
   29|     36|        if (neg)
  ------------------
  |  Branch (29:13): [True: 13, False: 23]
  ------------------
   30|     13|            return -1;
   31|     23|        else
   32|     23|            return 1;
   33|     36|    }
   34|       |
   35|     54|    ret = ASN1_STRING_cmp(x, y);
   36|       |
   37|     54|    if (neg)
  ------------------
  |  Branch (37:9): [True: 13, False: 41]
  ------------------
   38|     13|        return -ret;
   39|     41|    else
   40|     41|        return ret;
   41|     54|}
ossl_i2c_ASN1_INTEGER:
  208|   253k|{
  209|   253k|    return i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, pp);
  ------------------
  |  |   97|   253k|# define V_ASN1_NEG                      0x100
  ------------------
  210|   253k|}
ossl_c2i_ASN1_INTEGER:
  292|  54.8k|{
  293|  54.8k|    ASN1_INTEGER *ret = NULL;
  294|  54.8k|    size_t r;
  295|  54.8k|    int neg;
  296|       |
  297|  54.8k|    r = c2i_ibuf(NULL, NULL, *pp, len);
  298|       |
  299|  54.8k|    if (r == 0)
  ------------------
  |  Branch (299:9): [True: 2.94k, False: 51.9k]
  ------------------
  300|  2.94k|        return NULL;
  301|       |
  302|  51.9k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (302:9): [True: 0, False: 51.9k]
  |  Branch (302:24): [True: 20.4k, False: 31.4k]
  ------------------
  303|  20.4k|        ret = ASN1_INTEGER_new();
  304|  20.4k|        if (ret == NULL)
  ------------------
  |  Branch (304:13): [True: 0, False: 20.4k]
  ------------------
  305|      0|            return NULL;
  306|  20.4k|        ret->type = V_ASN1_INTEGER;
  ------------------
  |  |   64|  20.4k|# define V_ASN1_INTEGER                  2
  ------------------
  307|  20.4k|    } else
  308|  31.4k|        ret = *a;
  309|       |
  310|  51.9k|    if (ASN1_STRING_set(ret, NULL, r) == 0) {
  ------------------
  |  Branch (310:9): [True: 0, False: 51.9k]
  ------------------
  311|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  312|      0|        goto err;
  313|      0|    }
  314|       |
  315|  51.9k|    c2i_ibuf(ret->data, &neg, *pp, len);
  316|       |
  317|  51.9k|    if (neg != 0)
  ------------------
  |  Branch (317:9): [True: 24.2k, False: 27.6k]
  ------------------
  318|  24.2k|        ret->type |= V_ASN1_NEG;
  ------------------
  |  |   97|  24.2k|# define V_ASN1_NEG                      0x100
  ------------------
  319|  27.6k|    else
  320|  27.6k|        ret->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|  27.6k|# define V_ASN1_NEG                      0x100
  ------------------
  321|       |
  322|  51.9k|    *pp += len;
  323|  51.9k|    if (a != NULL)
  ------------------
  |  Branch (323:9): [True: 51.9k, False: 0]
  ------------------
  324|  51.9k|        (*a) = ret;
  325|  51.9k|    return ret;
  326|      0| err:
  327|      0|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (327:9): [True: 0, False: 0]
  |  Branch (327:22): [True: 0, False: 0]
  ------------------
  328|      0|        ASN1_INTEGER_free(ret);
  329|      0|    return NULL;
  330|  51.9k|}
ASN1_INTEGER_get_int64:
  530|  19.8k|{
  531|  19.8k|    return asn1_string_get_int64(pr, a, V_ASN1_INTEGER);
  ------------------
  |  |   64|  19.8k|# define V_ASN1_INTEGER                  2
  ------------------
  532|  19.8k|}
ASN1_INTEGER_set_int64:
  535|  22.0k|{
  536|  22.0k|    return asn1_string_set_int64(a, r, V_ASN1_INTEGER);
  ------------------
  |  |   64|  22.0k|# define V_ASN1_INTEGER                  2
  ------------------
  537|  22.0k|}
ASN1_INTEGER_set:
  550|  15.0k|{
  551|  15.0k|    return ASN1_INTEGER_set_int64(a, v);
  552|  15.0k|}
ASN1_INTEGER_get:
  555|  2.38k|{
  556|  2.38k|    int i;
  557|  2.38k|    int64_t r;
  558|  2.38k|    if (a == NULL)
  ------------------
  |  Branch (558:9): [True: 2, False: 2.38k]
  ------------------
  559|      2|        return 0;
  560|  2.38k|    i = ASN1_INTEGER_get_int64(&r, a);
  561|  2.38k|    if (i == 0)
  ------------------
  |  Branch (561:9): [True: 0, False: 2.38k]
  ------------------
  562|      0|        return -1;
  563|  2.38k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (563:9): [True: 0, False: 2.38k]
  |  Branch (563:25): [True: 0, False: 2.38k]
  ------------------
  564|      0|        return -1;
  565|  2.38k|    return (long)r;
  566|  2.38k|}
ASN1_INTEGER_to_BN:
  574|  29.6k|{
  575|  29.6k|    return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER);
  ------------------
  |  |   64|  29.6k|# define V_ASN1_INTEGER                  2
  ------------------
  576|  29.6k|}
ASN1_ENUMERATED_get_int64:
  579|     61|{
  580|     61|    return asn1_string_get_int64(pr, a, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|     61|# define V_ASN1_ENUMERATED               10
  ------------------
  581|     61|}
ASN1_ENUMERATED_get:
  594|     61|{
  595|     61|    int i;
  596|     61|    int64_t r;
  597|     61|    if (a == NULL)
  ------------------
  |  Branch (597:9): [True: 0, False: 61]
  ------------------
  598|      0|        return 0;
  599|     61|    if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   97|     61|# define V_ASN1_NEG                      0x100
  ------------------
                  if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   72|     61|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (599:9): [True: 0, False: 61]
  ------------------
  600|      0|        return -1;
  601|     61|    if (a->length > (int)sizeof(long))
  ------------------
  |  Branch (601:9): [True: 0, False: 61]
  ------------------
  602|      0|        return 0xffffffffL;
  603|     61|    i = ASN1_ENUMERATED_get_int64(&r, a);
  604|     61|    if (i == 0)
  ------------------
  |  Branch (604:9): [True: 0, False: 61]
  ------------------
  605|      0|        return -1;
  606|     61|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (606:9): [True: 0, False: 61]
  |  Branch (606:25): [True: 0, False: 61]
  ------------------
  607|      0|        return -1;
  608|     61|    return (long)r;
  609|     61|}
ASN1_ENUMERATED_to_BN:
  617|     51|{
  618|     51|    return asn1_string_to_bn(ai, bn, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|     51|# define V_ASN1_ENUMERATED               10
  ------------------
  619|     51|}
ossl_c2i_uint64_int:
  624|  2.59k|{
  625|  2.59k|    unsigned char buf[sizeof(uint64_t)];
  626|  2.59k|    size_t buflen;
  627|       |
  628|  2.59k|    buflen = c2i_ibuf(NULL, NULL, *pp, len);
  629|  2.59k|    if (buflen == 0)
  ------------------
  |  Branch (629:9): [True: 157, False: 2.43k]
  ------------------
  630|    157|        return 0;
  631|  2.43k|    if (buflen > sizeof(uint64_t)) {
  ------------------
  |  Branch (631:9): [True: 3, False: 2.43k]
  ------------------
  632|      3|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  633|      3|        return 0;
  634|      3|    }
  635|  2.43k|    (void)c2i_ibuf(buf, neg, *pp, len);
  636|  2.43k|    return asn1_get_uint64(ret, buf, buflen);
  637|  2.43k|}
a_int.c:i2c_ibuf:
   99|   253k|{
  100|   253k|    unsigned int pad = 0;
  101|   253k|    size_t ret, i;
  102|   253k|    unsigned char *p, pb = 0;
  103|       |
  104|   253k|    if (b != NULL && blen) {
  ------------------
  |  Branch (104:9): [True: 253k, False: 0]
  |  Branch (104:22): [True: 253k, False: 92]
  ------------------
  105|   253k|        ret = blen;
  106|   253k|        i = b[0];
  107|   253k|        if (!neg && (i > 127)) {
  ------------------
  |  Branch (107:13): [True: 109k, False: 143k]
  |  Branch (107:21): [True: 4.67k, False: 105k]
  ------------------
  108|  4.67k|            pad = 1;
  109|  4.67k|            pb = 0;
  110|   248k|        } else if (neg) {
  ------------------
  |  Branch (110:20): [True: 143k, False: 105k]
  ------------------
  111|   143k|            pb = 0xFF;
  112|   143k|            if (i > 128) {
  ------------------
  |  Branch (112:17): [True: 15.9k, False: 127k]
  ------------------
  113|  15.9k|                pad = 1;
  114|   127k|            } else if (i == 128) {
  ------------------
  |  Branch (114:24): [True: 18.0k, False: 109k]
  ------------------
  115|       |                /*
  116|       |                 * Special case [of minimal negative for given length]:
  117|       |                 * if any other bytes non zero we pad, otherwise we don't.
  118|       |                 */
  119|  25.8k|                for (pad = 0, i = 1; i < blen; i++)
  ------------------
  |  Branch (119:38): [True: 7.76k, False: 18.0k]
  ------------------
  120|  7.76k|                    pad |= b[i];
  121|  18.0k|                pb = pad != 0 ? 0xffU : 0;
  ------------------
  |  Branch (121:22): [True: 180, False: 17.8k]
  ------------------
  122|  18.0k|                pad = pb & 1;
  123|  18.0k|            }
  124|   143k|        }
  125|   253k|        ret += pad;
  126|   253k|    } else {
  127|     92|        ret = 1;
  128|     92|        blen = 0;   /* reduce '(b == NULL || blen == 0)' to '(blen == 0)' */
  129|     92|    }
  130|       |
  131|   253k|    if (pp == NULL || (p = *pp) == NULL)
  ------------------
  |  Branch (131:9): [True: 214k, False: 38.8k]
  |  Branch (131:23): [True: 0, False: 38.8k]
  ------------------
  132|   214k|        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|  38.8k|    *p = pb;
  140|  38.8k|    p += pad;       /* yes, p[0] can be written twice, but it's little
  141|       |                     * price to pay for eliminated branches */
  142|  38.8k|    twos_complement(p, b, blen, pb);
  143|       |
  144|  38.8k|    *pp += ret;
  145|  38.8k|    return ret;
  146|   253k|}
a_int.c:twos_complement:
   78|  52.7k|{
   79|  52.7k|    unsigned int carry = pad & 1;
   80|       |
   81|       |    /* Begin at the end of the encoding */
   82|  52.7k|    if (len != 0) {
  ------------------
  |  Branch (82:9): [True: 52.6k, False: 23]
  ------------------
   83|       |        /*
   84|       |         * if len == 0 then src/dst could be NULL, and this would be undefined
   85|       |         * behaviour.
   86|       |         */
   87|  52.6k|        dst += len;
   88|  52.6k|        src += len;
   89|  52.6k|    }
   90|       |    /* two's complement value: ~value + 1 */
   91|  1.45M|    while (len-- != 0) {
  ------------------
  |  Branch (91:12): [True: 1.40M, False: 52.7k]
  ------------------
   92|  1.40M|        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);
   93|  1.40M|        carry >>= 8;
   94|  1.40M|    }
   95|  52.7k|}
a_int.c:c2i_ibuf:
  156|   111k|{
  157|   111k|    int neg, pad;
  158|       |    /* Zero content length is illegal */
  159|   111k|    if (plen == 0) {
  ------------------
  |  Branch (159:9): [True: 2.56k, False: 109k]
  ------------------
  160|  2.56k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|  2.56k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.56k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.56k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.56k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.56k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.56k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.56k|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|  2.56k|        return 0;
  162|  2.56k|    }
  163|   109k|    neg = p[0] & 0x80;
  164|   109k|    if (pneg)
  ------------------
  |  Branch (164:9): [True: 54.3k, False: 54.8k]
  ------------------
  165|  54.3k|        *pneg = neg;
  166|       |    /* Handle common case where length is 1 octet separately */
  167|   109k|    if (plen == 1) {
  ------------------
  |  Branch (167:9): [True: 80.9k, False: 28.2k]
  ------------------
  168|  80.9k|        if (b != NULL) {
  ------------------
  |  Branch (168:13): [True: 40.4k, False: 40.4k]
  ------------------
  169|  40.4k|            if (neg)
  ------------------
  |  Branch (169:17): [True: 19.2k, False: 21.2k]
  ------------------
  170|  19.2k|                b[0] = (p[0] ^ 0xFF) + 1;
  171|  21.2k|            else
  172|  21.2k|                b[0] = p[0];
  173|  40.4k|        }
  174|  80.9k|        return 1;
  175|  80.9k|    }
  176|       |
  177|  28.2k|    pad = 0;
  178|  28.2k|    if (p[0] == 0) {
  ------------------
  |  Branch (178:9): [True: 3.16k, False: 25.0k]
  ------------------
  179|  3.16k|        pad = 1;
  180|  25.0k|    } else if (p[0] == 0xFF) {
  ------------------
  |  Branch (180:16): [True: 4.59k, False: 20.5k]
  ------------------
  181|  4.59k|        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|  23.7k|        for (pad = 0, i = 1; i < plen; i++)
  ------------------
  |  Branch (187:30): [True: 19.1k, False: 4.59k]
  ------------------
  188|  19.1k|            pad |= p[i];
  189|  4.59k|        pad = pad != 0 ? 1 : 0;
  ------------------
  |  Branch (189:15): [True: 4.04k, False: 558]
  ------------------
  190|  4.59k|    }
  191|       |    /* reject illegal padding: first two octets MSB can't match */
  192|  28.2k|    if (pad && (neg == (p[1] & 0x80))) {
  ------------------
  |  Branch (192:9): [True: 7.20k, False: 21.0k]
  |  Branch (192:16): [True: 540, False: 6.66k]
  ------------------
  193|    540|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  401|    540|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    540|    (ERR_new(),                                                 \
  |  |  |  |  404|    540|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    540|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    540|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    540|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    540|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|    540|        return 0;
  195|    540|    }
  196|       |
  197|       |    /* skip over pad */
  198|  27.7k|    p += pad;
  199|  27.7k|    plen -= pad;
  200|       |
  201|  27.7k|    if (b != NULL)
  ------------------
  |  Branch (201:9): [True: 13.8k, False: 13.8k]
  ------------------
  202|  13.8k|        twos_complement(b, p, plen, neg ? 0xffU : 0);
  ------------------
  |  Branch (202:37): [True: 6.02k, False: 7.83k]
  ------------------
  203|       |
  204|  27.7k|    return plen;
  205|  28.2k|}
a_int.c:asn1_string_get_int64:
  333|  19.9k|{
  334|  19.9k|    if (a == NULL) {
  ------------------
  |  Branch (334:9): [True: 0, False: 19.9k]
  ------------------
  335|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  336|      0|        return 0;
  337|      0|    }
  338|  19.9k|    if ((a->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  19.9k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (338:9): [True: 0, False: 19.9k]
  ------------------
  339|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  340|      0|        return 0;
  341|      0|    }
  342|  19.9k|    return asn1_get_int64(pr, a->data, a->length, a->type & V_ASN1_NEG);
  ------------------
  |  |   97|  19.9k|# define V_ASN1_NEG                      0x100
  ------------------
  343|  19.9k|}
a_int.c:asn1_get_int64:
  257|  19.9k|{
  258|  19.9k|    uint64_t r;
  259|  19.9k|    if (asn1_get_uint64(&r, b, blen) == 0)
  ------------------
  |  Branch (259:9): [True: 53, False: 19.8k]
  ------------------
  260|     53|        return 0;
  261|  19.8k|    if (neg) {
  ------------------
  |  Branch (261:9): [True: 7.39k, False: 12.4k]
  ------------------
  262|  7.39k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (262:13): [True: 7.23k, False: 157]
  ------------------
  263|       |            /*
  264|       |             * Most significant bit is guaranteed to be clear, negation
  265|       |             * is guaranteed to be meaningful in platform-neutral sense.
  266|       |             */
  267|  7.23k|            *pr = -(int64_t)r;
  268|  7.23k|        } else if (r == ABS_INT64_MIN) {
  ------------------
  |  |  252|    157|#define ABS_INT64_MIN ((uint64_t)INT64_MAX + (-(INT64_MIN + INT64_MAX)))
  ------------------
  |  Branch (268:20): [True: 6, False: 151]
  ------------------
  269|       |            /*
  270|       |             * This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
  271|       |             * on ones'-complement system.
  272|       |             */
  273|      6|            *pr = (int64_t)(0 - r);
  274|    151|        } else {
  275|    151|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    151|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    151|    (ERR_new(),                                                 \
  |  |  |  |  404|    151|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    151|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    151|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    151|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    151|     ERR_set_error)
  |  |  ------------------
  ------------------
  276|    151|            return 0;
  277|    151|        }
  278|  12.4k|    } else {
  279|  12.4k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (279:13): [True: 12.3k, False: 133]
  ------------------
  280|  12.3k|            *pr = (int64_t)r;
  281|  12.3k|        } else {
  282|    133|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    133|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    133|    (ERR_new(),                                                 \
  |  |  |  |  404|    133|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    133|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    133|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    133|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    133|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|    133|            return 0;
  284|    133|        }
  285|  12.4k|    }
  286|  19.5k|    return 1;
  287|  19.8k|}
a_int.c:asn1_string_set_int64:
  346|  22.0k|{
  347|  22.0k|    unsigned char tbuf[sizeof(r)];
  348|  22.0k|    size_t off;
  349|       |
  350|  22.0k|    a->type = itype;
  351|  22.0k|    if (r < 0) {
  ------------------
  |  Branch (351:9): [True: 0, False: 22.0k]
  ------------------
  352|       |        /*
  353|       |         * Most obvious '-r' triggers undefined behaviour for most
  354|       |         * common INT64_MIN. Even though below '0 - (uint64_t)r' can
  355|       |         * appear two's-complement centric, it does produce correct/
  356|       |         * expected result even on ones' complement. This is because
  357|       |         * cast to unsigned has to change bit pattern...
  358|       |         */
  359|      0|        off = asn1_put_uint64(tbuf, 0 - (uint64_t)r);
  360|      0|        a->type |= V_ASN1_NEG;
  ------------------
  |  |   97|      0|# define V_ASN1_NEG                      0x100
  ------------------
  361|  22.0k|    } else {
  362|  22.0k|        off = asn1_put_uint64(tbuf, r);
  363|  22.0k|        a->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|  22.0k|# define V_ASN1_NEG                      0x100
  ------------------
  364|  22.0k|    }
  365|  22.0k|    return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
  366|  22.0k|}
a_int.c:asn1_string_to_bn:
  511|  29.6k|{
  512|  29.6k|    BIGNUM *ret;
  513|       |
  514|  29.6k|    if ((ai->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  29.6k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (514:9): [True: 11, False: 29.6k]
  ------------------
  515|     11|        ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE);
  ------------------
  |  |  401|     11|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     11|    (ERR_new(),                                                 \
  |  |  |  |  404|     11|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     11|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     11|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     11|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     11|     ERR_set_error)
  |  |  ------------------
  ------------------
  516|     11|        return NULL;
  517|     11|    }
  518|       |
  519|  29.6k|    ret = BN_bin2bn(ai->data, ai->length, bn);
  520|  29.6k|    if (ret == NULL) {
  ------------------
  |  Branch (520:9): [True: 0, False: 29.6k]
  ------------------
  521|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      0|        return NULL;
  523|      0|    }
  524|  29.6k|    if (ai->type & V_ASN1_NEG)
  ------------------
  |  |   97|  29.6k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (524:9): [True: 18.7k, False: 10.9k]
  ------------------
  525|  18.7k|        BN_set_negative(ret, 1);
  526|  29.6k|    return ret;
  527|  29.6k|}
a_int.c:asn1_get_uint64:
  214|  22.3k|{
  215|  22.3k|    size_t i;
  216|  22.3k|    uint64_t r;
  217|       |
  218|  22.3k|    if (blen > sizeof(*pr)) {
  ------------------
  |  Branch (218:9): [True: 53, False: 22.3k]
  ------------------
  219|     53|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|     53|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     53|    (ERR_new(),                                                 \
  |  |  |  |  404|     53|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     53|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     53|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     53|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     53|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|     53|        return 0;
  221|     53|    }
  222|  22.3k|    if (b == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 22.3k]
  ------------------
  223|      0|        return 0;
  224|  57.4k|    for (r = 0, i = 0; i < blen; i++) {
  ------------------
  |  Branch (224:24): [True: 35.0k, False: 22.3k]
  ------------------
  225|  35.0k|        r <<= 8;
  226|  35.0k|        r |= b[i];
  227|  35.0k|    }
  228|  22.3k|    *pr = r;
  229|  22.3k|    return 1;
  230|  22.3k|}
a_int.c:asn1_put_uint64:
  238|  22.0k|{
  239|  22.0k|    size_t off = sizeof(uint64_t);
  240|       |
  241|  42.8k|    do {
  242|  42.8k|        b[--off] = (unsigned char)r;
  243|  42.8k|    } while (r >>= 8);
  ------------------
  |  Branch (243:14): [True: 20.8k, False: 22.0k]
  ------------------
  244|       |
  245|  22.0k|    return off;
  246|  22.0k|}

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

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

ASN1_OCTET_STRING_dup:
   15|  19.0k|{
   16|  19.0k|    return ASN1_STRING_dup(x);
   17|  19.0k|}
ASN1_OCTET_STRING_cmp:
   21|    995|{
   22|    995|    return ASN1_STRING_cmp(a, b);
   23|    995|}
ASN1_OCTET_STRING_set:
   27|  21.5k|{
   28|  21.5k|    return ASN1_STRING_set(x, d, len);
   29|  21.5k|}

ASN1_STRING_print:
   70|    364|{
   71|    364|    int i, n;
   72|    364|    char buf[80];
   73|    364|    const char *p;
   74|       |
   75|    364|    if (v == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 364]
  ------------------
   76|      0|        return 0;
   77|    364|    n = 0;
   78|    364|    p = (const char *)v->data;
   79|  20.9k|    for (i = 0; i < v->length; i++) {
  ------------------
  |  Branch (79:17): [True: 20.6k, False: 364]
  ------------------
   80|  20.6k|        if ((p[i] > '~') || ((p[i] < ' ') &&
  ------------------
  |  Branch (80:13): [True: 326, False: 20.2k]
  |  Branch (80:30): [True: 5.71k, False: 14.5k]
  ------------------
   81|  20.2k|                             (p[i] != '\n') && (p[i] != '\r')))
  ------------------
  |  Branch (81:30): [True: 5.31k, False: 402]
  |  Branch (81:48): [True: 4.97k, False: 336]
  ------------------
   82|  5.30k|            buf[n] = '.';
   83|  15.3k|        else
   84|  15.3k|            buf[n] = p[i];
   85|  20.6k|        n++;
   86|  20.6k|        if (n >= 80) {
  ------------------
  |  Branch (86:13): [True: 140, False: 20.4k]
  ------------------
   87|    140|            if (BIO_write(bp, buf, n) <= 0)
  ------------------
  |  Branch (87:17): [True: 0, False: 140]
  ------------------
   88|      0|                return 0;
   89|    140|            n = 0;
   90|    140|        }
   91|  20.6k|    }
   92|    364|    if (n > 0)
  ------------------
  |  Branch (92:9): [True: 358, False: 6]
  ------------------
   93|    358|        if (BIO_write(bp, buf, n) <= 0)
  ------------------
  |  Branch (93:13): [True: 0, False: 358]
  ------------------
   94|      0|            return 0;
   95|    364|    return 1;
   96|    364|}

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

ossl_asn1_time_to_tm:
   77|  8.14k|{
   78|  8.14k|    static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 };
   79|  8.14k|    static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };
   80|  8.14k|    static const int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
   81|  8.14k|    char *a;
   82|  8.14k|    int n, i, i2, l, o, min_l, strict = 0, end = 6, btz = 5, md;
   83|  8.14k|    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|  8.14k|    const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+';
   88|  8.14k|#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|  8.14k|    if (d->type == V_ASN1_UTCTIME) {
  ------------------
  |  |   82|  8.14k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (97:9): [True: 7.73k, False: 409]
  ------------------
   98|  7.73k|        min_l = 13;
   99|  7.73k|        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
  ------------------
  |  |  184|  7.73k|# define ASN1_STRING_FLAG_X509_TIME 0x100
  ------------------
  |  Branch (99:13): [True: 0, False: 7.73k]
  ------------------
  100|      0|            strict = 1;
  101|      0|        }
  102|  7.73k|    } else if (d->type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|    409|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (102:16): [True: 409, False: 0]
  ------------------
  103|    409|        end = 7;
  104|    409|        btz = 6;
  105|    409|        min_l = 15;
  106|    409|        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
  ------------------
  |  |  184|    409|# define ASN1_STRING_FLAG_X509_TIME 0x100
  ------------------
  |  Branch (106:13): [True: 0, False: 409]
  ------------------
  107|      0|            strict = 1;
  108|      0|        }
  109|    409|    } else {
  110|      0|        return 0;
  111|      0|    }
  112|       |
  113|  8.14k|    l = d->length;
  114|  8.14k|    a = (char *)d->data;
  115|  8.14k|    o = 0;
  116|  8.14k|    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|  8.14k|    if (l < min_l)
  ------------------
  |  Branch (124:9): [True: 0, False: 8.14k]
  ------------------
  125|      0|        goto err;
  126|  49.0k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (126:17): [True: 42.9k, False: 6.08k]
  ------------------
  127|  42.9k|        if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) {
  ------------------
  |  Branch (127:13): [True: 42.9k, False: 0]
  |  Branch (127:24): [True: 6.35k, False: 36.6k]
  |  Branch (127:39): [True: 29, False: 6.33k]
  |  Branch (127:60): [True: 57, False: 6.27k]
  |  Branch (127:78): [True: 52, False: 6.22k]
  ------------------
  128|    138|            i++;
  129|    138|            break;
  130|    138|        }
  131|  42.8k|        if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (131:13): [True: 572, False: 42.2k]
  ------------------
  132|    572|            goto err;
  133|  42.2k|        n = a[o] - num_zero;
  134|       |        /* incomplete 2-digital number */
  135|  42.2k|        if (++o == l)
  ------------------
  |  Branch (135:13): [True: 0, False: 42.2k]
  ------------------
  136|      0|            goto err;
  137|       |
  138|  42.2k|        if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (138:13): [True: 438, False: 41.8k]
  ------------------
  139|    438|            goto err;
  140|  41.8k|        n = (n * 10) + a[o] - num_zero;
  141|       |        /* no more bytes to read, but we haven't seen time-zone yet */
  142|  41.8k|        if (++o == l)
  ------------------
  |  Branch (142:13): [True: 0, False: 41.8k]
  ------------------
  143|      0|            goto err;
  144|       |
  145|  41.8k|        i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i;
  ------------------
  |  |   82|  41.8k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (145:14): [True: 40.2k, False: 1.58k]
  ------------------
  146|       |
  147|  41.8k|        if ((n < min[i2]) || (n > max[i2]))
  ------------------
  |  Branch (147:13): [True: 151, False: 41.6k]
  |  Branch (147:30): [True: 721, False: 40.9k]
  ------------------
  148|    872|            goto err;
  149|  40.9k|        switch (i2) {
  ------------------
  |  Branch (149:17): [True: 0, False: 40.9k]
  ------------------
  150|    311|        case 0:
  ------------------
  |  Branch (150:9): [True: 311, False: 40.6k]
  ------------------
  151|       |            /* UTC will never be here */
  152|    311|            tmp.tm_year = n * 100 - 1900;
  153|    311|            break;
  154|  7.80k|        case 1:
  ------------------
  |  Branch (154:9): [True: 7.80k, False: 33.1k]
  ------------------
  155|  7.80k|            if (d->type == V_ASN1_UTCTIME)
  ------------------
  |  |   82|  7.80k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (155:17): [True: 7.54k, False: 263]
  ------------------
  156|  7.54k|                tmp.tm_year = n < 50 ? n + 100 : n;
  ------------------
  |  Branch (156:31): [True: 7.02k, False: 514]
  ------------------
  157|    263|            else
  158|    263|                tmp.tm_year += n;
  159|  7.80k|            break;
  160|  7.04k|        case 2:
  ------------------
  |  Branch (160:9): [True: 7.04k, False: 33.8k]
  ------------------
  161|  7.04k|            tmp.tm_mon = n - 1;
  162|  7.04k|            break;
  163|  6.83k|        case 3:
  ------------------
  |  Branch (163:9): [True: 6.83k, False: 34.1k]
  ------------------
  164|       |            /* check if tm_mday is valid in tm_mon */
  165|  6.83k|            if (tmp.tm_mon == 1) {
  ------------------
  |  Branch (165:17): [True: 178, False: 6.65k]
  ------------------
  166|       |                /* it's February */
  167|    178|                md = mdays[1] + leap_year(tmp.tm_year + 1900);
  168|  6.65k|            } else {
  169|  6.65k|                md = mdays[tmp.tm_mon];
  170|  6.65k|            }
  171|  6.83k|            if (n > md)
  ------------------
  |  Branch (171:17): [True: 43, False: 6.79k]
  ------------------
  172|     43|                goto err;
  173|  6.79k|            tmp.tm_mday = n;
  174|  6.79k|            determine_days(&tmp);
  175|  6.79k|            break;
  176|  6.50k|        case 4:
  ------------------
  |  Branch (176:9): [True: 6.50k, False: 34.4k]
  ------------------
  177|  6.50k|            tmp.tm_hour = n;
  178|  6.50k|            break;
  179|  6.35k|        case 5:
  ------------------
  |  Branch (179:9): [True: 6.35k, False: 34.5k]
  ------------------
  180|  6.35k|            tmp.tm_min = n;
  181|  6.35k|            break;
  182|  6.08k|        case 6:
  ------------------
  |  Branch (182:9): [True: 6.08k, False: 34.8k]
  ------------------
  183|  6.08k|            tmp.tm_sec = n;
  184|  6.08k|            break;
  185|  40.9k|        }
  186|  40.9k|    }
  187|       |
  188|       |    /*
  189|       |     * Optional fractional seconds: decimal point followed by one or more
  190|       |     * digits.
  191|       |     */
  192|  6.22k|    if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) {
  ------------------
  |  |   83|  12.4k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (192:9): [True: 185, False: 6.03k]
  |  Branch (192:46): [True: 70, False: 115]
  ------------------
  193|     70|        if (strict)
  ------------------
  |  Branch (193:13): [True: 0, False: 70]
  ------------------
  194|       |            /* RFC 5280 forbids fractional seconds */
  195|      0|            goto err;
  196|     70|        if (++o == l)
  ------------------
  |  Branch (196:13): [True: 1, False: 69]
  ------------------
  197|      1|            goto err;
  198|     69|        i = o;
  199|    354|        while ((o < l) && ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (199:16): [True: 350, False: 4]
  |  Branch (199:27): [True: 285, False: 65]
  ------------------
  200|    285|            o++;
  201|       |        /* Must have at least one digit after decimal point */
  202|     69|        if (i == o)
  ------------------
  |  Branch (202:13): [True: 2, False: 67]
  ------------------
  203|      2|            goto err;
  204|       |        /* no more bytes to read, but we haven't seen time-zone yet */
  205|     67|        if (o == l)
  ------------------
  |  Branch (205:13): [True: 4, False: 63]
  ------------------
  206|      4|            goto err;
  207|     67|    }
  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|  6.21k|    if (a[o] == upper_z) {
  ------------------
  |  Branch (214:9): [True: 5.95k, False: 257]
  ------------------
  215|  5.95k|        o++;
  216|  5.95k|    } else if (!strict && ((a[o] == plus) || (a[o] == minus))) {
  ------------------
  |  Branch (216:16): [True: 257, False: 0]
  |  Branch (216:28): [True: 99, False: 158]
  |  Branch (216:46): [True: 55, False: 103]
  ------------------
  217|    154|        int offsign = a[o] == minus ? 1 : -1;
  ------------------
  |  Branch (217:23): [True: 55, False: 99]
  ------------------
  218|    154|        int offset = 0;
  219|       |
  220|    154|        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|    154|        if (o + 4 != l)
  ------------------
  |  Branch (227:13): [True: 93, False: 61]
  ------------------
  228|     93|            goto err;
  229|    168|        for (i = end; i < end + 2; i++) {
  ------------------
  |  Branch (229:23): [True: 116, False: 52]
  ------------------
  230|    116|            if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (230:17): [True: 1, False: 115]
  ------------------
  231|      1|                goto err;
  232|    115|            n = a[o] - num_zero;
  233|    115|            o++;
  234|    115|            if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (234:17): [True: 1, False: 114]
  ------------------
  235|      1|                goto err;
  236|    114|            n = (n * 10) + a[o] - num_zero;
  237|    114|            i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i;
  ------------------
  |  |   82|    114|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (237:18): [True: 77, False: 37]
  ------------------
  238|    114|            if ((n < min[i2]) || (n > max[i2]))
  ------------------
  |  Branch (238:17): [True: 0, False: 114]
  |  Branch (238:34): [True: 7, False: 107]
  ------------------
  239|      7|                goto err;
  240|       |            /* if tm is NULL, no need to adjust */
  241|    107|            if (tm != NULL) {
  ------------------
  |  Branch (241:17): [True: 107, False: 0]
  ------------------
  242|    107|                if (i == end)
  ------------------
  |  Branch (242:21): [True: 55, False: 52]
  ------------------
  243|     55|                    offset = n * 3600;
  244|     52|                else if (i == end + 1)
  ------------------
  |  Branch (244:26): [True: 52, False: 0]
  ------------------
  245|     52|                    offset += n * 60;
  246|    107|            }
  247|    107|            o++;
  248|    107|        }
  249|     52|        if (offset && !OPENSSL_gmtime_adj(&tmp, 0, offset * offsign))
  ------------------
  |  Branch (249:13): [True: 51, False: 1]
  |  Branch (249:23): [True: 4, False: 47]
  ------------------
  250|      4|            goto err;
  251|    103|    } else {
  252|       |        /* not Z, or not +/- in non-strict mode */
  253|    103|        goto err;
  254|    103|    }
  255|  6.00k|    if (o == l) {
  ------------------
  |  Branch (255:9): [True: 5.97k, False: 31]
  ------------------
  256|       |        /* success, check if tm should be filled */
  257|  5.97k|        if (tm != NULL)
  ------------------
  |  Branch (257:13): [True: 5.97k, False: 0]
  ------------------
  258|  5.97k|            *tm = tmp;
  259|  5.97k|        return 1;
  260|  5.97k|    }
  261|  2.17k| err:
  262|  2.17k|    return 0;
  263|  6.00k|}
ossl_asn1_time_from_tm:
  266|  10.7k|{
  267|  10.7k|    char* p;
  268|  10.7k|    ASN1_TIME *tmps = NULL;
  269|  10.7k|    const size_t len = 20;
  270|       |
  271|  10.7k|    if (type == V_ASN1_UNDEF) {
  ------------------
  |  |   60|  10.7k|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (271:9): [True: 2.96k, False: 7.77k]
  ------------------
  272|  2.96k|        if (is_utc(ts->tm_year))
  ------------------
  |  Branch (272:13): [True: 2.96k, False: 0]
  ------------------
  273|  2.96k|            type = V_ASN1_UTCTIME;
  ------------------
  |  |   82|  2.96k|# define V_ASN1_UTCTIME                  23
  ------------------
  274|      0|        else
  275|      0|            type = V_ASN1_GENERALIZEDTIME;
  ------------------
  |  |   83|      0|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  276|  7.77k|    } else if (type == V_ASN1_UTCTIME) {
  ------------------
  |  |   82|  7.77k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (276:16): [True: 0, False: 7.77k]
  ------------------
  277|      0|        if (!is_utc(ts->tm_year))
  ------------------
  |  Branch (277:13): [True: 0, False: 0]
  ------------------
  278|      0|            goto err;
  279|  7.77k|    } else if (type != V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  7.77k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (279:16): [True: 0, False: 7.77k]
  ------------------
  280|      0|        goto err;
  281|      0|    }
  282|       |
  283|  10.7k|    if (s == NULL)
  ------------------
  |  Branch (283:9): [True: 2.96k, False: 7.77k]
  ------------------
  284|  2.96k|        tmps = ASN1_STRING_new();
  285|  7.77k|    else
  286|  7.77k|        tmps = s;
  287|  10.7k|    if (tmps == NULL)
  ------------------
  |  Branch (287:9): [True: 0, False: 10.7k]
  ------------------
  288|      0|        return NULL;
  289|       |
  290|  10.7k|    if (!ASN1_STRING_set(tmps, NULL, len))
  ------------------
  |  Branch (290:9): [True: 0, False: 10.7k]
  ------------------
  291|      0|        goto err;
  292|       |
  293|  10.7k|    tmps->type = type;
  294|  10.7k|    p = (char*)tmps->data;
  295|       |
  296|  10.7k|    if (ts->tm_mon > INT_MAX - 1)
  ------------------
  |  Branch (296:9): [True: 0, False: 10.7k]
  ------------------
  297|      0|        goto err;
  298|       |
  299|  10.7k|    if (type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  10.7k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (299:9): [True: 7.77k, False: 2.96k]
  ------------------
  300|  7.77k|        if (ts->tm_year > INT_MAX - 1900)
  ------------------
  |  Branch (300:13): [True: 0, False: 7.77k]
  ------------------
  301|      0|            goto err;
  302|  7.77k|        tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ",
  303|  7.77k|                                    ts->tm_year + 1900, ts->tm_mon + 1,
  304|  7.77k|                                    ts->tm_mday, ts->tm_hour, ts->tm_min,
  305|  7.77k|                                    ts->tm_sec);
  306|  7.77k|    } else {
  307|  2.96k|        tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ",
  308|  2.96k|                                    ts->tm_year % 100, ts->tm_mon + 1,
  309|  2.96k|                                    ts->tm_mday, ts->tm_hour, ts->tm_min,
  310|  2.96k|                                    ts->tm_sec);
  311|  2.96k|    }
  312|       |
  313|       |#ifdef CHARSET_EBCDIC
  314|       |    ebcdic2ascii(tmps->data, tmps->data, tmps->length);
  315|       |#endif
  316|  10.7k|    return tmps;
  317|      0| err:
  318|      0|    if (tmps != s)
  ------------------
  |  Branch (318:9): [True: 0, False: 0]
  ------------------
  319|      0|        ASN1_STRING_free(tmps);
  320|      0|    return NULL;
  321|  10.7k|}
ASN1_TIME_adj:
  330|  2.96k|{
  331|  2.96k|    struct tm *ts;
  332|  2.96k|    struct tm data;
  333|       |
  334|  2.96k|    ts = OPENSSL_gmtime(&t, &data);
  335|  2.96k|    if (ts == NULL) {
  ------------------
  |  Branch (335:9): [True: 0, False: 2.96k]
  ------------------
  336|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  337|      0|        return NULL;
  338|      0|    }
  339|  2.96k|    if (offset_day || offset_sec) {
  ------------------
  |  Branch (339:9): [True: 0, False: 2.96k]
  |  Branch (339:23): [True: 0, False: 2.96k]
  ------------------
  340|      0|        if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|            return NULL;
  342|      0|    }
  343|  2.96k|    return ossl_asn1_time_from_tm(s, ts, V_ASN1_UNDEF);
  ------------------
  |  |   60|  2.96k|# define V_ASN1_UNDEF                    -1
  ------------------
  344|  2.96k|}
ASN1_TIME_to_tm:
  444|  5.43k|{
  445|  5.43k|    if (s == NULL) {
  ------------------
  |  Branch (445:9): [True: 0, False: 5.43k]
  ------------------
  446|      0|        time_t now_t;
  447|       |
  448|      0|        time(&now_t);
  449|      0|        memset(tm, 0, sizeof(*tm));
  450|      0|        if (OPENSSL_gmtime(&now_t, tm) != NULL)
  ------------------
  |  Branch (450:13): [True: 0, False: 0]
  ------------------
  451|      0|            return 1;
  452|      0|        return 0;
  453|      0|    }
  454|       |
  455|  5.43k|    return ossl_asn1_time_to_tm(tm, s);
  456|  5.43k|}
ASN1_TIME_diff:
  460|  2.96k|{
  461|  2.96k|    struct tm tm_from, tm_to;
  462|       |
  463|  2.96k|    if (!ASN1_TIME_to_tm(from, &tm_from))
  ------------------
  |  Branch (463:9): [True: 499, False: 2.46k]
  ------------------
  464|    499|        return 0;
  465|  2.46k|    if (!ASN1_TIME_to_tm(to, &tm_to))
  ------------------
  |  Branch (465:9): [True: 0, False: 2.46k]
  ------------------
  466|      0|        return 0;
  467|  2.46k|    return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
  468|  2.46k|}
ASN1_TIME_print:
  477|  1.22k|{
  478|  1.22k|    return ASN1_TIME_print_ex(bp, tm, ASN1_DTFLGS_RFC822);
  ------------------
  |  |  447|  1.22k|# define ASN1_DTFLGS_RFC822       0x00UL
  ------------------
  479|  1.22k|}
ASN1_TIME_print_ex:
  483|  1.22k|{
  484|  1.22k|    return ossl_asn1_time_print_ex(bp, tm, flags) > 0;
  485|  1.22k|}
ossl_asn1_time_print_ex:
  491|  2.70k|{
  492|  2.70k|    char *v;
  493|  2.70k|    int l;
  494|  2.70k|    struct tm stm;
  495|  2.70k|    const char period = 0x2E;
  496|       |
  497|       |    /* ossl_asn1_time_to_tm will check the time type */
  498|  2.70k|    if (!ossl_asn1_time_to_tm(&stm, tm))
  ------------------
  |  Branch (498:9): [True: 1.67k, False: 1.03k]
  ------------------
  499|  1.67k|        return BIO_write(bp, "Bad time value", 14) ? -1 : 0;
  ------------------
  |  Branch (499:16): [True: 1.67k, False: 0]
  ------------------
  500|       |
  501|  1.03k|    l = tm->length;
  502|  1.03k|    v = (char *)tm->data;
  503|       |
  504|  1.03k|    if (tm->type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  1.03k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (504:9): [True: 106, False: 930]
  ------------------
  505|    106|        char *f = NULL;
  506|    106|        int f_len = 0;
  507|       |
  508|       |        /*
  509|       |         * Try to parse fractional seconds. '14' is the place of
  510|       |         * 'fraction point' in a GeneralizedTime string.
  511|       |         */
  512|    106|        if (tm->length > 15 && v[14] == period) {
  ------------------
  |  Branch (512:13): [True: 17, False: 89]
  |  Branch (512:32): [True: 7, False: 10]
  ------------------
  513|       |            /* exclude the . itself */
  514|      7|            f = &v[15];
  515|      7|            f_len = 0;
  516|     95|            while (15 + f_len < l && ossl_ascii_isdigit(f[f_len]))
  ------------------
  |  Branch (516:20): [True: 95, False: 0]
  |  Branch (516:38): [True: 88, False: 7]
  ------------------
  517|     88|                ++f_len;
  518|      7|        }
  519|       |
  520|    106|        if (f_len > 0) {
  ------------------
  |  Branch (520:13): [True: 7, False: 99]
  ------------------
  521|      7|            if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  446|      7|# define ASN1_DTFLGS_TYPE_MASK    0x0FUL
  ------------------
                          if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  448|      7|# define ASN1_DTFLGS_ISO8601      0x01UL
  ------------------
  |  Branch (521:17): [True: 0, False: 7]
  ------------------
  522|      0|                return BIO_printf(bp, "%4d-%02d-%02d %02d:%02d:%02d.%.*sZ",
  523|      0|                                  stm.tm_year + 1900, stm.tm_mon + 1,
  524|      0|                                  stm.tm_mday, stm.tm_hour,
  525|      0|                                  stm.tm_min, stm.tm_sec, f_len, f) > 0;
  526|      7|            } else {
  527|      7|                return BIO_printf(bp, "%s %2d %02d:%02d:%02d.%.*s %d GMT",
  528|      7|                                  _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
  529|      7|                                  stm.tm_min, stm.tm_sec, f_len, f,
  530|      7|                                  stm.tm_year + 1900) > 0;
  531|      7|            }
  532|      7|        }
  533|    106|    }
  534|  1.02k|    if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  446|  1.02k|# define ASN1_DTFLGS_TYPE_MASK    0x0FUL
  ------------------
                  if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  448|  1.02k|# define ASN1_DTFLGS_ISO8601      0x01UL
  ------------------
  |  Branch (534:9): [True: 0, False: 1.02k]
  ------------------
  535|      0|        return BIO_printf(bp, "%4d-%02d-%02d %02d:%02d:%02dZ",
  536|      0|                          stm.tm_year + 1900, stm.tm_mon + 1,
  537|      0|                          stm.tm_mday, stm.tm_hour,
  538|      0|                          stm.tm_min, stm.tm_sec) > 0;
  539|  1.02k|    } else {
  540|  1.02k|        return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d GMT",
  541|  1.02k|                          _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
  542|  1.02k|                          stm.tm_min, stm.tm_sec, stm.tm_year + 1900) > 0;
  543|  1.02k|    }
  544|  1.02k|}
a_time.c:leap_year:
   38|  5.84k|{
   39|  5.84k|    if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
  ------------------
  |  Branch (39:9): [True: 189, False: 5.65k]
  |  Branch (39:29): [True: 5.64k, False: 12]
  |  Branch (39:48): [True: 596, False: 5.05k]
  ------------------
   40|    785|        return 1;
   41|  5.06k|    return 0;
   42|  5.84k|}
a_time.c:determine_days:
   51|  6.79k|{
   52|  6.79k|    static const int ydays[12] = {
   53|  6.79k|        0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
   54|  6.79k|    };
   55|  6.79k|    int y = tm->tm_year + 1900;
   56|  6.79k|    int m = tm->tm_mon;
   57|  6.79k|    int d = tm->tm_mday;
   58|  6.79k|    int c;
   59|       |
   60|  6.79k|    tm->tm_yday = ydays[m] + d - 1;
   61|  6.79k|    if (m >= 2) {
  ------------------
  |  Branch (61:9): [True: 5.66k, False: 1.12k]
  ------------------
   62|       |        /* March and onwards can be one day further into the year */
   63|  5.66k|        tm->tm_yday += leap_year(y);
   64|  5.66k|        m += 2;
   65|  5.66k|    } else {
   66|       |        /* Treat January and February as part of the previous year */
   67|  1.12k|        m += 14;
   68|  1.12k|        y--;
   69|  1.12k|    }
   70|  6.79k|    c = y / 100;
   71|  6.79k|    y %= 100;
   72|       |    /* Zeller's congruence */
   73|  6.79k|    tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;
   74|  6.79k|}
a_time.c:is_utc:
   31|  2.96k|{
   32|  2.96k|    if (50 <= year && year <= 149)
  ------------------
  |  Branch (32:9): [True: 2.96k, False: 0]
  |  Branch (32:23): [True: 2.96k, False: 0]
  ------------------
   33|  2.96k|        return 1;
   34|      0|    return 0;
   35|  2.96k|}

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

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

UTF8_getc:
   29|   807k|{
   30|   807k|    const unsigned char *p;
   31|   807k|    unsigned long value;
   32|   807k|    int ret;
   33|   807k|    if (len <= 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 807k]
  ------------------
   34|      0|        return 0;
   35|   807k|    p = str;
   36|       |
   37|       |    /* Check syntax and work out the encoded value (if correct) */
   38|   807k|    if ((*p & 0x80) == 0) {
  ------------------
  |  Branch (38:9): [True: 439k, False: 367k]
  ------------------
   39|   439k|        value = *p++ & 0x7f;
   40|   439k|        ret = 1;
   41|   439k|    } else if ((*p & 0xe0) == 0xc0) {
  ------------------
  |  Branch (41:16): [True: 139k, False: 227k]
  ------------------
   42|   139k|        if (len < 2)
  ------------------
  |  Branch (42:13): [True: 494, False: 139k]
  ------------------
   43|    494|            return -1;
   44|   139k|        if ((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (44:13): [True: 642, False: 138k]
  ------------------
   45|    642|            return -3;
   46|   138k|        value = (*p++ & 0x1f) << 6;
   47|   138k|        value |= *p++ & 0x3f;
   48|   138k|        if (value < 0x80)
  ------------------
  |  Branch (48:13): [True: 269, False: 138k]
  ------------------
   49|    269|            return -4;
   50|   138k|        ret = 2;
   51|   227k|    } else if ((*p & 0xf0) == 0xe0) {
  ------------------
  |  Branch (51:16): [True: 216k, False: 11.3k]
  ------------------
   52|   216k|        if (len < 3)
  ------------------
  |  Branch (52:13): [True: 97, False: 216k]
  ------------------
   53|     97|            return -1;
   54|   216k|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (54:13): [True: 903, False: 215k]
  ------------------
   55|   216k|            || ((p[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (55:16): [True: 2.89k, False: 212k]
  ------------------
   56|  3.80k|            return -3;
   57|   212k|        value = (*p++ & 0xf) << 12;
   58|   212k|        value |= (*p++ & 0x3f) << 6;
   59|   212k|        value |= *p++ & 0x3f;
   60|   212k|        if (value < 0x800)
  ------------------
  |  Branch (60:13): [True: 4.85k, False: 207k]
  ------------------
   61|  4.85k|            return -4;
   62|   207k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (62:13): [True: 698, False: 207k]
  ------------------
   63|    698|            return -2;
   64|   207k|        ret = 3;
   65|   207k|    } else if ((*p & 0xf8) == 0xf0) {
  ------------------
  |  Branch (65:16): [True: 10.0k, False: 1.34k]
  ------------------
   66|  10.0k|        if (len < 4)
  ------------------
  |  Branch (66:13): [True: 1.02k, False: 8.99k]
  ------------------
   67|  1.02k|            return -1;
   68|  8.99k|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (68:13): [True: 5.14k, False: 3.84k]
  ------------------
   69|  8.99k|            || ((p[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (69:16): [True: 1.41k, False: 2.43k]
  ------------------
   70|  8.99k|            || ((p[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (70:16): [True: 288, False: 2.15k]
  ------------------
   71|  6.84k|            return -3;
   72|  2.15k|        value = ((unsigned long)(*p++ & 0x7)) << 18;
   73|  2.15k|        value |= (*p++ & 0x3f) << 12;
   74|  2.15k|        value |= (*p++ & 0x3f) << 6;
   75|  2.15k|        value |= *p++ & 0x3f;
   76|  2.15k|        if (value < 0x10000)
  ------------------
  |  Branch (76:13): [True: 1.72k, False: 423]
  ------------------
   77|  1.72k|            return -4;
   78|    423|        ret = 4;
   79|    423|    } else
   80|  1.34k|        return -2;
   81|   785k|    *val = value;
   82|   785k|    return ret;
   83|   807k|}
UTF8_putc:
   94|  16.3M|{
   95|  16.3M|    if (!str)
  ------------------
  |  Branch (95:9): [True: 8.15M, False: 8.21M]
  ------------------
   96|  8.15M|        len = 4;                /* Maximum we will need */
   97|  8.21M|    else if (len <= 0)
  ------------------
  |  Branch (97:14): [True: 0, False: 8.21M]
  ------------------
   98|      0|        return -1;
   99|  16.3M|    if (value < 0x80) {
  ------------------
  |  Branch (99:9): [True: 1.04M, False: 15.3M]
  ------------------
  100|  1.04M|        if (str)
  ------------------
  |  Branch (100:13): [True: 546k, False: 497k]
  ------------------
  101|   546k|            *str = (unsigned char)value;
  102|  1.04M|        return 1;
  103|  1.04M|    }
  104|  15.3M|    if (value < 0x800) {
  ------------------
  |  Branch (104:9): [True: 15.3M, False: 2.49k]
  ------------------
  105|  15.3M|        if (len < 2)
  ------------------
  |  Branch (105:13): [True: 0, False: 15.3M]
  ------------------
  106|      0|            return -1;
  107|  15.3M|        if (str) {
  ------------------
  |  Branch (107:13): [True: 7.66M, False: 7.66M]
  ------------------
  108|  7.66M|            *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
  109|  7.66M|            *str = (unsigned char)((value & 0x3f) | 0x80);
  110|  7.66M|        }
  111|  15.3M|        return 2;
  112|  15.3M|    }
  113|  2.49k|    if (value < 0x10000) {
  ------------------
  |  Branch (113:9): [True: 1.96k, False: 532]
  ------------------
  114|  1.96k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (114:13): [True: 0, False: 1.96k]
  ------------------
  115|      0|            return -2;
  116|  1.96k|        if (len < 3)
  ------------------
  |  Branch (116:13): [True: 0, False: 1.96k]
  ------------------
  117|      0|            return -1;
  118|  1.96k|        if (str) {
  ------------------
  |  Branch (118:13): [True: 994, False: 970]
  ------------------
  119|    994|            *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
  120|    994|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  121|    994|            *str = (unsigned char)((value & 0x3f) | 0x80);
  122|    994|        }
  123|  1.96k|        return 3;
  124|  1.96k|    }
  125|    532|    if (value < UNICODE_LIMIT) {
  ------------------
  |  Branch (125:9): [True: 532, False: 0]
  ------------------
  126|    532|        if (len < 4)
  ------------------
  |  Branch (126:13): [True: 0, False: 532]
  ------------------
  127|      0|            return -1;
  128|    532|        if (str) {
  ------------------
  |  Branch (128:13): [True: 266, False: 266]
  ------------------
  129|    266|            *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
  130|    266|            *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
  131|    266|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  132|    266|            *str = (unsigned char)((value & 0x3f) | 0x80);
  133|    266|        }
  134|    532|        return 4;
  135|    532|    }
  136|      0|    return -2;
  137|    532|}

ASN1_item_verify_ex:
   98|  1.13k|{
   99|  1.13k|    EVP_MD_CTX *ctx;
  100|  1.13k|    int rv = -1;
  101|       |
  102|  1.13k|    if ((ctx = evp_md_ctx_new_ex(pkey, id, libctx, propq)) != NULL) {
  ------------------
  |  Branch (102:9): [True: 1.07k, False: 58]
  ------------------
  103|  1.07k|        rv = ASN1_item_verify_ctx(it, alg, signature, data, ctx);
  104|  1.07k|        EVP_PKEY_CTX_free(EVP_MD_CTX_get_pkey_ctx(ctx));
  105|  1.07k|        EVP_MD_CTX_free(ctx);
  106|  1.07k|    }
  107|  1.13k|    return rv;
  108|  1.13k|}
ASN1_item_verify_ctx:
  113|  1.07k|{
  114|  1.07k|    EVP_PKEY *pkey;
  115|  1.07k|    unsigned char *buf_in = NULL;
  116|  1.07k|    int ret = -1, inl = 0;
  117|  1.07k|    int mdnid, pknid;
  118|  1.07k|    size_t inll = 0;
  119|       |
  120|  1.07k|    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
  121|       |
  122|  1.07k|    if (pkey == NULL) {
  ------------------
  |  Branch (122:9): [True: 0, False: 1.07k]
  ------------------
  123|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|        return -1;
  125|      0|    }
  126|       |
  127|  1.07k|    if (signature->type == V_ASN1_BIT_STRING && signature->flags & 0x7) {
  ------------------
  |  |   65|  2.15k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (127:9): [True: 1.07k, False: 0]
  |  Branch (127:49): [True: 11, False: 1.06k]
  ------------------
  128|     11|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT);
  ------------------
  |  |  401|     11|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     11|    (ERR_new(),                                                 \
  |  |  |  |  404|     11|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     11|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     11|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     11|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     11|     ERR_set_error)
  |  |  ------------------
  ------------------
  129|     11|        return -1;
  130|     11|    }
  131|       |
  132|       |    /* Convert signature OID into digest and public key OIDs */
  133|  1.06k|    if (!OBJ_find_sigid_algs(OBJ_obj2nid(alg->algorithm), &mdnid, &pknid)) {
  ------------------
  |  Branch (133:9): [True: 56, False: 1.00k]
  ------------------
  134|     56|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM);
  ------------------
  |  |  401|     56|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     56|    (ERR_new(),                                                 \
  |  |  |  |  404|     56|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     56|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     56|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     56|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     56|     ERR_set_error)
  |  |  ------------------
  ------------------
  135|     56|        goto err;
  136|     56|    }
  137|       |
  138|  1.00k|    if (mdnid == NID_undef && evp_pkey_is_legacy(pkey)) {
  ------------------
  |  |   18|  2.01k|#define NID_undef                       0
  ------------------
                  if (mdnid == NID_undef && evp_pkey_is_legacy(pkey)) {
  ------------------
  |  |  647|    513|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|    513|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|  1.02k|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 513, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 513]
  |  |  ------------------
  ------------------
  |  Branch (138:9): [True: 513, False: 495]
  ------------------
  139|      0|        if (pkey->ameth == NULL || pkey->ameth->item_verify == NULL) {
  ------------------
  |  Branch (139:13): [True: 0, False: 0]
  |  Branch (139:36): [True: 0, False: 0]
  ------------------
  140|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  141|      0|            goto err;
  142|      0|        }
  143|      0|        ret = pkey->ameth->item_verify(ctx, it, data, alg, signature, pkey);
  144|       |        /*
  145|       |         * Return values meaning:
  146|       |         * <=0: error.
  147|       |         *   1: method does everything.
  148|       |         *   2: carry on as normal, method has called EVP_DigestVerifyInit()
  149|       |         */
  150|      0|        if (ret <= 0)
  ------------------
  |  Branch (150:13): [True: 0, False: 0]
  ------------------
  151|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  152|      0|        if (ret <= 1)
  ------------------
  |  Branch (152:13): [True: 0, False: 0]
  ------------------
  153|      0|            goto err;
  154|  1.00k|    } else {
  155|  1.00k|        const EVP_MD *type = NULL;
  156|       |
  157|       |        /*
  158|       |         * We don't yet have the ability for providers to be able to handle
  159|       |         * X509_ALGOR style parameters. Fortunately the only one that needs this
  160|       |         * so far is RSA-PSS, so we just special case this for now. In some
  161|       |         * future version of OpenSSL we should push this to the provider.
  162|       |         */
  163|  1.00k|        if (mdnid == NID_undef && pknid == EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   18|  2.01k|#define NID_undef                       0
  ------------------
                      if (mdnid == NID_undef && pknid == EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   65|    513|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|    513|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (163:13): [True: 513, False: 495]
  |  Branch (163:35): [True: 510, False: 3]
  ------------------
  164|    510|            if (!EVP_PKEY_is_a(pkey, "RSA") && !EVP_PKEY_is_a(pkey, "RSA-PSS")) {
  ------------------
  |  Branch (164:17): [True: 39, False: 471]
  |  Branch (164:48): [True: 0, False: 39]
  ------------------
  165|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|                goto err;
  167|      0|            }
  168|       |            /* This function also calls EVP_DigestVerifyInit */
  169|    510|            if (ossl_rsa_pss_to_ctx(ctx, NULL, alg, pkey) <= 0) {
  ------------------
  |  Branch (169:17): [True: 12, False: 498]
  ------------------
  170|     12|                ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  171|     12|                goto err;
  172|     12|            }
  173|    510|        } else {
  174|       |            /* Check public key OID matches public key type */
  175|    498|            if (!EVP_PKEY_is_a(pkey, OBJ_nid2sn(pknid))) {
  ------------------
  |  Branch (175:17): [True: 4, False: 494]
  ------------------
  176|      4|                ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  177|      4|                goto err;
  178|      4|            }
  179|       |
  180|    494|            if (mdnid != NID_undef) {
  ------------------
  |  |   18|    494|#define NID_undef                       0
  ------------------
  |  Branch (180:17): [True: 493, False: 1]
  ------------------
  181|    493|                type = EVP_get_digestbynid(mdnid);
  ------------------
  |  |  552|    493|# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
  ------------------
  182|    493|                if (type == NULL) {
  ------------------
  |  Branch (182:21): [True: 13, False: 480]
  ------------------
  183|     13|                    ERR_raise_data(ERR_LIB_ASN1,
  ------------------
  |  |  403|     13|    (ERR_new(),                                                 \
  |  |  404|     13|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|     13|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|     13|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|     13|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|     13|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_ASN1,
  ------------------
  |  |   83|     13|# define ERR_LIB_ASN1            13
  ------------------
  184|     13|                                   ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM,
  ------------------
  |  |  128|     13|# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM          161
  ------------------
  185|     13|                                   "nid=0x%x", mdnid);
  186|     13|                    goto err;
  187|     13|                }
  188|    493|            }
  189|       |
  190|       |            /*
  191|       |             * Note that some algorithms (notably Ed25519 and Ed448) may allow
  192|       |             * a NULL digest value.
  193|       |             */
  194|    481|            if (!EVP_DigestVerifyInit(ctx, NULL, type, NULL, pkey)) {
  ------------------
  |  Branch (194:17): [True: 14, False: 467]
  ------------------
  195|     14|                ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
  ------------------
  |  |  401|     14|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     14|    (ERR_new(),                                                 \
  |  |  |  |  404|     14|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     14|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     14|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     14|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     14|     ERR_set_error)
  |  |  ------------------
  ------------------
  196|     14|                ret = 0;
  197|     14|                goto err;
  198|     14|            }
  199|    481|        }
  200|  1.00k|    }
  201|       |
  202|    965|    inl = ASN1_item_i2d(data, &buf_in, it);
  203|    965|    if (inl <= 0) {
  ------------------
  |  Branch (203:9): [True: 0, False: 965]
  ------------------
  204|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  205|      0|        ret = -1;
  206|      0|        goto err;
  207|      0|    }
  208|    965|    if (buf_in == NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 965]
  ------------------
  209|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|        ret = -1;
  211|      0|        goto err;
  212|      0|    }
  213|    965|    inll = inl;
  214|       |
  215|    965|    ret = EVP_DigestVerify(ctx, signature->data, (size_t)signature->length,
  216|    965|                           buf_in, inl);
  217|    965|    if (ret <= 0) {
  ------------------
  |  Branch (217:9): [True: 941, False: 24]
  ------------------
  218|    941|        ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
  ------------------
  |  |  401|    941|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    941|    (ERR_new(),                                                 \
  |  |  |  |  404|    941|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    941|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    941|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    941|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    941|     ERR_set_error)
  |  |  ------------------
  ------------------
  219|    941|        goto err;
  220|    941|    }
  221|     24|    ret = 1;
  222|  1.06k| err:
  223|  1.06k|    OPENSSL_clear_free(buf_in, inll);
  ------------------
  |  |  113|  1.06k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.06k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.06k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  224|  1.06k|    return ret;
  225|     24|}

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

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|  21.7M|{
   49|  21.7M|    int i, ret;
   50|  21.7M|    long len;
   51|  21.7M|    const unsigned char *p = *pp;
   52|  21.7M|    int tag, xclass, inf;
   53|  21.7M|    long max = omax;
   54|       |
   55|  21.7M|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 21.7M]
  ------------------
   56|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        return 0x80;
   58|      0|    }
   59|  21.7M|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   52|  21.7M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
   60|  21.7M|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  21.7M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
   61|  21.7M|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|  21.7M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
   62|  21.7M|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   53|  21.7M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  |  Branch (62:9): [True: 16.5k, False: 21.7M]
  ------------------
   63|  16.5k|        p++;
   64|  16.5k|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 510, False: 16.0k]
  ------------------
   65|    510|            goto err;
   66|  16.0k|        len = 0;
   67|  30.6k|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 14.8k, False: 15.8k]
  ------------------
   68|  14.8k|            len <<= 7L;
   69|  14.8k|            len |= *(p++) & 0x7f;
   70|  14.8k|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 70, False: 14.7k]
  ------------------
   71|     70|                goto err;
   72|  14.7k|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 178, False: 14.5k]
  ------------------
   73|    178|                goto err;
   74|  14.7k|        }
   75|  15.8k|        len <<= 7L;
   76|  15.8k|        len |= *(p++) & 0x7f;
   77|  15.8k|        tag = (int)len;
   78|  15.8k|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 385, False: 15.4k]
  ------------------
   79|    385|            goto err;
   80|  21.7M|    } else {
   81|  21.7M|        tag = i;
   82|  21.7M|        p++;
   83|  21.7M|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 686, False: 21.7M]
  ------------------
   84|    686|            goto err;
   85|  21.7M|    }
   86|  21.7M|    *ptag = tag;
   87|  21.7M|    *pclass = xclass;
   88|  21.7M|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 2.42k, False: 21.7M]
  ------------------
   89|  2.42k|        goto err;
   90|       |
   91|  21.7M|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   52|  1.78M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (91:9): [True: 1.78M, False: 19.9M]
  |  Branch (91:16): [True: 396, False: 1.78M]
  ------------------
   92|    396|        goto err;
   93|       |
   94|  21.7M|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 510k, False: 21.2M]
  ------------------
   95|   510k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|   510k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   510k|    (ERR_new(),                                                 \
  |  |  |  |  404|   510k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|   510k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|   510k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   510k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   510k|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|   510k|        ret |= 0x80;
  101|   510k|    }
  102|  21.7M|    *pp = p;
  103|  21.7M|    return ret | inf;
  104|  4.64k| err:
  105|  4.64k|    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|  4.64k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.64k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.64k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  4.64k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  4.64k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.64k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.64k|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|  4.64k|    return 0x80;
  107|  21.7M|}
ASN1_put_object:
  162|   722k|{
  163|   722k|    unsigned char *p = *pp;
  164|   722k|    int i, ttag;
  165|       |
  166|   722k|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   52|   366k|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (166:9): [True: 366k, False: 355k]
  ------------------
  167|   722k|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   50|   722k|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  168|   722k|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 721k, False: 322]
  ------------------
  169|   721k|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   53|   721k|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  170|   721k|    } else {
  171|    322|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|    322|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  172|  1.05k|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 730, False: 322]
  ------------------
  173|    730|            ttag >>= 7;
  174|    322|        ttag = i;
  175|  1.05k|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 730, False: 322]
  ------------------
  176|    730|            p[i] = tag & 0x7f;
  177|    730|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 408, False: 322]
  ------------------
  178|    408|                p[i] |= 0x80;
  179|    730|            tag >>= 7;
  180|    730|        }
  181|    322|        p += ttag;
  182|    322|    }
  183|   722k|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 722k]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|   722k|    else
  186|   722k|        asn1_put_length(&p, length);
  187|   722k|    *pp = p;
  188|   722k|}
ASN1_object_size:
  223|  3.57M|{
  224|  3.57M|    int ret = 1;
  225|       |
  226|  3.57M|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 3.57M]
  ------------------
  227|      0|        return -1;
  228|  3.57M|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 1.77k, False: 3.57M]
  ------------------
  229|  5.69k|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 3.92k, False: 1.77k]
  ------------------
  230|  3.92k|            tag >>= 7;
  231|  3.92k|            ret++;
  232|  3.92k|        }
  233|  1.77k|    }
  234|  3.57M|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 3.57M]
  ------------------
  235|      0|        ret += 3;
  236|  3.57M|    } else {
  237|  3.57M|        ret++;
  238|  3.57M|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 151k, False: 3.42M]
  ------------------
  239|   151k|            int tmplen = length;
  240|   422k|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 270k, False: 151k]
  ------------------
  241|   270k|                tmplen >>= 8;
  242|   270k|                ret++;
  243|   270k|            }
  244|   151k|        }
  245|  3.57M|    }
  246|  3.57M|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 3.57M]
  ------------------
  247|      0|        return -1;
  248|  3.57M|    return ret + length;
  249|  3.57M|}
ossl_asn1_string_set_bits_left:
  252|   183k|{
  253|   183k|    str->flags &= ~0x07;
  254|   183k|    str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
  ------------------
  |  |  161|   183k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  255|   183k|}
ASN1_STRING_copy:
  258|   118k|{
  259|   118k|    if (str == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 118k]
  ------------------
  260|      0|        return 0;
  261|   118k|    dst->type = str->type;
  262|   118k|    if (!ASN1_STRING_set(dst, str->data, str->length))
  ------------------
  |  Branch (262:9): [True: 0, False: 118k]
  ------------------
  263|      0|        return 0;
  264|       |    /* Copy flags but preserve embed value */
  265|   118k|    dst->flags &= ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   118k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  266|   118k|    dst->flags |= str->flags & ~ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   118k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  267|   118k|    return 1;
  268|   118k|}
ASN1_STRING_dup:
  271|  19.1k|{
  272|  19.1k|    ASN1_STRING *ret;
  273|       |
  274|  19.1k|    if (!str)
  ------------------
  |  Branch (274:9): [True: 0, False: 19.1k]
  ------------------
  275|      0|        return NULL;
  276|  19.1k|    ret = ASN1_STRING_new();
  277|  19.1k|    if (ret == NULL)
  ------------------
  |  Branch (277:9): [True: 0, False: 19.1k]
  ------------------
  278|      0|        return NULL;
  279|  19.1k|    if (!ASN1_STRING_copy(ret, str)) {
  ------------------
  |  Branch (279:9): [True: 0, False: 19.1k]
  ------------------
  280|      0|        ASN1_STRING_free(ret);
  281|      0|        return NULL;
  282|      0|    }
  283|  19.1k|    return ret;
  284|  19.1k|}
ASN1_STRING_set:
  287|   525k|{
  288|   525k|    unsigned char *c;
  289|   525k|    const char *data = _data;
  290|   525k|    size_t len;
  291|       |
  292|   525k|    if (len_in < 0) {
  ------------------
  |  Branch (292:9): [True: 21.1k, False: 504k]
  ------------------
  293|  21.1k|        if (data == NULL)
  ------------------
  |  Branch (293:13): [True: 0, False: 21.1k]
  ------------------
  294|      0|            return 0;
  295|  21.1k|        len = strlen(data);
  296|   504k|    } else {
  297|   504k|        len = (size_t)len_in;
  298|   504k|    }
  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|   525k|    if (len > INT_MAX - 1) {
  ------------------
  |  Branch (304:9): [True: 0, False: 525k]
  ------------------
  305|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|        return 0;
  307|      0|    }
  308|   525k|    if ((size_t)str->length <= len || str->data == NULL) {
  ------------------
  |  Branch (308:9): [True: 525k, False: 0]
  |  Branch (308:39): [True: 0, False: 0]
  ------------------
  309|   525k|        c = str->data;
  310|   525k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  311|       |        /* No NUL terminator in fuzzing builds */
  312|   525k|        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
  ------------------
  |  |  109|  1.05M|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   525k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   525k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (109:30): [True: 494k, False: 31.3k]
  |  |  ------------------
  ------------------
  313|       |#else
  314|       |        str->data = OPENSSL_realloc(c, len + 1);
  315|       |#endif
  316|   525k|        if (str->data == NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 525k]
  ------------------
  317|      0|            str->data = c;
  318|      0|            return 0;
  319|      0|        }
  320|   525k|    }
  321|   525k|    str->length = len;
  322|   525k|    if (data != NULL) {
  ------------------
  |  Branch (322:9): [True: 456k, False: 69.6k]
  ------------------
  323|   456k|        memcpy(str->data, data, len);
  324|   456k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  325|       |        /* Set the unused byte to something non NUL and printable. */
  326|   456k|        if (len == 0)
  ------------------
  |  Branch (326:13): [True: 24.3k, False: 431k]
  ------------------
  327|  24.3k|            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|   456k|    }
  336|   525k|    return 1;
  337|   525k|}
ASN1_STRING_set0:
  340|   268k|{
  341|   268k|    OPENSSL_free(str->data);
  ------------------
  |  |  115|   268k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   268k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   268k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|   268k|    str->data = data;
  343|   268k|    str->length = len;
  344|   268k|}
ASN1_STRING_new:
  347|  22.1k|{
  348|  22.1k|    return ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
  ------------------
  |  |   66|  22.1k|# define V_ASN1_OCTET_STRING             4
  ------------------
  349|  22.1k|}
ASN1_STRING_type_new:
  352|   813k|{
  353|   813k|    ASN1_STRING *ret;
  354|       |
  355|   813k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   813k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   813k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   813k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|   813k|    if (ret == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 813k]
  ------------------
  357|      0|        return NULL;
  358|   813k|    ret->type = type;
  359|   813k|    return ret;
  360|   813k|}
ossl_asn1_string_embed_free:
  363|   837k|{
  364|   837k|    if (a == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 837k]
  ------------------
  365|      0|        return;
  366|   837k|    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|   837k|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (366:9): [True: 837k, False: 0]
  ------------------
  367|   837k|        OPENSSL_free(a->data);
  ------------------
  |  |  115|   837k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   837k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   837k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|   837k|    if (embed == 0)
  ------------------
  |  Branch (368:9): [True: 813k, False: 24.4k]
  ------------------
  369|   813k|        OPENSSL_free(a);
  ------------------
  |  |  115|   813k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   813k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   813k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|   837k|}
ASN1_STRING_free:
  373|   393k|{
  374|   393k|    if (a == NULL)
  ------------------
  |  Branch (374:9): [True: 236k, False: 156k]
  ------------------
  375|   236k|        return;
  376|   156k|    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
  ------------------
  |  |  182|   156k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  377|   156k|}
ASN1_STRING_cmp:
  389|  1.04k|{
  390|  1.04k|    int i;
  391|       |
  392|  1.04k|    i = (a->length - b->length);
  393|  1.04k|    if (i == 0) {
  ------------------
  |  Branch (393:9): [True: 966, False: 83]
  ------------------
  394|    966|        if (a->length != 0)
  ------------------
  |  Branch (394:13): [True: 966, False: 0]
  ------------------
  395|    966|            i = memcmp(a->data, b->data, a->length);
  396|    966|        if (i == 0)
  ------------------
  |  Branch (396:13): [True: 738, False: 228]
  ------------------
  397|    738|            return a->type - b->type;
  398|    228|        else
  399|    228|            return i;
  400|    966|    } else {
  401|     83|        return i;
  402|     83|    }
  403|  1.04k|}
ASN1_STRING_length:
  406|  6.85k|{
  407|  6.85k|    return x->length;
  408|  6.85k|}
ASN1_STRING_get0_data:
  423|  6.85k|{
  424|  6.85k|    return x->data;
  425|  6.85k|}
asn1_lib.c:asn1_get_length:
  118|  21.7M|{
  119|  21.7M|    const unsigned char *p = *pp;
  120|  21.7M|    unsigned long ret = 0;
  121|  21.7M|    int i;
  122|       |
  123|  21.7M|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 21.7M]
  ------------------
  124|      0|        return 0;
  125|  21.7M|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 1.78M, False: 19.9M]
  ------------------
  126|  1.78M|        *inf = 1;
  127|  1.78M|        p++;
  128|  19.9M|    } else {
  129|  19.9M|        *inf = 0;
  130|  19.9M|        i = *p & 0x7f;
  131|  19.9M|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 265k, False: 19.6M]
  ------------------
  132|   265k|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 2.13k, False: 263k]
  ------------------
  133|  2.13k|                return 0;
  134|       |            /* Skip leading zeroes */
  135|   280k|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 263k, False: 16.5k]
  |  Branch (135:29): [True: 16.9k, False: 246k]
  ------------------
  136|  16.9k|                p++;
  137|  16.9k|                i--;
  138|  16.9k|            }
  139|   263k|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 140, False: 263k]
  ------------------
  140|    140|                return 0;
  141|   567k|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 303k, False: 263k]
  ------------------
  142|   303k|                ret <<= 8;
  143|   303k|                ret |= *p++;
  144|   303k|                i--;
  145|   303k|            }
  146|   263k|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 148, False: 263k]
  ------------------
  147|    148|                return 0;
  148|  19.6M|        } else {
  149|  19.6M|            ret = i;
  150|  19.6M|        }
  151|  19.9M|    }
  152|  21.7M|    *pp = p;
  153|  21.7M|    *rl = (long)ret;
  154|  21.7M|    return 1;
  155|  21.7M|}
asn1_lib.c:asn1_put_length:
  201|   722k|{
  202|   722k|    unsigned char *p = *pp;
  203|   722k|    int i, len;
  204|       |
  205|   722k|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 689k, False: 32.8k]
  ------------------
  206|   689k|        *(p++) = (unsigned char)length;
  207|   689k|    } else {
  208|  32.8k|        len = length;
  209|  91.8k|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 58.9k, False: 32.8k]
  ------------------
  210|  58.9k|            len >>= 8;
  211|  32.8k|        *(p++) = i | 0x80;
  212|  32.8k|        len = i;
  213|  91.8k|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 58.9k, False: 32.8k]
  ------------------
  214|  58.9k|            p[i] = length & 0xff;
  215|  58.9k|            length >>= 8;
  216|  58.9k|        }
  217|  32.8k|        p += len;
  218|  32.8k|    }
  219|   722k|    *pp = p;
  220|   722k|}

ASN1_parse_dump:
   90|  10.1k|{
   91|  10.1k|    return asn1_parse2(bp, &pp, len, 0, 0, indent, dump);
   92|  10.1k|}
ASN1_tag2str:
  361|  62.6k|{
  362|  62.6k|    static const char *const tag2str[] = {
  363|       |        /* 0-4 */
  364|  62.6k|        "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING",
  365|       |        /* 5-9 */
  366|  62.6k|        "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",
  367|       |        /* 10-13 */
  368|  62.6k|        "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",
  369|       |        /* 15-17 */
  370|  62.6k|        "<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",
  371|       |        /* 18-20 */
  372|  62.6k|        "NUMERICSTRING", "PRINTABLESTRING", "T61STRING",
  373|       |        /* 21-24 */
  374|  62.6k|        "VIDEOTEXSTRING", "IA5STRING", "UTCTIME", "GENERALIZEDTIME",
  375|       |        /* 25-27 */
  376|  62.6k|        "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",
  377|       |        /* 28-30 */
  378|  62.6k|        "UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"
  379|  62.6k|    };
  380|       |
  381|  62.6k|    if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
  ------------------
  |  |   98|  62.6k|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  62.6k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
                  if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
  ------------------
  |  |   99|  62.6k|# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  62.6k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (381:9): [True: 1, False: 62.6k]
  |  Branch (381:40): [True: 1, False: 62.6k]
  ------------------
  382|      2|        tag &= ~0x100;
  383|       |
  384|  62.6k|    if (tag < 0 || tag > 30)
  ------------------
  |  Branch (384:9): [True: 1.23k, False: 61.4k]
  |  Branch (384:20): [True: 131, False: 61.2k]
  ------------------
  385|  1.36k|        return "(unknown)";
  386|  61.2k|    return tag2str[tag];
  387|  62.6k|}
asn1_parse.c:asn1_parse2:
   96|  22.6k|{
   97|  22.6k|    const unsigned char *p, *ep, *tot, *op, *opp;
   98|  22.6k|    long len;
   99|  22.6k|    int tag, xclass, ret = 0;
  100|  22.6k|    int nl, hl, j, r;
  101|  22.6k|    ASN1_OBJECT *o = NULL;
  102|  22.6k|    ASN1_OCTET_STRING *os = NULL;
  103|  22.6k|    ASN1_INTEGER *ai = NULL;
  104|  22.6k|    ASN1_ENUMERATED *ae = NULL;
  105|       |    /* ASN1_BMPSTRING *bmp=NULL; */
  106|  22.6k|    int dump_indent, dump_cont = 0;
  107|       |
  108|  22.6k|    if (depth > ASN1_PARSE_MAXDEPTH) {
  ------------------
  |  |   17|  22.6k|#define ASN1_PARSE_MAXDEPTH 128
  ------------------
  |  Branch (108:9): [True: 1, False: 22.6k]
  ------------------
  109|      1|        BIO_puts(bp, "BAD RECURSION DEPTH\n");
  110|      1|        return 0;
  111|      1|    }
  112|       |
  113|  22.6k|    dump_indent = 6;            /* Because we know BIO_dump_indent() */
  114|  22.6k|    p = *pp;
  115|  22.6k|    tot = p + length;
  116|  75.2k|    while (length > 0) {
  ------------------
  |  Branch (116:12): [True: 61.8k, False: 13.4k]
  ------------------
  117|  61.8k|        op = p;
  118|  61.8k|        j = ASN1_get_object(&p, &len, &tag, &xclass, length);
  119|  61.8k|        if (j & 0x80) {
  ------------------
  |  Branch (119:13): [True: 550, False: 61.2k]
  ------------------
  120|    550|            BIO_puts(bp, "Error in encoding\n");
  121|    550|            goto end;
  122|    550|        }
  123|  61.2k|        hl = (p - op);
  124|  61.2k|        length -= hl;
  125|       |        /*
  126|       |         * if j == 0x21 it is a constructed indefinite length object
  127|       |         */
  128|  61.2k|        if (!asn1_print_info(bp, (long)offset + (long)(op - *pp), depth,
  ------------------
  |  Branch (128:13): [True: 0, False: 61.2k]
  ------------------
  129|  61.2k|                             hl, len, tag, xclass, j, (indent) ? depth : 0))
  ------------------
  |  Branch (129:55): [True: 61.2k, False: 0]
  ------------------
  130|      0|            goto end;
  131|  61.2k|        if (j & V_ASN1_CONSTRUCTED) {
  ------------------
  |  |   52|  61.2k|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (131:13): [True: 16.5k, False: 44.6k]
  ------------------
  132|  16.5k|            const unsigned char *sp = p;
  133|       |
  134|  16.5k|            ep = p + len;
  135|  16.5k|            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (135:17): [True: 0, False: 16.5k]
  ------------------
  136|      0|                goto end;
  137|  16.5k|            if (len > length) {
  ------------------
  |  Branch (137:17): [True: 0, False: 16.5k]
  ------------------
  138|      0|                BIO_printf(bp, "length is greater than %ld\n", length);
  139|      0|                goto end;
  140|      0|            }
  141|  16.5k|            if ((j == 0x21) && (len == 0)) {
  ------------------
  |  Branch (141:17): [True: 3.68k, False: 12.8k]
  |  Branch (141:32): [True: 3.68k, False: 0]
  ------------------
  142|  3.68k|                for (;;) {
  143|  3.68k|                    r = asn1_parse2(bp, &p, (long)(tot - p),
  144|  3.68k|                                    offset + (p - *pp), depth + 1,
  145|  3.68k|                                    indent, dump);
  146|  3.68k|                    if (r == 0)
  ------------------
  |  Branch (146:25): [True: 969, False: 2.72k]
  ------------------
  147|    969|                        goto end;
  148|  2.72k|                    if ((r == 2) || (p >= tot)) {
  ------------------
  |  Branch (148:25): [True: 1.20k, False: 1.51k]
  |  Branch (148:37): [True: 1.51k, False: 0]
  ------------------
  149|  2.72k|                        len = p - sp;
  150|  2.72k|                        break;
  151|  2.72k|                    }
  152|  2.72k|                }
  153|  12.8k|            } else {
  154|  12.8k|                long tmp = len;
  155|       |
  156|  21.0k|                while (p < ep) {
  ------------------
  |  Branch (156:24): [True: 8.81k, False: 12.2k]
  ------------------
  157|  8.81k|                    sp = p;
  158|  8.81k|                    r = asn1_parse2(bp, &p, tmp,
  159|  8.81k|                                    offset + (p - *pp), depth + 1,
  160|  8.81k|                                    indent, dump);
  161|  8.81k|                    if (r == 0)
  ------------------
  |  Branch (161:25): [True: 680, False: 8.13k]
  ------------------
  162|    680|                        goto end;
  163|  8.13k|                    tmp -= p - sp;
  164|  8.13k|                }
  165|  12.8k|            }
  166|  44.6k|        } else if (xclass != 0) {
  ------------------
  |  Branch (166:20): [True: 1.74k, False: 42.9k]
  ------------------
  167|  1.74k|            p += len;
  168|  1.74k|            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (168:17): [True: 0, False: 1.74k]
  ------------------
  169|      0|                goto end;
  170|  42.9k|        } else {
  171|  42.9k|            nl = 0;
  172|  42.9k|            if ((tag == V_ASN1_PRINTABLESTRING) ||
  ------------------
  |  |   77|  42.9k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (172:17): [True: 237, False: 42.7k]
  ------------------
  173|  42.9k|                (tag == V_ASN1_T61STRING) ||
  ------------------
  |  |   78|  42.7k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (173:17): [True: 270, False: 42.4k]
  ------------------
  174|  42.9k|                (tag == V_ASN1_IA5STRING) ||
  ------------------
  |  |   81|  42.4k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (174:17): [True: 361, False: 42.0k]
  ------------------
  175|  42.9k|                (tag == V_ASN1_VISIBLESTRING) ||
  ------------------
  |  |   86|  42.0k|# define V_ASN1_VISIBLESTRING            26 /* alias */
  ------------------
  |  Branch (175:17): [True: 239, False: 41.8k]
  ------------------
  176|  42.9k|                (tag == V_ASN1_NUMERICSTRING) ||
  ------------------
  |  |   76|  41.8k|# define V_ASN1_NUMERICSTRING            18
  ------------------
  |  Branch (176:17): [True: 212, False: 41.6k]
  ------------------
  177|  42.9k|                (tag == V_ASN1_UTF8STRING) ||
  ------------------
  |  |   73|  41.6k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (177:17): [True: 270, False: 41.3k]
  ------------------
  178|  42.9k|                (tag == V_ASN1_UTCTIME) || (tag == V_ASN1_GENERALIZEDTIME)) {
  ------------------
  |  |   82|  41.3k|# define V_ASN1_UTCTIME                  23
  ------------------
                              (tag == V_ASN1_UTCTIME) || (tag == V_ASN1_GENERALIZEDTIME)) {
  ------------------
  |  |   83|  40.6k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (178:17): [True: 739, False: 40.6k]
  |  Branch (178:44): [True: 222, False: 40.3k]
  ------------------
  179|  2.55k|                if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (179:21): [True: 0, False: 2.55k]
  ------------------
  180|      0|                    goto end;
  181|  2.55k|                if ((len > 0) && BIO_write(bp, (const char *)p, (int)len)
  ------------------
  |  Branch (181:21): [True: 642, False: 1.90k]
  |  Branch (181:34): [True: 0, False: 642]
  ------------------
  182|    642|                    != (int)len)
  183|      0|                    goto end;
  184|  40.3k|            } else if (tag == V_ASN1_OBJECT) {
  ------------------
  |  |   68|  40.3k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (184:24): [True: 19.4k, False: 20.9k]
  ------------------
  185|  19.4k|                opp = op;
  186|  19.4k|                if (d2i_ASN1_OBJECT(&o, &opp, len + hl) != NULL) {
  ------------------
  |  Branch (186:21): [True: 17.4k, False: 2.09k]
  ------------------
  187|  17.4k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (187:25): [True: 0, False: 17.4k]
  ------------------
  188|      0|                        goto end;
  189|  17.4k|                    i2a_ASN1_OBJECT(bp, o);
  190|  17.4k|                } else {
  191|  2.09k|                    if (BIO_puts(bp, ":BAD OBJECT") <= 0)
  ------------------
  |  Branch (191:25): [True: 0, False: 2.09k]
  ------------------
  192|      0|                        goto end;
  193|  2.09k|                    dump_cont = 1;
  194|  2.09k|                }
  195|  20.9k|            } else if (tag == V_ASN1_BOOLEAN) {
  ------------------
  |  |   63|  20.9k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (195:24): [True: 1.71k, False: 19.1k]
  ------------------
  196|  1.71k|                if (len != 1) {
  ------------------
  |  Branch (196:21): [True: 1.40k, False: 309]
  ------------------
  197|  1.40k|                    if (BIO_puts(bp, ":BAD BOOLEAN") <= 0)
  ------------------
  |  Branch (197:25): [True: 0, False: 1.40k]
  ------------------
  198|      0|                        goto end;
  199|  1.40k|                    dump_cont = 1;
  200|  1.40k|                }
  201|  1.71k|                if (len > 0)
  ------------------
  |  Branch (201:21): [True: 1.10k, False: 610]
  ------------------
  202|  1.10k|                    BIO_printf(bp, ":%u", p[0]);
  203|  19.1k|            } else if (tag == V_ASN1_BMPSTRING) {
  ------------------
  |  |   89|  19.1k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (203:24): [True: 343, False: 18.8k]
  ------------------
  204|       |                /* do the BMP thang */
  205|  18.8k|            } else if (tag == V_ASN1_OCTET_STRING) {
  ------------------
  |  |   66|  18.8k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (205:24): [True: 3.56k, False: 15.2k]
  ------------------
  206|  3.56k|                int i, printable = 1;
  207|       |
  208|  3.56k|                opp = op;
  209|  3.56k|                os = d2i_ASN1_OCTET_STRING(NULL, &opp, len + hl);
  210|  3.56k|                if (os != NULL && os->length > 0) {
  ------------------
  |  Branch (210:21): [True: 2.95k, False: 614]
  |  Branch (210:35): [True: 1.59k, False: 1.36k]
  ------------------
  211|  1.59k|                    opp = os->data;
  212|       |                    /*
  213|       |                     * testing whether the octet string is printable
  214|       |                     */
  215|  4.15k|                    for (i = 0; i < os->length; i++) {
  ------------------
  |  Branch (215:33): [True: 3.55k, False: 602]
  ------------------
  216|  3.55k|                        if (((opp[i] < ' ') &&
  ------------------
  |  Branch (216:30): [True: 1.51k, False: 2.03k]
  ------------------
  217|  3.55k|                             (opp[i] != '\n') &&
  ------------------
  |  Branch (217:30): [True: 1.09k, False: 424]
  ------------------
  218|  3.55k|                             (opp[i] != '\r') &&
  ------------------
  |  Branch (218:30): [True: 534, False: 560]
  ------------------
  219|  3.55k|                             (opp[i] != '\t')) || (opp[i] > '~')) {
  ------------------
  |  Branch (219:30): [True: 439, False: 95]
  |  Branch (219:51): [True: 552, False: 2.56k]
  ------------------
  220|    991|                            printable = 0;
  221|    991|                            break;
  222|    991|                        }
  223|  3.55k|                    }
  224|  1.59k|                    if (printable)
  ------------------
  |  Branch (224:25): [True: 602, False: 991]
  ------------------
  225|       |                        /* printable string */
  226|    602|                    {
  227|    602|                        if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (227:29): [True: 0, False: 602]
  ------------------
  228|      0|                            goto end;
  229|    602|                        if (BIO_write(bp, (const char *)opp, os->length) <= 0)
  ------------------
  |  Branch (229:29): [True: 0, False: 602]
  ------------------
  230|      0|                            goto end;
  231|    991|                    } else if (!dump)
  ------------------
  |  Branch (231:32): [True: 991, False: 0]
  ------------------
  232|       |                        /*
  233|       |                         * not printable => print octet string as hex dump
  234|       |                         */
  235|    991|                    {
  236|    991|                        if (BIO_write(bp, "[HEX DUMP]:", 11) <= 0)
  ------------------
  |  Branch (236:29): [True: 0, False: 991]
  ------------------
  237|      0|                            goto end;
  238|  11.7k|                        for (i = 0; i < os->length; i++) {
  ------------------
  |  Branch (238:37): [True: 10.7k, False: 991]
  ------------------
  239|  10.7k|                            if (BIO_printf(bp, "%02X", opp[i]) <= 0)
  ------------------
  |  Branch (239:33): [True: 0, False: 10.7k]
  ------------------
  240|      0|                                goto end;
  241|  10.7k|                        }
  242|    991|                    } 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|  1.59k|                }
  259|  3.56k|                ASN1_OCTET_STRING_free(os);
  260|  3.56k|                os = NULL;
  261|  15.2k|            } else if (tag == V_ASN1_INTEGER) {
  ------------------
  |  |   64|  15.2k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (261:24): [True: 3.10k, False: 12.1k]
  ------------------
  262|  3.10k|                int i;
  263|       |
  264|  3.10k|                opp = op;
  265|  3.10k|                ai = d2i_ASN1_INTEGER(NULL, &opp, len + hl);
  266|  3.10k|                if (ai != NULL) {
  ------------------
  |  Branch (266:21): [True: 1.41k, False: 1.69k]
  ------------------
  267|  1.41k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (267:25): [True: 0, False: 1.41k]
  ------------------
  268|      0|                        goto end;
  269|  1.41k|                    if (ai->type == V_ASN1_NEG_INTEGER)
  ------------------
  |  |   98|  1.41k|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  1.41k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (269:25): [True: 369, False: 1.04k]
  ------------------
  270|    369|                        if (BIO_write(bp, "-", 1) <= 0)
  ------------------
  |  Branch (270:29): [True: 0, False: 369]
  ------------------
  271|      0|                            goto end;
  272|   563k|                    for (i = 0; i < ai->length; i++) {
  ------------------
  |  Branch (272:33): [True: 561k, False: 1.41k]
  ------------------
  273|   561k|                        if (BIO_printf(bp, "%02X", ai->data[i]) <= 0)
  ------------------
  |  Branch (273:29): [True: 0, False: 561k]
  ------------------
  274|      0|                            goto end;
  275|   561k|                    }
  276|  1.41k|                    if (ai->length == 0) {
  ------------------
  |  Branch (276:25): [True: 0, False: 1.41k]
  ------------------
  277|      0|                        if (BIO_write(bp, "00", 2) <= 0)
  ------------------
  |  Branch (277:29): [True: 0, False: 0]
  ------------------
  278|      0|                            goto end;
  279|      0|                    }
  280|  1.69k|                } else {
  281|  1.69k|                    if (BIO_puts(bp, ":BAD INTEGER") <= 0)
  ------------------
  |  Branch (281:25): [True: 0, False: 1.69k]
  ------------------
  282|      0|                        goto end;
  283|  1.69k|                    dump_cont = 1;
  284|  1.69k|                }
  285|  3.10k|                ASN1_INTEGER_free(ai);
  286|  3.10k|                ai = NULL;
  287|  12.1k|            } else if (tag == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|  12.1k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (287:24): [True: 1.88k, False: 10.2k]
  ------------------
  288|  1.88k|                int i;
  289|       |
  290|  1.88k|                opp = op;
  291|  1.88k|                ae = d2i_ASN1_ENUMERATED(NULL, &opp, len + hl);
  292|  1.88k|                if (ae != NULL) {
  ------------------
  |  Branch (292:21): [True: 632, False: 1.24k]
  ------------------
  293|    632|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (293:25): [True: 0, False: 632]
  ------------------
  294|      0|                        goto end;
  295|    632|                    if (ae->type == V_ASN1_NEG_ENUMERATED)
  ------------------
  |  |   99|    632|# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|    632|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (295:25): [True: 201, False: 431]
  ------------------
  296|    201|                        if (BIO_write(bp, "-", 1) <= 0)
  ------------------
  |  Branch (296:29): [True: 0, False: 201]
  ------------------
  297|      0|                            goto end;
  298|  74.2k|                    for (i = 0; i < ae->length; i++) {
  ------------------
  |  Branch (298:33): [True: 73.6k, False: 632]
  ------------------
  299|  73.6k|                        if (BIO_printf(bp, "%02X", ae->data[i]) <= 0)
  ------------------
  |  Branch (299:29): [True: 0, False: 73.6k]
  ------------------
  300|      0|                            goto end;
  301|  73.6k|                    }
  302|    632|                    if (ae->length == 0) {
  ------------------
  |  Branch (302:25): [True: 0, False: 632]
  ------------------
  303|      0|                        if (BIO_write(bp, "00", 2) <= 0)
  ------------------
  |  Branch (303:29): [True: 0, False: 0]
  ------------------
  304|      0|                            goto end;
  305|      0|                    }
  306|  1.24k|                } else {
  307|  1.24k|                    if (BIO_puts(bp, ":BAD ENUMERATED") <= 0)
  ------------------
  |  Branch (307:25): [True: 0, False: 1.24k]
  ------------------
  308|      0|                        goto end;
  309|  1.24k|                    dump_cont = 1;
  310|  1.24k|                }
  311|  1.88k|                ASN1_ENUMERATED_free(ae);
  312|  1.88k|                ae = NULL;
  313|  10.2k|            } else if (len > 0 && dump) {
  ------------------
  |  Branch (313:24): [True: 756, False: 9.53k]
  |  Branch (313:35): [True: 0, False: 756]
  ------------------
  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|  42.9k|            if (dump_cont) {
  ------------------
  |  Branch (324:17): [True: 6.43k, False: 36.5k]
  ------------------
  325|  6.43k|                int i;
  326|  6.43k|                const unsigned char *tmp = op + hl;
  327|  6.43k|                if (BIO_puts(bp, ":[") <= 0)
  ------------------
  |  Branch (327:21): [True: 0, False: 6.43k]
  ------------------
  328|      0|                    goto end;
  329|  1.25M|                for (i = 0; i < len; i++) {
  ------------------
  |  Branch (329:29): [True: 1.24M, False: 6.43k]
  ------------------
  330|  1.24M|                    if (BIO_printf(bp, "%02X", tmp[i]) <= 0)
  ------------------
  |  Branch (330:25): [True: 0, False: 1.24M]
  ------------------
  331|      0|                        goto end;
  332|  1.24M|                }
  333|  6.43k|                if (BIO_puts(bp, "]") <= 0)
  ------------------
  |  Branch (333:21): [True: 0, False: 6.43k]
  ------------------
  334|      0|                    goto end;
  335|  6.43k|                dump_cont = 0;
  336|  6.43k|            }
  337|       |
  338|  42.9k|            if (!nl) {
  ------------------
  |  Branch (338:17): [True: 42.9k, False: 0]
  ------------------
  339|  42.9k|                if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (339:21): [True: 0, False: 42.9k]
  ------------------
  340|      0|                    goto end;
  341|  42.9k|            }
  342|  42.9k|            p += len;
  343|  42.9k|            if ((tag == V_ASN1_EOC) && (xclass == 0)) {
  ------------------
  |  |   62|  42.9k|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (343:17): [True: 7.08k, False: 35.8k]
  |  Branch (343:40): [True: 7.08k, False: 0]
  ------------------
  344|  7.08k|                ret = 2;        /* End of sequence */
  345|  7.08k|                goto end;
  346|  7.08k|            }
  347|  42.9k|        }
  348|  52.5k|        length -= len;
  349|  52.5k|    }
  350|  13.4k|    ret = 1;
  351|  22.6k| end:
  352|  22.6k|    ASN1_OBJECT_free(o);
  353|  22.6k|    ASN1_OCTET_STRING_free(os);
  354|  22.6k|    ASN1_INTEGER_free(ai);
  355|  22.6k|    ASN1_ENUMERATED_free(ae);
  356|  22.6k|    *pp = p;
  357|  22.6k|    return ret;
  358|  13.4k|}
asn1_parse.c:asn1_print_info:
   24|  61.2k|{
   25|  61.2k|    char str[128];
   26|  61.2k|    const char *p;
   27|  61.2k|    int pop_f_prefix = 0;
   28|  61.2k|    long saved_indent = -1;
   29|  61.2k|    int i = 0;
   30|  61.2k|    BIO *bio = NULL;
   31|       |
   32|  61.2k|    if (constructed & V_ASN1_CONSTRUCTED)
  ------------------
  |  |   52|  61.2k|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (32:9): [True: 16.5k, False: 44.6k]
  ------------------
   33|  16.5k|        p = "cons: ";
   34|  44.6k|    else
   35|  44.6k|        p = "prim: ";
   36|  61.2k|    if (constructed != (V_ASN1_CONSTRUCTED | 1)) {
  ------------------
  |  |   52|  61.2k|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (36:9): [True: 57.5k, False: 3.68k]
  ------------------
   37|  57.5k|        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=%4ld %s",
  ------------------
  |  Branch (37:13): [True: 0, False: 57.5k]
  ------------------
   38|  57.5k|                         offset, depth, (long)hl, len, p) <= 0)
   39|      0|            goto err;
   40|  57.5k|    } else {
   41|  3.68k|        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=inf  %s",
  ------------------
  |  Branch (41:13): [True: 0, False: 3.68k]
  ------------------
   42|  3.68k|                         offset, depth, (long)hl, p) <= 0)
   43|      0|            goto err;
   44|  3.68k|    }
   45|  61.2k|    if (bp != NULL) {
  ------------------
  |  Branch (45:9): [True: 61.2k, False: 0]
  ------------------
   46|  61.2k|        if (BIO_set_prefix(bp, str) <= 0) {
  ------------------
  |  |  701|  61.2k|# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
  |  |  ------------------
  |  |  |  |  175|  61.2k|# define BIO_CTRL_SET_PREFIX                    79
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 61.2k, False: 0]
  ------------------
   47|  61.2k|            if ((bio = BIO_new(BIO_f_prefix())) == NULL
  ------------------
  |  Branch (47:17): [True: 0, False: 61.2k]
  ------------------
   48|  61.2k|                    || (bp = BIO_push(bio, bp)) == NULL)
  ------------------
  |  Branch (48:24): [True: 0, False: 61.2k]
  ------------------
   49|      0|                goto err;
   50|  61.2k|            pop_f_prefix = 1;
   51|  61.2k|        }
   52|  61.2k|        saved_indent = BIO_get_indent(bp);
  ------------------
  |  |  703|  61.2k|# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
  |  |  ------------------
  |  |  |  |  177|  61.2k|# define BIO_CTRL_GET_INDENT                    81
  |  |  ------------------
  ------------------
   53|  61.2k|        if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
  ------------------
  |  |  701|  61.2k|# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
  |  |  ------------------
  |  |  |  |  175|  61.2k|# define BIO_CTRL_SET_PREFIX                    79
  |  |  ------------------
  ------------------
                      if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
  ------------------
  |  |  702|  61.2k|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  61.2k|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (53:13): [True: 0, False: 61.2k]
  |  Branch (53:45): [True: 0, False: 61.2k]
  ------------------
   54|      0|            goto err;
   55|  61.2k|    }
   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|  61.2k|    p = str;
   62|  61.2k|    if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
  ------------------
  |  |   50|  61.2k|# define V_ASN1_PRIVATE                  0xc0
  ------------------
                  if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
  ------------------
  |  |   50|  61.2k|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  |  Branch (62:9): [True: 1.76k, False: 59.4k]
  ------------------
   63|  1.76k|        BIO_snprintf(str, sizeof(str), "priv [ %d ] ", tag);
   64|  59.4k|    else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
  ------------------
  |  |   49|  59.4k|# define V_ASN1_CONTEXT_SPECIFIC         0x80
  ------------------
                  else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
  ------------------
  |  |   49|  59.4k|# define V_ASN1_CONTEXT_SPECIFIC         0x80
  ------------------
  |  Branch (64:14): [True: 10.7k, False: 48.7k]
  ------------------
   65|  10.7k|        BIO_snprintf(str, sizeof(str), "cont [ %d ]", tag);
   66|  48.7k|    else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  ------------------
  |  |   48|  48.7k|# define V_ASN1_APPLICATION              0x40
  ------------------
                  else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  ------------------
  |  |   48|  48.7k|# define V_ASN1_APPLICATION              0x40
  ------------------
  |  Branch (66:14): [True: 645, False: 48.0k]
  ------------------
   67|    645|        BIO_snprintf(str, sizeof(str), "appl [ %d ]", tag);
   68|  48.0k|    else if (tag > 30)
  ------------------
  |  Branch (68:14): [True: 346, False: 47.7k]
  ------------------
   69|    346|        BIO_snprintf(str, sizeof(str), "<ASN1 %d>", tag);
   70|  47.7k|    else
   71|  47.7k|        p = ASN1_tag2str(tag);
   72|       |
   73|  61.2k|    i = (BIO_printf(bp, "%-18s", p) > 0);
   74|  61.2k| err:
   75|  61.2k|    if (saved_indent >= 0)
  ------------------
  |  Branch (75:9): [True: 61.2k, False: 0]
  ------------------
   76|  61.2k|        BIO_set_indent(bp, saved_indent);
  ------------------
  |  |  702|  61.2k|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  61.2k|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
   77|  61.2k|    if (pop_f_prefix)
  ------------------
  |  Branch (77:9): [True: 61.2k, False: 0]
  ------------------
   78|  61.2k|        BIO_pop(bp);
   79|  61.2k|    BIO_free(bio);
   80|  61.2k|    return i;
   81|  61.2k|}

ASN1_item_unpack:
   53|  3.38k|{
   54|  3.38k|    const unsigned char *p;
   55|  3.38k|    void *ret;
   56|       |
   57|  3.38k|    p = oct->data;
   58|  3.38k|    if ((ret = ASN1_item_d2i(NULL, &p, oct->length, it)) == NULL)
  ------------------
  |  Branch (58:9): [True: 442, False: 2.93k]
  ------------------
   59|  3.38k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_DECODE_ERROR);
  ------------------
  |  |  401|    442|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    442|    (ERR_new(),                                                 \
  |  |  |  |  404|    442|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    442|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    442|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    442|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    442|     ERR_set_error)
  |  |  ------------------
  ------------------
   60|  3.38k|    return ret;
   61|  3.38k|}

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

ASN1_tag2bit:
   88|   290k|{
   89|   290k|    if ((tag < 0) || (tag > 30))
  ------------------
  |  Branch (89:9): [True: 0, False: 290k]
  |  Branch (89:22): [True: 28, False: 289k]
  ------------------
   90|     28|        return 0;
   91|   289k|    return tag2bit[tag];
   92|   290k|}
ASN1_item_ex_d2i:
  128|   143k|{
  129|   143k|    return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx,
  130|   143k|                                   NULL, NULL);
  131|   143k|}
ASN1_item_d2i_ex:
  137|   179k|{
  138|   179k|    ASN1_TLC c;
  139|   179k|    ASN1_VALUE *ptmpval = NULL;
  140|       |
  141|   179k|    if (pval == NULL)
  ------------------
  |  Branch (141:9): [True: 71.9k, False: 107k]
  ------------------
  142|  71.9k|        pval = &ptmpval;
  143|   179k|    asn1_tlc_clear_nc(&c);
  ------------------
  |  |   98|   179k|#define asn1_tlc_clear_nc(c)    do {(c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (98:62): [Folded - Ignored]
  |  |  ------------------
  ------------------
  144|   179k|    if (asn1_item_ex_d2i_intern(pval, in, len, it, -1, 0, 0, &c, libctx,
  ------------------
  |  Branch (144:9): [True: 157k, False: 21.9k]
  ------------------
  145|   179k|                                propq) > 0)
  146|   157k|        return *pval;
  147|  21.9k|    return NULL;
  148|   179k|}
ASN1_item_d2i:
  153|  91.6k|{
  154|  91.6k|    return ASN1_item_d2i_ex(pval, in, len, it, NULL, NULL);
  155|  91.6k|}
tasn_dec.c:asn1_item_ex_d2i_intern:
  111|   323k|{
  112|   323k|    int rv;
  113|       |
  114|   323k|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 323k]
  |  Branch (114:25): [True: 0, False: 323k]
  ------------------
  115|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  116|      0|        return 0;
  117|      0|    }
  118|   323k|    rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0,
  119|   323k|                             libctx, propq);
  120|   323k|    if (rv <= 0)
  ------------------
  |  Branch (120:9): [True: 23.3k, False: 300k]
  ------------------
  121|  23.3k|        ASN1_item_ex_free(pval, it);
  122|   323k|    return rv;
  123|   323k|}
tasn_dec.c:asn1_item_embed_d2i:
  167|  5.67M|{
  168|  5.67M|    const ASN1_TEMPLATE *tt, *errtt = NULL;
  169|  5.67M|    const ASN1_EXTERN_FUNCS *ef;
  170|  5.67M|    const ASN1_AUX *aux;
  171|  5.67M|    ASN1_aux_cb *asn1_cb;
  172|  5.67M|    const unsigned char *p = NULL, *q;
  173|  5.67M|    unsigned char oclass;
  174|  5.67M|    char seq_eoc, seq_nolen, cst, isopt;
  175|  5.67M|    long tmplen;
  176|  5.67M|    int i;
  177|  5.67M|    int otag;
  178|  5.67M|    int ret = 0;
  179|  5.67M|    ASN1_VALUE **pchptr;
  180|       |
  181|  5.67M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 5.67M]
  |  Branch (181:25): [True: 0, False: 5.67M]
  ------------------
  182|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  183|      0|        return 0;
  184|      0|    }
  185|  5.67M|    if (len <= 0) {
  ------------------
  |  Branch (185:9): [True: 4.10k, False: 5.67M]
  ------------------
  186|  4.10k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|  4.10k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.10k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.10k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  4.10k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  4.10k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.10k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.10k|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|  4.10k|        return 0;
  188|  4.10k|    }
  189|  5.67M|    aux = it->funcs;
  190|  5.67M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (190:9): [True: 216k, False: 5.45M]
  |  Branch (190:16): [True: 71.3k, False: 145k]
  ------------------
  191|  71.3k|        asn1_cb = aux->asn1_cb;
  192|  5.60M|    else
  193|  5.60M|        asn1_cb = 0;
  194|       |
  195|  5.67M|    if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
  ------------------
  |  |   26|  5.67M|#define ASN1_MAX_CONSTRUCTED_NEST 30
  ------------------
  |  Branch (195:9): [True: 1, False: 5.67M]
  ------------------
  196|      1|        ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      1|        goto err;
  198|      1|    }
  199|       |
  200|  5.67M|    switch (it->itype) {
  201|  4.40M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  4.40M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (201:5): [True: 4.40M, False: 1.26M]
  ------------------
  202|  4.40M|        if (it->templates) {
  ------------------
  |  Branch (202:13): [True: 3.31M, False: 1.09M]
  ------------------
  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.31M|            if ((tag != -1) || opt) {
  ------------------
  |  Branch (209:17): [True: 0, False: 3.31M]
  |  Branch (209:32): [True: 0, False: 3.31M]
  ------------------
  210|      0|                ERR_raise(ERR_LIB_ASN1,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|                          ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE);
  212|      0|                goto err;
  213|      0|            }
  214|  3.31M|            return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx,
  215|  3.31M|                                        depth, libctx, propq);
  216|  3.31M|        }
  217|  1.09M|        return asn1_d2i_ex_primitive(pval, in, len, it,
  218|  1.09M|                                     tag, aclass, opt, ctx);
  219|       |
  220|   154k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   154k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (220:5): [True: 154k, False: 5.52M]
  ------------------
  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|   154k|        if (tag != -1) {
  ------------------
  |  Branch (225:13): [True: 0, False: 154k]
  ------------------
  226|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  227|      0|            goto err;
  228|      0|        }
  229|       |
  230|   154k|        p = *in;
  231|       |        /* Just read in tag and class */
  232|   154k|        ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
  233|   154k|                              &p, len, -1, 0, 1, ctx);
  234|   154k|        if (!ret) {
  ------------------
  |  Branch (234:13): [True: 6, False: 154k]
  ------------------
  235|      6|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|      6|            goto err;
  237|      6|        }
  238|       |
  239|       |        /* Must be UNIVERSAL class */
  240|   154k|        if (oclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|   154k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (240:13): [True: 3, False: 154k]
  ------------------
  241|       |            /* If OPTIONAL, assume this is OK */
  242|      3|            if (opt)
  ------------------
  |  Branch (242:17): [True: 0, False: 3]
  ------------------
  243|      0|                return -1;
  244|      3|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|      3|            goto err;
  246|      3|        }
  247|       |
  248|       |        /* Check tag matches bit map */
  249|   154k|        if (!(ASN1_tag2bit(otag) & it->utype)) {
  ------------------
  |  Branch (249:13): [True: 34, False: 154k]
  ------------------
  250|       |            /* If OPTIONAL, assume this is OK */
  251|     34|            if (opt)
  ------------------
  |  Branch (251:17): [True: 0, False: 34]
  ------------------
  252|      0|                return -1;
  253|     34|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG);
  ------------------
  |  |  401|     34|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     34|    (ERR_new(),                                                 \
  |  |  |  |  404|     34|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     34|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     34|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     34|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     34|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|     34|            goto err;
  255|     34|        }
  256|   154k|        return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
  257|       |
  258|   143k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   143k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (258:5): [True: 143k, False: 5.53M]
  ------------------
  259|       |        /* Use new style d2i */
  260|   143k|        ef = it->funcs;
  261|   143k|        if (ef->asn1_ex_d2i_ex != NULL)
  ------------------
  |  Branch (261:13): [True: 113k, False: 30.3k]
  ------------------
  262|   113k|            return ef->asn1_ex_d2i_ex(pval, in, len, it, tag, aclass, opt, ctx,
  263|   113k|                                      libctx, propq);
  264|  30.3k|        return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
  265|       |
  266|  58.0k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  58.0k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (266:5): [True: 58.0k, False: 5.61M]
  ------------------
  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|  58.0k|        if (tag != -1) {
  ------------------
  |  Branch (271:13): [True: 0, False: 58.0k]
  ------------------
  272|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|            goto err;
  274|      0|        }
  275|       |
  276|  58.0k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|    262|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (276:13): [True: 262, False: 57.7k]
  |  Branch (276:24): [True: 0, False: 262]
  ------------------
  277|      0|            goto auxerr;
  278|  58.0k|        if (*pval) {
  ------------------
  |  Branch (278:13): [True: 49.2k, False: 8.73k]
  ------------------
  279|       |            /* Free up and zero CHOICE value if initialised */
  280|  49.2k|            i = ossl_asn1_get_choice_selector(pval, it);
  281|  49.2k|            if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (281:17): [True: 0, False: 49.2k]
  |  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|  49.2k|        } else if (!ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (287:20): [True: 0, False: 8.73k]
  ------------------
  288|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  289|      0|            goto err;
  290|      0|        }
  291|       |        /* CHOICE type, try each possibility in turn */
  292|  58.0k|        p = *in;
  293|   446k|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (293:41): [True: 445k, False: 563]
  ------------------
  294|   445k|            pchptr = ossl_asn1_get_field_ptr(pval, tt);
  295|       |            /*
  296|       |             * We mark field as OPTIONAL so its absence can be recognised.
  297|       |             */
  298|   445k|            ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth,
  299|   445k|                                       libctx, propq);
  300|       |            /* If field not present, try the next one */
  301|   445k|            if (ret == -1)
  ------------------
  |  Branch (301:17): [True: 388k, False: 57.4k]
  ------------------
  302|   388k|                continue;
  303|       |            /* If positive return, read OK, break loop */
  304|  57.4k|            if (ret > 0)
  ------------------
  |  Branch (304:17): [True: 49.0k, False: 8.36k]
  ------------------
  305|  49.0k|                break;
  306|       |            /*
  307|       |             * Must be an ASN1 parsing error.
  308|       |             * Free up any partial choice value
  309|       |             */
  310|  8.36k|            ossl_asn1_template_free(pchptr, tt);
  311|  8.36k|            errtt = tt;
  312|  8.36k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  8.36k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  8.36k|    (ERR_new(),                                                 \
  |  |  |  |  404|  8.36k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  8.36k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  8.36k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  8.36k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  8.36k|     ERR_set_error)
  |  |  ------------------
  ------------------
  313|  8.36k|            goto err;
  314|  57.4k|        }
  315|       |
  316|       |        /* Did we fall off the end without reading anything? */
  317|  49.6k|        if (i == it->tcount) {
  ------------------
  |  Branch (317:13): [True: 563, False: 49.0k]
  ------------------
  318|       |            /* If OPTIONAL, this is OK */
  319|    563|            if (opt) {
  ------------------
  |  Branch (319:17): [True: 469, False: 94]
  ------------------
  320|       |                /* Free and zero it */
  321|    469|                ASN1_item_ex_free(pval, it);
  322|    469|                return -1;
  323|    469|            }
  324|    563|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE);
  ------------------
  |  |  401|     94|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     94|    (ERR_new(),                                                 \
  |  |  |  |  404|     94|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     94|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     94|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     94|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     94|     ERR_set_error)
  |  |  ------------------
  ------------------
  325|     94|            goto err;
  326|    563|        }
  327|       |
  328|  49.0k|        ossl_asn1_set_choice_selector(pval, i, it);
  329|       |
  330|  49.0k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|    230|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (330:13): [True: 230, False: 48.8k]
  |  Branch (330:24): [True: 0, False: 230]
  ------------------
  331|      0|            goto auxerr;
  332|  49.0k|        *in = p;
  333|  49.0k|        return 1;
  334|       |
  335|     41|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|     41|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (335:5): [True: 41, False: 5.67M]
  ------------------
  336|   908k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|   908k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (336:5): [True: 908k, False: 4.76M]
  ------------------
  337|   908k|        p = *in;
  338|   908k|        tmplen = len;
  339|       |
  340|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  341|   908k|        if (tag == -1) {
  ------------------
  |  Branch (341:13): [True: 680k, False: 228k]
  ------------------
  342|   680k|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|   680k|# define V_ASN1_SEQUENCE                 16
  ------------------
  343|   680k|            aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|   680k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  344|   680k|        }
  345|       |        /* Get SEQUENCE length and update len, p */
  346|   908k|        ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst,
  347|   908k|                              &p, len, tag, aclass, opt, ctx);
  348|   908k|        if (!ret) {
  ------------------
  |  Branch (348:13): [True: 3.17k, False: 905k]
  ------------------
  349|  3.17k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  3.17k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.17k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.17k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.17k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.17k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.17k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.17k|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|  3.17k|            goto err;
  351|   905k|        } else if (ret == -1)
  ------------------
  |  Branch (351:20): [True: 170k, False: 735k]
  ------------------
  352|   170k|            return -1;
  353|   735k|        if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
  ------------------
  |  |  736|  38.9k|# define ASN1_AFLG_BROKEN        4
  ------------------
  |  Branch (353:13): [True: 38.9k, False: 696k]
  |  Branch (353:20): [True: 0, False: 38.9k]
  ------------------
  354|      0|            len = tmplen - (p - *in);
  355|      0|            seq_nolen = 1;
  356|      0|        }
  357|       |        /* If indefinite we don't do a length check */
  358|   735k|        else
  359|   735k|            seq_nolen = seq_eoc;
  360|   735k|        if (!cst) {
  ------------------
  |  Branch (360:13): [True: 80, False: 735k]
  ------------------
  361|     80|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|     80|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     80|    (ERR_new(),                                                 \
  |  |  |  |  404|     80|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     80|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     80|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     80|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     80|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|     80|            goto err;
  363|     80|        }
  364|       |
  365|   735k|        if (*pval == NULL
  ------------------
  |  Branch (365:13): [True: 350k, False: 384k]
  ------------------
  366|   735k|                && !ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (366:20): [True: 0, False: 350k]
  ------------------
  367|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|            goto err;
  369|      0|        }
  370|       |
  371|   735k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|  37.4k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (371:13): [True: 37.4k, False: 698k]
  |  Branch (371:24): [True: 0, False: 37.4k]
  ------------------
  372|      0|            goto auxerr;
  373|       |
  374|       |        /* Free up and zero any ADB found */
  375|  3.06M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (375:41): [True: 2.32M, False: 735k]
  ------------------
  376|  2.32M|            if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  2.32M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (376:17): [True: 5.86k, False: 2.32M]
  ------------------
  377|  5.86k|                const ASN1_TEMPLATE *seqtt;
  378|  5.86k|                ASN1_VALUE **pseqval;
  379|  5.86k|                seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  380|  5.86k|                if (seqtt == NULL)
  ------------------
  |  Branch (380:21): [True: 5.86k, False: 0]
  ------------------
  381|  5.86k|                    continue;
  382|      0|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  383|      0|                ossl_asn1_template_free(pseqval, seqtt);
  384|      0|            }
  385|  2.32M|        }
  386|       |
  387|       |        /* Get each field entry */
  388|  2.43M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (388:41): [True: 1.90M, False: 528k]
  ------------------
  389|  1.90M|            const ASN1_TEMPLATE *seqtt;
  390|  1.90M|            ASN1_VALUE **pseqval;
  391|  1.90M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  392|  1.90M|            if (seqtt == NULL)
  ------------------
  |  Branch (392:17): [True: 0, False: 1.90M]
  ------------------
  393|      0|                goto err;
  394|  1.90M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  395|       |            /* Have we ran out of data? */
  396|  1.90M|            if (!len)
  ------------------
  |  Branch (396:17): [True: 51.1k, False: 1.85M]
  ------------------
  397|  51.1k|                break;
  398|  1.85M|            q = p;
  399|  1.85M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (399:17): [True: 141k, False: 1.71M]
  ------------------
  400|   141k|                if (!seq_eoc) {
  ------------------
  |  Branch (400:21): [True: 828, False: 140k]
  ------------------
  401|    828|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    828|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    828|    (ERR_new(),                                                 \
  |  |  |  |  404|    828|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    828|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    828|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    828|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    828|     ERR_set_error)
  |  |  ------------------
  ------------------
  402|    828|                    goto err;
  403|    828|                }
  404|   140k|                len -= p - q;
  405|   140k|                seq_eoc = 0;
  406|   140k|                break;
  407|   141k|            }
  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|  1.71M|            if (i == (it->tcount - 1))
  ------------------
  |  Branch (414:17): [True: 529k, False: 1.18M]
  ------------------
  415|   529k|                isopt = 0;
  416|  1.18M|            else
  417|  1.18M|                isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
  ------------------
  |  |  523|  1.18M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  418|       |            /*
  419|       |             * attempt to read in field, allowing each to be OPTIONAL
  420|       |             */
  421|       |
  422|  1.71M|            ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,
  423|  1.71M|                                       depth, libctx, propq);
  424|  1.71M|            if (!ret) {
  ------------------
  |  Branch (424:17): [True: 15.0k, False: 1.70M]
  ------------------
  425|  15.0k|                errtt = seqtt;
  426|  15.0k|                goto err;
  427|  1.70M|            } else if (ret == -1) {
  ------------------
  |  Branch (427:24): [True: 374k, False: 1.32M]
  ------------------
  428|       |                /*
  429|       |                 * OPTIONAL component absent. Free and zero the field.
  430|       |                 */
  431|   374k|                ossl_asn1_template_free(pseqval, seqtt);
  432|   374k|                continue;
  433|   374k|            }
  434|       |            /* Update length */
  435|  1.32M|            len -= p - q;
  436|  1.32M|        }
  437|       |
  438|       |        /* Check for EOC if expecting one */
  439|   719k|        if (seq_eoc && !asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (439:13): [True: 238k, False: 481k]
  |  Branch (439:24): [True: 2.16k, False: 236k]
  ------------------
  440|  2.16k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  2.16k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.16k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.16k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.16k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.16k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.16k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.16k|     ERR_set_error)
  |  |  ------------------
  ------------------
  441|  2.16k|            goto err;
  442|  2.16k|        }
  443|       |        /* Check all data read */
  444|   717k|        if (!seq_nolen && len) {
  ------------------
  |  Branch (444:13): [True: 341k, False: 376k]
  |  Branch (444:27): [True: 898, False: 340k]
  ------------------
  445|    898|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH);
  ------------------
  |  |  401|    898|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    898|    (ERR_new(),                                                 \
  |  |  |  |  404|    898|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    898|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    898|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    898|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    898|     ERR_set_error)
  |  |  ------------------
  ------------------
  446|    898|            goto err;
  447|    898|        }
  448|       |
  449|       |        /*
  450|       |         * If we get here we've got no more data in the SEQUENCE, however we
  451|       |         * may not have read all fields so check all remaining are OPTIONAL
  452|       |         * and clear any that are.
  453|       |         */
  454|  1.27M|        for (; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (454:16): [True: 557k, False: 715k]
  ------------------
  455|   557k|            const ASN1_TEMPLATE *seqtt;
  456|   557k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  457|   557k|            if (seqtt == NULL)
  ------------------
  |  Branch (457:17): [True: 0, False: 557k]
  ------------------
  458|      0|                goto err;
  459|   557k|            if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|   557k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (459:17): [True: 556k, False: 1.03k]
  ------------------
  460|   556k|                ASN1_VALUE **pseqval;
  461|   556k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  462|   556k|                ossl_asn1_template_free(pseqval, seqtt);
  463|   556k|            } else {
  464|  1.03k|                errtt = seqtt;
  465|  1.03k|                ERR_raise(ERR_LIB_ASN1, ASN1_R_FIELD_MISSING);
  ------------------
  |  |  401|  1.03k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.03k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.03k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.03k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.03k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.03k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.03k|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|  1.03k|                goto err;
  467|  1.03k|            }
  468|   557k|        }
  469|       |        /* Save encoding */
  470|   715k|        if (!ossl_asn1_enc_save(pval, *in, p - *in, it))
  ------------------
  |  Branch (470:13): [True: 0, False: 715k]
  ------------------
  471|      0|            goto auxerr;
  472|   715k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  31.2k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (472:13): [True: 31.2k, False: 684k]
  |  Branch (472:24): [True: 0, False: 31.2k]
  ------------------
  473|      0|            goto auxerr;
  474|   715k|        *in = p;
  475|   715k|        return 1;
  476|       |
  477|      0|    default:
  ------------------
  |  Branch (477:5): [True: 0, False: 5.67M]
  ------------------
  478|      0|        return 0;
  479|  5.67M|    }
  480|      0| auxerr:
  481|      0|    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|  31.7k| err:
  483|  31.7k|    if (errtt)
  ------------------
  |  Branch (483:9): [True: 24.4k, False: 7.29k]
  ------------------
  484|  24.4k|        ERR_add_error_data(4, "Field=", errtt->field_name,
  485|  24.4k|                           ", Type=", it->sname);
  486|  7.29k|    else
  487|  7.29k|        ERR_add_error_data(2, "Type=", it->sname);
  488|  31.7k|    return 0;
  489|      0|}
tasn_dec.c:asn1_template_ex_d2i:
  501|  5.47M|{
  502|  5.47M|    int flags, aclass;
  503|  5.47M|    int ret;
  504|  5.47M|    long len;
  505|  5.47M|    const unsigned char *p, *q;
  506|  5.47M|    char exp_eoc;
  507|  5.47M|    if (!val)
  ------------------
  |  Branch (507:9): [True: 0, False: 5.47M]
  ------------------
  508|      0|        return 0;
  509|  5.47M|    flags = tt->flags;
  510|  5.47M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  5.47M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  511|       |
  512|  5.47M|    p = *in;
  513|       |
  514|       |    /* Check if EXPLICIT tag expected */
  515|  5.47M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  5.47M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (515:9): [True: 392k, False: 5.08M]
  ------------------
  516|   392k|        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|   392k|        ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
  522|   392k|                              &p, inlen, tt->tag, aclass, opt, ctx);
  523|   392k|        q = p;
  524|   392k|        if (!ret) {
  ------------------
  |  Branch (524:13): [True: 532, False: 392k]
  ------------------
  525|    532|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    532|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    532|    (ERR_new(),                                                 \
  |  |  |  |  404|    532|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    532|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    532|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    532|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    532|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|    532|            return 0;
  527|   392k|        } else if (ret == -1)
  ------------------
  |  Branch (527:20): [True: 354k, False: 37.0k]
  ------------------
  528|   354k|            return -1;
  529|  37.0k|        if (!cst) {
  ------------------
  |  Branch (529:13): [True: 75, False: 36.9k]
  ------------------
  530|     75|            ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
  ------------------
  |  |  401|     75|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     75|    (ERR_new(),                                                 \
  |  |  |  |  404|     75|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     75|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     75|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     75|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     75|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|     75|            return 0;
  532|     75|        }
  533|       |        /* We've found the field so it can't be OPTIONAL now */
  534|  36.9k|        ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth, libctx,
  535|  36.9k|                                      propq);
  536|  36.9k|        if (!ret) {
  ------------------
  |  Branch (536:13): [True: 2.24k, False: 34.7k]
  ------------------
  537|  2.24k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  2.24k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.24k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.24k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.24k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.24k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.24k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.24k|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|  2.24k|            return 0;
  539|  2.24k|        }
  540|       |        /* We read the field in OK so update length */
  541|  34.7k|        len -= p - q;
  542|  34.7k|        if (exp_eoc) {
  ------------------
  |  Branch (542:13): [True: 11.9k, False: 22.8k]
  ------------------
  543|       |            /* If NDEF we must have an EOC here */
  544|  11.9k|            if (!asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (544:17): [True: 150, False: 11.7k]
  ------------------
  545|    150|                ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    150|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    150|    (ERR_new(),                                                 \
  |  |  |  |  404|    150|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    150|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    150|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    150|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    150|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|    150|                goto err;
  547|    150|            }
  548|  22.8k|        } else {
  549|       |            /*
  550|       |             * Otherwise we must hit the EXPLICIT tag end or its an error
  551|       |             */
  552|  22.8k|            if (len) {
  ------------------
  |  Branch (552:17): [True: 13, False: 22.7k]
  ------------------
  553|     13|                ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     13|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|     13|                goto err;
  555|     13|            }
  556|  22.8k|        }
  557|  34.7k|    } else
  558|  5.08M|        return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth,
  559|  5.08M|                                       libctx, propq);
  560|       |
  561|  34.5k|    *in = p;
  562|  34.5k|    return 1;
  563|       |
  564|    163| err:
  565|    163|    return 0;
  566|  5.47M|}
tasn_dec.c:asn1_template_noexp_d2i:
  573|  5.12M|{
  574|  5.12M|    int flags, aclass;
  575|  5.12M|    int ret;
  576|  5.12M|    ASN1_VALUE *tval;
  577|  5.12M|    const unsigned char *p, *q;
  578|  5.12M|    if (!val)
  ------------------
  |  Branch (578:9): [True: 0, False: 5.12M]
  ------------------
  579|      0|        return 0;
  580|  5.12M|    flags = tt->flags;
  581|  5.12M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  5.12M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  582|       |
  583|  5.12M|    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|  5.12M|    if (tt->flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  5.12M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (589:9): [True: 25.9k, False: 5.09M]
  ------------------
  590|  25.9k|        tval = (ASN1_VALUE *)val;
  591|  25.9k|        val = &tval;
  592|  25.9k|    }
  593|       |
  594|  5.12M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  5.12M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (594:9): [True: 3.32M, False: 1.79M]
  ------------------
  595|       |        /* SET OF, SEQUENCE OF */
  596|  3.32M|        int sktag, skaclass;
  597|  3.32M|        char sk_eoc;
  598|       |        /* First work out expected inner tag value */
  599|  3.32M|        if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  3.32M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (599:13): [True: 3.83k, False: 3.32M]
  ------------------
  600|  3.83k|            sktag = tt->tag;
  601|  3.83k|            skaclass = aclass;
  602|  3.32M|        } else {
  603|  3.32M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.32M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  604|  3.32M|            if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|  3.32M|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (604:17): [True: 3.26M, False: 58.8k]
  ------------------
  605|  3.26M|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  3.26M|# define V_ASN1_SET                      17
  ------------------
  606|  58.8k|            else
  607|  58.8k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  58.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  608|  3.32M|        }
  609|       |        /* Get the tag */
  610|  3.32M|        ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL,
  611|  3.32M|                              &p, len, sktag, skaclass, opt, ctx);
  612|  3.32M|        if (!ret) {
  ------------------
  |  Branch (612:13): [True: 461, False: 3.32M]
  ------------------
  613|    461|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    461|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    461|    (ERR_new(),                                                 \
  |  |  |  |  404|    461|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    461|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    461|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    461|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    461|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|    461|            return 0;
  615|  3.32M|        } else if (ret == -1)
  ------------------
  |  Branch (615:20): [True: 1.26k, False: 3.32M]
  ------------------
  616|  1.26k|            return -1;
  617|  3.32M|        if (*val == NULL)
  ------------------
  |  Branch (617:13): [True: 3.31M, False: 3.69k]
  ------------------
  618|  3.31M|            *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  3.31M|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  619|  3.69k|        else {
  620|       |            /*
  621|       |             * We've got a valid STACK: free up any items present
  622|       |             */
  623|  3.69k|            STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val;
  ------------------
  |  |   31|  3.69k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  624|  3.69k|            ASN1_VALUE *vtmp;
  625|  3.69k|            while (sk_ASN1_VALUE_num(sktmp) > 0) {
  ------------------
  |  |  898|  3.69k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (625:20): [True: 0, False: 3.69k]
  ------------------
  626|      0|                vtmp = sk_ASN1_VALUE_pop(sktmp);
  ------------------
  |  |  910|      0|#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
  ------------------
  627|      0|                ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  628|      0|            }
  629|  3.69k|        }
  630|       |
  631|  3.32M|        if (*val == NULL) {
  ------------------
  |  Branch (631:13): [True: 0, False: 3.32M]
  ------------------
  632|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  633|      0|            goto err;
  634|      0|        }
  635|       |
  636|       |        /* Read as many items as we can */
  637|  6.87M|        while (len > 0) {
  ------------------
  |  Branch (637:16): [True: 3.56M, False: 3.30M]
  ------------------
  638|  3.56M|            ASN1_VALUE *skfield;
  639|  3.56M|            q = p;
  640|       |            /* See if EOC found */
  641|  3.56M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (641:17): [True: 11.3k, False: 3.55M]
  ------------------
  642|  11.3k|                if (!sk_eoc) {
  ------------------
  |  Branch (642:21): [True: 14, False: 11.3k]
  ------------------
  643|     14|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|     14|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     14|    (ERR_new(),                                                 \
  |  |  |  |  404|     14|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     14|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     14|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     14|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     14|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|     14|                    goto err;
  645|     14|                }
  646|  11.3k|                len -= p - q;
  647|  11.3k|                sk_eoc = 0;
  648|  11.3k|                break;
  649|  11.3k|            }
  650|  3.55M|            skfield = NULL;
  651|  3.55M|            if (asn1_item_embed_d2i(&skfield, &p, len,
  ------------------
  |  Branch (651:17): [True: 2.28k, False: 3.55M]
  ------------------
  652|  3.55M|                                     ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
  ------------------
  |  |  422|  3.55M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  653|  3.55M|                                     depth, libctx, propq) <= 0) {
  654|  2.28k|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  2.28k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.28k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.28k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.28k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.28k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.28k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.28k|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|       |                /* |skfield| may be partially allocated despite failure. */
  656|  2.28k|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|  2.28k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  657|  2.28k|                goto err;
  658|  2.28k|            }
  659|  3.55M|            len -= p - q;
  660|  3.55M|            if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
  ------------------
  |  |  908|  3.55M|#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: 3.55M]
  ------------------
  661|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  662|      0|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  663|      0|                goto err;
  664|      0|            }
  665|  3.55M|        }
  666|  3.32M|        if (sk_eoc) {
  ------------------
  |  Branch (666:13): [True: 50, False: 3.32M]
  ------------------
  667|     50|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|     50|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     50|    (ERR_new(),                                                 \
  |  |  |  |  404|     50|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     50|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     50|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     50|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     50|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|     50|            goto err;
  669|     50|        }
  670|  3.32M|    } else if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  1.79M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (670:16): [True: 480k, False: 1.31M]
  ------------------
  671|       |        /* IMPLICIT tagging */
  672|   480k|        ret = asn1_item_embed_d2i(val, &p, len,
  673|   480k|                                  ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt,
  ------------------
  |  |  422|   480k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  674|   480k|                                  ctx, depth, libctx, propq);
  675|   480k|        if (!ret) {
  ------------------
  |  Branch (675:13): [True: 614, False: 479k]
  ------------------
  676|    614|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    614|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    614|    (ERR_new(),                                                 \
  |  |  |  |  404|    614|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    614|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    614|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    614|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    614|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|    614|            goto err;
  678|   479k|        } else if (ret == -1)
  ------------------
  |  Branch (678:20): [True: 393k, False: 86.1k]
  ------------------
  679|   393k|            return -1;
  680|  1.31M|    } else {
  681|       |        /* Nothing special */
  682|  1.31M|        ret = asn1_item_embed_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  1.31M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  683|  1.31M|                                  -1, 0, opt, ctx, depth, libctx, propq);
  684|  1.31M|        if (!ret) {
  ------------------
  |  Branch (684:13): [True: 21.7k, False: 1.29M]
  ------------------
  685|  21.7k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  21.7k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  21.7k|    (ERR_new(),                                                 \
  |  |  |  |  404|  21.7k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  21.7k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  21.7k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  21.7k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  21.7k|     ERR_set_error)
  |  |  ------------------
  ------------------
  686|  21.7k|            goto err;
  687|  1.29M|        } else if (ret == -1)
  ------------------
  |  Branch (687:20): [True: 12.4k, False: 1.28M]
  ------------------
  688|  12.4k|            return -1;
  689|  1.31M|    }
  690|       |
  691|  4.69M|    *in = p;
  692|  4.69M|    return 1;
  693|       |
  694|  24.7k| err:
  695|  24.7k|    return 0;
  696|  5.12M|}
tasn_dec.c:asn1_d2i_ex_primitive:
  702|  1.24M|{
  703|  1.24M|    int ret = 0, utype;
  704|  1.24M|    long plen;
  705|  1.24M|    char cst, inf, free_cont = 0;
  706|  1.24M|    const unsigned char *p;
  707|  1.24M|    BUF_MEM buf = { 0, NULL, 0, 0 };
  708|  1.24M|    const unsigned char *cont = NULL;
  709|  1.24M|    long len;
  710|       |
  711|  1.24M|    if (pval == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 1.24M]
  ------------------
  712|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  713|      0|        return 0;               /* Should never happen */
  714|      0|    }
  715|       |
  716|  1.24M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  1.24M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (716:9): [True: 154k, False: 1.09M]
  ------------------
  717|   154k|        utype = tag;
  718|   154k|        tag = -1;
  719|   154k|    } else
  720|  1.09M|        utype = it->utype;
  721|       |
  722|  1.24M|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  1.24M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (722:9): [True: 166k, False: 1.07M]
  ------------------
  723|       |        /* If type is ANY need to figure out type from tag */
  724|   166k|        unsigned char oclass;
  725|   166k|        if (tag >= 0) {
  ------------------
  |  Branch (725:13): [True: 0, False: 166k]
  ------------------
  726|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|            return 0;
  728|      0|        }
  729|   166k|        if (opt) {
  ------------------
  |  Branch (729:13): [True: 0, False: 166k]
  ------------------
  730|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  731|      0|            return 0;
  732|      0|        }
  733|   166k|        p = *in;
  734|   166k|        ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL,
  735|   166k|                              &p, inlen, -1, 0, 0, ctx);
  736|   166k|        if (!ret) {
  ------------------
  |  Branch (736:13): [True: 121, False: 166k]
  ------------------
  737|    121|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    121|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    121|    (ERR_new(),                                                 \
  |  |  |  |  404|    121|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    121|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    121|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    121|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    121|     ERR_set_error)
  |  |  ------------------
  ------------------
  738|    121|            return 0;
  739|    121|        }
  740|   166k|        if (oclass != V_ASN1_UNIVERSAL)
  ------------------
  |  |   47|   166k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (740:13): [True: 11.3k, False: 155k]
  ------------------
  741|  11.3k|            utype = V_ASN1_OTHER;
  ------------------
  |  |   57|  11.3k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  742|   166k|    }
  743|  1.24M|    if (tag == -1) {
  ------------------
  |  Branch (743:9): [True: 994k, False: 251k]
  ------------------
  744|   994k|        tag = utype;
  745|   994k|        aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|   994k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  746|   994k|    }
  747|  1.24M|    p = *in;
  748|       |    /* Check header */
  749|  1.24M|    ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst,
  750|  1.24M|                          &p, inlen, tag, aclass, opt, ctx);
  751|  1.24M|    if (!ret) {
  ------------------
  |  Branch (751:9): [True: 3.46k, False: 1.24M]
  ------------------
  752|  3.46k|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  3.46k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.46k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.46k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.46k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.46k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.46k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.46k|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|  3.46k|        return 0;
  754|  1.24M|    } else if (ret == -1)
  ------------------
  |  Branch (754:16): [True: 235k, False: 1.00M]
  ------------------
  755|   235k|        return -1;
  756|  1.00M|    ret = 0;
  757|       |    /* SEQUENCE, SET and "OTHER" are left in encoded form */
  758|  1.00M|    if ((utype == V_ASN1_SEQUENCE)
  ------------------
  |  |   74|  1.00M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (758:9): [True: 138k, False: 869k]
  ------------------
  759|  1.00M|        || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   75|   869k|# define V_ASN1_SET                      17
  ------------------
                      || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   57|   867k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (759:12): [True: 1.51k, False: 867k]
  |  Branch (759:37): [True: 11.3k, False: 856k]
  ------------------
  760|       |        /*
  761|       |         * Clear context cache for type OTHER because the auto clear when we
  762|       |         * have a exact match won't work
  763|       |         */
  764|   151k|        if (utype == V_ASN1_OTHER) {
  ------------------
  |  |   57|   151k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (764:13): [True: 11.3k, False: 140k]
  ------------------
  765|  11.3k|            asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  11.3k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 11.3k, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
  766|  11.3k|        }
  767|       |        /* SEQUENCE and SET must be constructed */
  768|   140k|        else if (!cst) {
  ------------------
  |  Branch (768:18): [True: 15, False: 140k]
  ------------------
  769|     15|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|     15|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     15|    (ERR_new(),                                                 \
  |  |  |  |  404|     15|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     15|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     15|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     15|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     15|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|     15|            return 0;
  771|     15|        }
  772|       |
  773|   151k|        cont = *in;
  774|       |        /* If indefinite length constructed find the real end */
  775|   151k|        if (inf) {
  ------------------
  |  Branch (775:13): [True: 96.5k, False: 55.0k]
  ------------------
  776|  96.5k|            if (!asn1_find_end(&p, plen, inf))
  ------------------
  |  Branch (776:17): [True: 45, False: 96.5k]
  ------------------
  777|     45|                goto err;
  778|  96.5k|            len = p - cont;
  779|  96.5k|        } else {
  780|  55.0k|            len = p - cont + plen;
  781|  55.0k|            p += plen;
  782|  55.0k|        }
  783|   856k|    } else if (cst) {
  ------------------
  |  Branch (783:16): [True: 71.7k, False: 784k]
  ------------------
  784|  71.7k|        if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   67|   143k|# define V_ASN1_NULL                     5
  ------------------
                      if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   63|   143k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (784:13): [True: 4, False: 71.7k]
  |  Branch (784:37): [True: 12, False: 71.7k]
  ------------------
  785|  71.7k|            || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   68|   143k|# define V_ASN1_OBJECT                   6
  ------------------
                          || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   64|   142k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (785:16): [True: 573, False: 71.2k]
  |  Branch (785:42): [True: 80, False: 71.1k]
  ------------------
  786|  71.7k|            || utype == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|  71.1k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (786:16): [True: 13, False: 71.1k]
  ------------------
  787|    682|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE);
  ------------------
  |  |  401|    682|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    682|    (ERR_new(),                                                 \
  |  |  |  |  404|    682|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    682|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    682|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    682|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    682|     ERR_set_error)
  |  |  ------------------
  ------------------
  788|    682|            return 0;
  789|    682|        }
  790|       |
  791|       |        /* Free any returned 'buf' content */
  792|  71.1k|        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|  71.1k|        if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
  ------------------
  |  |   47|  71.1k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (799:13): [True: 167, False: 70.9k]
  ------------------
  800|    167|            goto err;
  801|    167|        }
  802|  70.9k|        len = buf.length;
  803|       |        /* Append a final null to string */
  804|  70.9k|        if (!BUF_MEM_grow_clean(&buf, len + 1)) {
  ------------------
  |  Branch (804:13): [True: 0, False: 70.9k]
  ------------------
  805|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  806|      0|            goto err;
  807|      0|        }
  808|  70.9k|        buf.data[len] = 0;
  809|  70.9k|        cont = (const unsigned char *)buf.data;
  810|   784k|    } else {
  811|   784k|        cont = p;
  812|   784k|        len = plen;
  813|   784k|        p += plen;
  814|   784k|    }
  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|  1.00M|    if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
  ------------------
  |  Branch (818:9): [True: 3.62k, False: 1.00M]
  ------------------
  819|  3.62k|        goto err;
  820|       |
  821|  1.00M|    *in = p;
  822|  1.00M|    ret = 1;
  823|  1.00M| err:
  824|  1.00M|    if (free_cont)
  ------------------
  |  Branch (824:9): [True: 29.3k, False: 977k]
  ------------------
  825|  29.3k|        OPENSSL_free(buf.data);
  ------------------
  |  |  115|  29.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  29.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  29.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  826|  1.00M|    return ret;
  827|  1.00M|}
tasn_dec.c:asn1_find_end:
  980|  96.5k|{
  981|  96.5k|    uint32_t expected_eoc;
  982|  96.5k|    long plen;
  983|  96.5k|    const unsigned char *p = *in, *q;
  984|       |    /* If not indefinite length constructed just add length */
  985|  96.5k|    if (inf == 0) {
  ------------------
  |  Branch (985:9): [True: 0, False: 96.5k]
  ------------------
  986|      0|        *in += len;
  987|      0|        return 1;
  988|      0|    }
  989|  96.5k|    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|  8.29M|    while (len > 0) {
  ------------------
  |  Branch (996:12): [True: 8.29M, False: 24]
  ------------------
  997|  8.29M|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (997:13): [True: 101k, False: 8.19M]
  ------------------
  998|   101k|            expected_eoc--;
  999|   101k|            if (expected_eoc == 0)
  ------------------
  |  Branch (999:17): [True: 96.5k, False: 4.50k]
  ------------------
 1000|  96.5k|                break;
 1001|  4.50k|            len -= 2;
 1002|  4.50k|            continue;
 1003|   101k|        }
 1004|  8.19M|        q = p;
 1005|       |        /* Just read in a header: only care about the length */
 1006|  8.19M|        if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len,
  ------------------
  |  Branch (1006:13): [True: 21, False: 8.19M]
  ------------------
 1007|  8.19M|                             -1, 0, 0, NULL)) {
 1008|     21|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|     21|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     21|    (ERR_new(),                                                 \
  |  |  |  |  404|     21|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     21|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     21|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     21|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     21|     ERR_set_error)
  |  |  ------------------
  ------------------
 1009|     21|            return 0;
 1010|     21|        }
 1011|  8.19M|        if (inf) {
  ------------------
  |  Branch (1011:13): [True: 4.59k, False: 8.18M]
  ------------------
 1012|  4.59k|            if (expected_eoc == UINT32_MAX) {
  ------------------
  |  Branch (1012:17): [True: 0, False: 4.59k]
  ------------------
 1013|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1014|      0|                return 0;
 1015|      0|            }
 1016|  4.59k|            expected_eoc++;
 1017|  8.18M|        } else {
 1018|  8.18M|            p += plen;
 1019|  8.18M|        }
 1020|  8.19M|        len -= p - q;
 1021|  8.19M|    }
 1022|  96.5k|    if (expected_eoc) {
  ------------------
  |  Branch (1022:9): [True: 24, False: 96.5k]
  ------------------
 1023|     24|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     24|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     24|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     24|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     24|     ERR_set_error)
  |  |  ------------------
  ------------------
 1024|     24|        return 0;
 1025|     24|    }
 1026|  96.5k|    *in = p;
 1027|  96.5k|    return 1;
 1028|  96.5k|}
tasn_dec.c:asn1_collect:
 1048|  77.2k|{
 1049|  77.2k|    const unsigned char *p, *q;
 1050|  77.2k|    long plen;
 1051|  77.2k|    char cst, ininf;
 1052|  77.2k|    p = *in;
 1053|  77.2k|    inf &= 1;
 1054|       |    /*
 1055|       |     * If no buffer and not indefinite length constructed just pass over the
 1056|       |     * encoded data
 1057|       |     */
 1058|  77.2k|    if (!buf && !inf) {
  ------------------
  |  Branch (1058:9): [True: 0, False: 77.2k]
  |  Branch (1058:17): [True: 0, False: 0]
  ------------------
 1059|      0|        *in += len;
 1060|      0|        return 1;
 1061|      0|    }
 1062|   292k|    while (len > 0) {
  ------------------
  |  Branch (1062:12): [True: 241k, False: 50.9k]
  ------------------
 1063|   241k|        q = p;
 1064|       |        /* Check for EOC */
 1065|   241k|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (1065:13): [True: 26.1k, False: 215k]
  ------------------
 1066|       |            /*
 1067|       |             * EOC is illegal outside indefinite length constructed form
 1068|       |             */
 1069|  26.1k|            if (!inf) {
  ------------------
  |  Branch (1069:17): [True: 12, False: 26.1k]
  ------------------
 1070|     12|                ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
 1071|     12|                return 0;
 1072|     12|            }
 1073|  26.1k|            inf = 0;
 1074|  26.1k|            break;
 1075|  26.1k|        }
 1076|       |
 1077|   215k|        if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p,
  ------------------
  |  Branch (1077:13): [True: 96, False: 215k]
  ------------------
 1078|   215k|                             len, tag, aclass, 0, NULL)) {
 1079|     96|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     96|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     96|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     96|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     96|     ERR_set_error)
  |  |  ------------------
  ------------------
 1080|     96|            return 0;
 1081|     96|        }
 1082|       |
 1083|       |        /* If indefinite length constructed update max length */
 1084|   215k|        if (cst) {
  ------------------
  |  Branch (1084:13): [True: 6.14k, False: 209k]
  ------------------
 1085|  6.14k|            if (depth >= ASN1_MAX_STRING_NEST) {
  ------------------
  |  | 1043|  6.14k|# define ASN1_MAX_STRING_NEST 5
  ------------------
  |  Branch (1085:17): [True: 3, False: 6.14k]
  ------------------
 1086|      3|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
 1087|      3|                return 0;
 1088|      3|            }
 1089|  6.14k|            if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1))
  ------------------
  |  Branch (1089:17): [True: 85, False: 6.05k]
  ------------------
 1090|     85|                return 0;
 1091|   209k|        } else if (plen && !collect_data(buf, &p, plen))
  ------------------
  |  Branch (1091:20): [True: 195k, False: 13.6k]
  |  Branch (1091:28): [True: 0, False: 195k]
  ------------------
 1092|      0|            return 0;
 1093|   215k|        len -= p - q;
 1094|   215k|    }
 1095|  77.0k|    if (inf) {
  ------------------
  |  Branch (1095:9): [True: 56, False: 77.0k]
  ------------------
 1096|     56|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|     56|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     56|    (ERR_new(),                                                 \
  |  |  |  |  404|     56|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     56|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     56|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     56|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     56|     ERR_set_error)
  |  |  ------------------
  ------------------
 1097|     56|        return 0;
 1098|     56|    }
 1099|  77.0k|    *in = p;
 1100|  77.0k|    return 1;
 1101|  77.0k|}
tasn_dec.c:collect_data:
 1104|   195k|{
 1105|   195k|    int len;
 1106|   195k|    if (buf) {
  ------------------
  |  Branch (1106:9): [True: 195k, False: 0]
  ------------------
 1107|   195k|        len = buf->length;
 1108|   195k|        if (!BUF_MEM_grow_clean(buf, len + plen)) {
  ------------------
  |  Branch (1108:13): [True: 0, False: 195k]
  ------------------
 1109|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1110|      0|            return 0;
 1111|      0|        }
 1112|   195k|        memcpy(buf->data + len, *p, plen);
 1113|   195k|    }
 1114|   195k|    *p += plen;
 1115|   195k|    return 1;
 1116|   195k|}
tasn_dec.c:asn1_ex_c2i:
  833|  1.00M|{
  834|  1.00M|    ASN1_VALUE **opval = NULL;
  835|  1.00M|    ASN1_STRING *stmp;
  836|  1.00M|    ASN1_TYPE *typ = NULL;
  837|  1.00M|    int ret = 0;
  838|  1.00M|    const ASN1_PRIMITIVE_FUNCS *pf;
  839|  1.00M|    ASN1_INTEGER **tint;
  840|  1.00M|    pf = it->funcs;
  841|       |
  842|  1.00M|    if (pf && pf->prim_c2i)
  ------------------
  |  Branch (842:9): [True: 31.3k, False: 975k]
  |  Branch (842:15): [True: 31.3k, False: 0]
  ------------------
  843|  31.3k|        return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
  844|       |    /* If ANY type clear type and set pointer to internal value */
  845|   975k|    if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|   975k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (845:9): [True: 166k, False: 808k]
  ------------------
  846|   166k|        if (*pval == NULL) {
  ------------------
  |  Branch (846:13): [True: 166k, False: 9]
  ------------------
  847|   166k|            typ = ASN1_TYPE_new();
  848|   166k|            if (typ == NULL)
  ------------------
  |  Branch (848:17): [True: 0, False: 166k]
  ------------------
  849|      0|                goto err;
  850|   166k|            *pval = (ASN1_VALUE *)typ;
  851|   166k|        } else
  852|      9|            typ = (ASN1_TYPE *)*pval;
  853|       |
  854|   166k|        if (utype != typ->type)
  ------------------
  |  Branch (854:13): [True: 166k, False: 0]
  ------------------
  855|   166k|            ASN1_TYPE_set(typ, utype, NULL);
  856|   166k|        opval = pval;
  857|   166k|        pval = &typ->value.asn1_value;
  858|   166k|    }
  859|   975k|    switch (utype) {
  860|   428k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|   428k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (860:5): [True: 428k, False: 546k]
  ------------------
  861|   428k|        if (!ossl_c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
  ------------------
  |  Branch (861:13): [True: 97, False: 428k]
  ------------------
  862|     97|            goto err;
  863|   428k|        break;
  864|       |
  865|   428k|    case V_ASN1_NULL:
  ------------------
  |  |   67|  13.2k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (865:5): [True: 13.2k, False: 962k]
  ------------------
  866|  13.2k|        if (len) {
  ------------------
  |  Branch (866:13): [True: 4, False: 13.2k]
  ------------------
  867|      4|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  868|      4|            goto err;
  869|      4|        }
  870|  13.2k|        *pval = (ASN1_VALUE *)1;
  871|  13.2k|        break;
  872|       |
  873|  3.60k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  3.60k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (873:5): [True: 3.60k, False: 971k]
  ------------------
  874|  3.60k|        if (len != 1) {
  ------------------
  |  Branch (874:13): [True: 16, False: 3.58k]
  ------------------
  875|     16|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     16|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     16|    (ERR_new(),                                                 \
  |  |  |  |  404|     16|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     16|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     16|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|     16|            goto err;
  877|  3.58k|        } else {
  878|  3.58k|            ASN1_BOOLEAN *tbool;
  879|  3.58k|            tbool = (ASN1_BOOLEAN *)pval;
  880|  3.58k|            *tbool = *cont;
  881|  3.58k|        }
  882|  3.58k|        break;
  883|       |
  884|   183k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|   183k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (884:5): [True: 183k, False: 792k]
  ------------------
  885|   183k|        if (!ossl_c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
  ------------------
  |  Branch (885:13): [True: 56, False: 183k]
  ------------------
  886|     56|            goto err;
  887|   183k|        break;
  888|       |
  889|   183k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  52.9k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (889:5): [True: 52.9k, False: 922k]
  ------------------
  890|  54.8k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  54.8k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (890:5): [True: 1.95k, False: 973k]
  ------------------
  891|  54.8k|        tint = (ASN1_INTEGER **)pval;
  892|  54.8k|        if (!ossl_c2i_ASN1_INTEGER(tint, &cont, len))
  ------------------
  |  Branch (892:13): [True: 2.94k, False: 51.9k]
  ------------------
  893|  2.94k|            goto err;
  894|       |        /* Fixup type to match the expected form */
  895|  51.9k|        (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
  ------------------
  |  |   97|  51.9k|# define V_ASN1_NEG                      0x100
  ------------------
  896|  51.9k|        break;
  897|       |
  898|  27.1k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|  27.1k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (898:5): [True: 27.1k, False: 948k]
  ------------------
  899|  29.4k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|  29.4k|# define V_ASN1_NUMERICSTRING            18
  ------------------
  |  Branch (899:5): [True: 2.32k, False: 973k]
  ------------------
  900|  39.7k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|  39.7k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (900:5): [True: 10.2k, False: 965k]
  ------------------
  901|  40.0k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|  40.0k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (901:5): [True: 311, False: 975k]
  ------------------
  902|  41.9k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|  41.9k|# define V_ASN1_VIDEOTEXSTRING           21
  ------------------
  |  Branch (902:5): [True: 1.96k, False: 973k]
  ------------------
  903|  48.8k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|  48.8k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (903:5): [True: 6.87k, False: 968k]
  ------------------
  904|  51.8k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|  51.8k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (904:5): [True: 3.03k, False: 972k]
  ------------------
  905|  52.4k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|  52.4k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (905:5): [True: 532, False: 975k]
  ------------------
  906|  52.4k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|  52.4k|# define V_ASN1_GRAPHICSTRING            25
  ------------------
  |  Branch (906:5): [True: 4, False: 975k]
  ------------------
  907|  52.6k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|  52.6k|# define V_ASN1_VISIBLESTRING            26 /* alias */
  ------------------
  |  Branch (907:5): [True: 284, False: 975k]
  ------------------
  908|  52.7k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|  52.7k|# define V_ASN1_GENERALSTRING            27
  ------------------
  |  Branch (908:5): [True: 35, False: 975k]
  ------------------
  909|  54.6k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|  54.6k|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  |  Branch (909:5): [True: 1.87k, False: 973k]
  ------------------
  910|  55.9k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|  55.9k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (910:5): [True: 1.35k, False: 974k]
  ------------------
  911|   119k|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|   119k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (911:5): [True: 63.7k, False: 911k]
  ------------------
  912|   131k|    case V_ASN1_OTHER:
  ------------------
  |  |   57|   131k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (912:5): [True: 11.3k, False: 964k]
  ------------------
  913|   132k|    case V_ASN1_SET:
  ------------------
  |  |   75|   132k|# define V_ASN1_SET                      17
  ------------------
  |  Branch (913:5): [True: 1.51k, False: 974k]
  ------------------
  914|   271k|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|   271k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (914:5): [True: 138k, False: 836k]
  ------------------
  915|   291k|    default:
  ------------------
  |  Branch (915:5): [True: 20.2k, False: 955k]
  ------------------
  916|   291k|        if (utype == V_ASN1_BMPSTRING && (len & 1)) {
  ------------------
  |  |   89|   583k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (916:13): [True: 1.35k, False: 290k]
  |  Branch (916:42): [True: 3, False: 1.35k]
  ------------------
  917|      3|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  918|      3|            goto err;
  919|      3|        }
  920|   291k|        if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
  ------------------
  |  |   88|   582k|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  |  Branch (920:13): [True: 1.87k, False: 289k]
  |  Branch (920:48): [True: 1, False: 1.87k]
  ------------------
  921|      1|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  922|      1|            goto err;
  923|      1|        }
  924|   291k|        if (utype == V_ASN1_GENERALIZEDTIME && (len < 15)) {
  ------------------
  |  |   83|   582k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (924:13): [True: 532, False: 290k]
  |  Branch (924:48): [True: 6, False: 526]
  ------------------
  925|      6|            ERR_raise(ERR_LIB_ASN1, ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  926|      6|            goto err;
  927|      6|        }
  928|   291k|        if (utype == V_ASN1_UTCTIME && (len < 13)) {
  ------------------
  |  |   82|   582k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (928:13): [True: 3.03k, False: 288k]
  |  Branch (928:40): [True: 5, False: 3.02k]
  ------------------
  929|      5|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UTCTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  930|      5|            goto err;
  931|      5|        }
  932|       |        /* All based on ASN1_STRING and handled the same */
  933|   291k|        if (*pval == NULL) {
  ------------------
  |  Branch (933:13): [True: 128k, False: 162k]
  ------------------
  934|   128k|            stmp = ASN1_STRING_type_new(utype);
  935|   128k|            if (stmp == NULL) {
  ------------------
  |  Branch (935:17): [True: 0, False: 128k]
  ------------------
  936|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  937|      0|                goto err;
  938|      0|            }
  939|   128k|            *pval = (ASN1_VALUE *)stmp;
  940|   162k|        } else {
  941|   162k|            stmp = (ASN1_STRING *)*pval;
  942|   162k|            stmp->type = utype;
  943|   162k|        }
  944|       |        /* If we've already allocated a buffer use it */
  945|   291k|        if (*free_cont) {
  ------------------
  |  Branch (945:13): [True: 41.7k, False: 249k]
  ------------------
  946|  41.7k|            ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, len);
  947|  41.7k|            *free_cont = 0;
  948|   249k|        } else {
  949|   249k|            if (!ASN1_STRING_set(stmp, cont, len)) {
  ------------------
  |  Branch (949:17): [True: 0, False: 249k]
  ------------------
  950|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  951|      0|                ASN1_STRING_free(stmp);
  952|      0|                *pval = NULL;
  953|      0|                goto err;
  954|      0|            }
  955|   249k|        }
  956|   291k|        break;
  957|   975k|    }
  958|       |    /* If ASN1_ANY and NULL type fix up value */
  959|   972k|    if (typ && (utype == V_ASN1_NULL))
  ------------------
  |  |   67|   166k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (959:9): [True: 166k, False: 805k]
  |  Branch (959:16): [True: 13.1k, False: 153k]
  ------------------
  960|  13.1k|        typ->value.ptr = NULL;
  961|       |
  962|   972k|    ret = 1;
  963|   975k| err:
  964|   975k|    if (!ret) {
  ------------------
  |  Branch (964:9): [True: 3.13k, False: 972k]
  ------------------
  965|  3.13k|        ASN1_TYPE_free(typ);
  966|  3.13k|        if (opval)
  ------------------
  |  Branch (966:13): [True: 24, False: 3.11k]
  ------------------
  967|     24|            *opval = NULL;
  968|  3.13k|    }
  969|   975k|    return ret;
  970|   972k|}
tasn_dec.c:asn1_check_tlen:
 1145|  14.6M|{
 1146|  14.6M|    int i;
 1147|  14.6M|    int ptag, pclass;
 1148|  14.6M|    long plen;
 1149|  14.6M|    const unsigned char *p, *q;
 1150|  14.6M|    p = *in;
 1151|  14.6M|    q = p;
 1152|       |
 1153|  14.6M|    if (len <= 0) {
  ------------------
  |  Branch (1153:9): [True: 2, False: 14.6M]
  ------------------
 1154|      2|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
 1155|      2|        goto err;
 1156|      2|    }
 1157|  14.6M|    if (ctx != NULL && ctx->valid) {
  ------------------
  |  Branch (1157:9): [True: 6.19M, False: 8.40M]
  |  Branch (1157:24): [True: 1.08M, False: 5.11M]
  ------------------
 1158|  1.08M|        i = ctx->ret;
 1159|  1.08M|        plen = ctx->plen;
 1160|  1.08M|        pclass = ctx->pclass;
 1161|  1.08M|        ptag = ctx->ptag;
 1162|  1.08M|        p += ctx->hdrlen;
 1163|  13.5M|    } else {
 1164|  13.5M|        i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
 1165|  13.5M|        if (ctx != NULL) {
  ------------------
  |  Branch (1165:13): [True: 5.11M, False: 8.40M]
  ------------------
 1166|  5.11M|            ctx->ret = i;
 1167|  5.11M|            ctx->plen = plen;
 1168|  5.11M|            ctx->pclass = pclass;
 1169|  5.11M|            ctx->ptag = ptag;
 1170|  5.11M|            ctx->hdrlen = p - q;
 1171|  5.11M|            ctx->valid = 1;
 1172|       |            /*
 1173|       |             * If definite length, and no error, length + header can't exceed
 1174|       |             * total amount of data available.
 1175|       |             */
 1176|  5.11M|            if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
  ------------------
  |  Branch (1176:17): [True: 4.57M, False: 536k]
  |  Branch (1176:36): [True: 0, False: 4.57M]
  ------------------
 1177|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1178|      0|                goto err;
 1179|      0|            }
 1180|  5.11M|        }
 1181|  13.5M|    }
 1182|       |
 1183|  14.6M|    if ((i & 0x80) != 0) {
  ------------------
  |  Branch (1183:9): [True: 4.78k, False: 14.5M]
  ------------------
 1184|  4.78k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
  ------------------
  |  |  401|  4.78k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.78k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.78k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  4.78k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  4.78k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.78k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.78k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1185|  4.78k|        goto err;
 1186|  4.78k|    }
 1187|  14.5M|    if (exptag >= 0) {
  ------------------
  |  Branch (1187:9): [True: 5.85M, False: 8.73M]
  ------------------
 1188|  5.85M|        if (exptag != ptag || expclass != pclass) {
  ------------------
  |  Branch (1188:13): [True: 764k, False: 5.09M]
  |  Branch (1188:31): [True: 252, False: 5.09M]
  ------------------
 1189|       |            /*
 1190|       |             * If type is OPTIONAL, not an error: indicate missing type.
 1191|       |             */
 1192|   764k|            if (opt != 0)
  ------------------
  |  Branch (1192:17): [True: 761k, False: 3.09k]
  ------------------
 1193|   761k|                return -1;
 1194|   764k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
  ------------------
  |  |  401|  3.09k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.09k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.09k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  3.09k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  3.09k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.09k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.09k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1195|  3.09k|            goto err;
 1196|   764k|        }
 1197|       |        /*
 1198|       |         * We have a tag and class match: assume we are going to do something
 1199|       |         * with it
 1200|       |         */
 1201|  5.09M|        asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  5.09M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 5.09M, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1202|  5.09M|    }
 1203|       |
 1204|  13.8M|    if ((i & 1) != 0)
  ------------------
  |  Branch (1204:9): [True: 635k, False: 13.1M]
  ------------------
 1205|   635k|        plen = len - (p - q);
 1206|       |
 1207|  13.8M|    if (inf != NULL)
  ------------------
  |  Branch (1207:9): [True: 13.5M, False: 321k]
  ------------------
 1208|  13.5M|        *inf = i & 1;
 1209|       |
 1210|  13.8M|    if (cst != NULL)
  ------------------
  |  Branch (1210:9): [True: 1.99M, False: 11.8M]
  ------------------
 1211|  1.99M|        *cst = i & V_ASN1_CONSTRUCTED;
  ------------------
  |  |   52|  1.99M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
 1212|       |
 1213|  13.8M|    if (olen != NULL)
  ------------------
  |  Branch (1213:9): [True: 13.5M, False: 321k]
  ------------------
 1214|  13.5M|        *olen = plen;
 1215|       |
 1216|  13.8M|    if (oclass != NULL)
  ------------------
  |  Branch (1216:9): [True: 321k, False: 13.5M]
  ------------------
 1217|   321k|        *oclass = pclass;
 1218|       |
 1219|  13.8M|    if (otag != NULL)
  ------------------
  |  Branch (1219:9): [True: 321k, False: 13.5M]
  ------------------
 1220|   321k|        *otag = ptag;
 1221|       |
 1222|  13.8M|    *in = p;
 1223|  13.8M|    return 1;
 1224|       |
 1225|  7.88k| err:
 1226|  7.88k|    asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  7.88k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 7.76k, False: 117]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1227|  7.88k|    return 0;
 1228|  14.5M|}
tasn_dec.c:asn1_check_eoc:
 1121|  14.2M|{
 1122|  14.2M|    const unsigned char *p;
 1123|       |
 1124|  14.2M|    if (len < 2)
  ------------------
  |  Branch (1124:9): [True: 2.79k, False: 14.2M]
  ------------------
 1125|  2.79k|        return 0;
 1126|  14.2M|    p = *in;
 1127|  14.2M|    if (p[0] == '\0' && p[1] == '\0') {
  ------------------
  |  Branch (1127:9): [True: 631k, False: 13.5M]
  |  Branch (1127:25): [True: 527k, False: 103k]
  ------------------
 1128|   527k|        *in += 2;
 1129|   527k|        return 1;
 1130|   527k|    }
 1131|  13.6M|    return 0;
 1132|  14.2M|}

ASN1_item_i2d:
   44|  38.0k|{
   45|  38.0k|    return asn1_item_flags_i2d(val, out, it, 0);
   46|  38.0k|}
ASN1_item_ex_i2d:
   83|  6.94M|{
   84|  6.94M|    const ASN1_TEMPLATE *tt = NULL;
   85|  6.94M|    int i, seqcontlen, seqlen, ndef = 1;
   86|  6.94M|    const ASN1_EXTERN_FUNCS *ef;
   87|  6.94M|    const ASN1_AUX *aux = it->funcs;
   88|  6.94M|    ASN1_aux_const_cb *asn1_cb = NULL;
   89|       |
   90|  6.94M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  6.94M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (90:9): [True: 3.33M, False: 3.60M]
  |  Branch (90:48): [True: 1.00M, False: 2.33M]
  ------------------
   91|  1.00M|        return 0;
   92|       |
   93|  5.94M|    if (aux != NULL) {
  ------------------
  |  Branch (93:9): [True: 335k, False: 5.60M]
  ------------------
   94|   335k|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|   335k|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (94:19): [True: 0, False: 335k]
  ------------------
   95|   335k|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
   96|   335k|    }
   97|       |
   98|  5.94M|    switch (it->itype) {
   99|       |
  100|  3.60M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  3.60M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (100:5): [True: 3.60M, False: 2.33M]
  ------------------
  101|  3.60M|        if (it->templates)
  ------------------
  |  Branch (101:13): [True: 328k, False: 3.27M]
  ------------------
  102|   328k|            return asn1_template_ex_i2d(pval, out, it->templates,
  103|   328k|                                        tag, aclass);
  104|  3.27M|        return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
  105|       |
  106|   534k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   534k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (106:5): [True: 534k, False: 5.40M]
  ------------------
  107|       |        /*
  108|       |         * It never makes sense for multi-strings to have implicit tagging, so
  109|       |         * if tag != -1, then this looks like an error in the template.
  110|       |         */
  111|   534k|        if (tag != -1) {
  ------------------
  |  Branch (111:13): [True: 0, False: 534k]
  ------------------
  112|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|            return -1;
  114|      0|        }
  115|   534k|        return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
  116|       |
  117|   240k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   240k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (117:5): [True: 240k, False: 5.70M]
  ------------------
  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|   240k|        if (tag != -1) {
  ------------------
  |  Branch (122:13): [True: 0, False: 240k]
  ------------------
  123|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|            return -1;
  125|      0|        }
  126|   240k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|      0|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (126:13): [True: 0, False: 240k]
  |  Branch (126:24): [True: 0, False: 0]
  ------------------
  127|      0|            return 0;
  128|   240k|        i = ossl_asn1_get_choice_selector_const(pval, it);
  129|   240k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (129:13): [True: 240k, False: 0]
  |  Branch (129:25): [True: 240k, False: 0]
  ------------------
  130|   240k|            const ASN1_VALUE **pchval;
  131|   240k|            const ASN1_TEMPLATE *chtt;
  132|   240k|            chtt = it->templates + i;
  133|   240k|            pchval = ossl_asn1_get_const_field_ptr(pval, chtt);
  134|   240k|            return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
  135|   240k|        }
  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|   232k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   232k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (141:5): [True: 232k, False: 5.71M]
  ------------------
  142|       |        /* If new style i2d it does all the work */
  143|   232k|        ef = it->funcs;
  144|   232k|        return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
  145|       |
  146|      0|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|      0|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (146:5): [True: 0, False: 5.94M]
  ------------------
  147|       |        /* Use indefinite length constructed if requested */
  148|      0|        if (aclass & ASN1_TFLG_NDEF)
  ------------------
  |  |  594|      0|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            ndef = 2;
  150|       |        /* fall through */
  151|       |
  152|  1.32M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.32M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (152:5): [True: 1.32M, False: 4.61M]
  ------------------
  153|  1.32M|        i = ossl_asn1_enc_restore(&seqcontlen, out, pval, it);
  154|       |        /* An error occurred */
  155|  1.32M|        if (i < 0)
  ------------------
  |  Branch (155:13): [True: 0, False: 1.32M]
  ------------------
  156|      0|            return 0;
  157|       |        /* We have a valid cached encoding... */
  158|  1.32M|        if (i > 0)
  ------------------
  |  Branch (158:13): [True: 25.4k, False: 1.30M]
  ------------------
  159|  25.4k|            return seqcontlen;
  160|       |        /* Otherwise carry on */
  161|  1.30M|        seqcontlen = 0;
  162|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  163|  1.30M|        if (tag == -1) {
  ------------------
  |  Branch (163:13): [True: 1.16M, False: 141k]
  ------------------
  164|  1.16M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  1.16M|# define V_ASN1_SEQUENCE                 16
  ------------------
  165|       |            /* Retain any other flags in aclass */
  166|  1.16M|            aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
  ------------------
  |  |  575|  1.16M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  167|  1.16M|                | V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  1.16M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  168|  1.16M|        }
  169|  1.30M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  77.2k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (169:13): [True: 77.2k, False: 1.22M]
  |  Branch (169:24): [True: 0, False: 77.2k]
  ------------------
  170|      0|            return 0;
  171|       |        /* First work out sequence content length */
  172|  6.28M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (172:41): [True: 4.98M, False: 1.30M]
  ------------------
  173|  4.98M|            const ASN1_TEMPLATE *seqtt;
  174|  4.98M|            const ASN1_VALUE **pseqval;
  175|  4.98M|            int tmplen;
  176|  4.98M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  177|  4.98M|            if (!seqtt)
  ------------------
  |  Branch (177:17): [True: 0, False: 4.98M]
  ------------------
  178|      0|                return 0;
  179|  4.98M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  180|  4.98M|            tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
  181|  4.98M|            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
  ------------------
  |  Branch (181:17): [True: 0, False: 4.98M]
  |  Branch (181:33): [True: 0, False: 4.98M]
  ------------------
  182|      0|                return -1;
  183|  4.98M|            seqcontlen += tmplen;
  184|  4.98M|        }
  185|       |
  186|  1.30M|        seqlen = ASN1_object_size(ndef, seqcontlen, tag);
  187|  1.30M|        if (!out || seqlen == -1)
  ------------------
  |  Branch (187:13): [True: 1.01M, False: 284k]
  |  Branch (187:21): [True: 0, False: 284k]
  ------------------
  188|  1.01M|            return seqlen;
  189|       |        /* Output SEQUENCE header */
  190|   284k|        ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
  191|  1.25M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (191:41): [True: 974k, False: 284k]
  ------------------
  192|   974k|            const ASN1_TEMPLATE *seqtt;
  193|   974k|            const ASN1_VALUE **pseqval;
  194|   974k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  195|   974k|            if (!seqtt)
  ------------------
  |  Branch (195:17): [True: 0, False: 974k]
  ------------------
  196|      0|                return 0;
  197|   974k|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  198|       |            /* FIXME: check for errors in enhanced version */
  199|   974k|            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
  200|   974k|        }
  201|   284k|        if (ndef == 2)
  ------------------
  |  Branch (201:13): [True: 0, False: 284k]
  ------------------
  202|      0|            ASN1_put_eoc(out);
  203|   284k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|  16.5k|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (203:13): [True: 16.5k, False: 268k]
  |  Branch (203:24): [True: 0, False: 16.5k]
  ------------------
  204|      0|            return 0;
  205|   284k|        return seqlen;
  206|       |
  207|      0|    default:
  ------------------
  |  Branch (207:5): [True: 0, False: 5.94M]
  ------------------
  208|      0|        return 0;
  209|       |
  210|  5.94M|    }
  211|      0|    return 0;
  212|  5.94M|}
tasn_enc.c:asn1_item_flags_i2d:
   57|  38.0k|{
   58|  38.0k|    if (out != NULL && *out == NULL) {
  ------------------
  |  Branch (58:9): [True: 30.7k, False: 7.31k]
  |  Branch (58:24): [True: 23.4k, False: 7.30k]
  ------------------
   59|  23.4k|        unsigned char *p, *buf;
   60|  23.4k|        int len;
   61|       |
   62|  23.4k|        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
   63|  23.4k|        if (len <= 0)
  ------------------
  |  Branch (63:13): [True: 0, False: 23.4k]
  ------------------
   64|      0|            return len;
   65|  23.4k|        if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  23.4k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  23.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  23.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 23.4k]
  ------------------
   66|      0|            return -1;
   67|  23.4k|        p = buf;
   68|  23.4k|        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
   69|  23.4k|        *out = buf;
   70|  23.4k|        return len;
   71|  23.4k|    }
   72|       |
   73|  14.6k|    return ASN1_item_ex_i2d(&val, out, it, -1, flags);
   74|  38.0k|}
tasn_enc.c:asn1_template_ex_i2d:
  216|  6.52M|{
  217|  6.52M|    const int flags = tt->flags;
  218|  6.52M|    int i, ret, ttag, tclass, ndef, len;
  219|  6.52M|    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|  6.52M|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  6.52M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (225:9): [True: 73.5k, False: 6.45M]
  ------------------
  226|  73.5k|        tval = (ASN1_VALUE *)pval;
  227|  73.5k|        pval = &tval;
  228|  73.5k|    }
  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|  6.52M|    if (flags & ASN1_TFLG_TAG_MASK) {
  ------------------
  |  |  552|  6.52M|# define ASN1_TFLG_TAG_MASK      (0x3 << 3)
  ------------------
  |  Branch (236:9): [True: 3.28M, False: 3.24M]
  ------------------
  237|       |        /* Error if argument and template tagging */
  238|  3.28M|        if (tag != -1)
  ------------------
  |  Branch (238:13): [True: 0, False: 3.28M]
  ------------------
  239|       |            /* FIXME: error code here */
  240|      0|            return -1;
  241|       |        /* Get tagging from template */
  242|  3.28M|        ttag = tt->tag;
  243|  3.28M|        tclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  3.28M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  244|  3.28M|    } else if (tag != -1) {
  ------------------
  |  Branch (244:16): [True: 0, False: 3.24M]
  ------------------
  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.24M|    } else {
  249|  3.24M|        ttag = -1;
  250|  3.24M|        tclass = 0;
  251|  3.24M|    }
  252|       |    /*
  253|       |     * Remove any class mask from iflag.
  254|       |     */
  255|  6.52M|    iclass &= ~ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  6.52M|# 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|  6.52M|    if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  6.52M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
                  if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|      0|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (263:9): [True: 0, False: 6.52M]
  |  Branch (263:37): [True: 0, False: 0]
  ------------------
  264|      0|        ndef = 2;
  265|  6.52M|    else
  266|  6.52M|        ndef = 1;
  267|       |
  268|  6.52M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  6.52M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (268:9): [True: 823k, False: 5.70M]
  ------------------
  269|       |        /* SET OF, SEQUENCE OF */
  270|   823k|        STACK_OF(const_ASN1_VALUE) *sk = (STACK_OF(const_ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|   823k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  271|   823k|        int isset, sktag, skaclass;
  272|   823k|        int skcontlen, sklen;
  273|   823k|        const ASN1_VALUE *skitem;
  274|       |
  275|   823k|        if (*pval == NULL)
  ------------------
  |  Branch (275:13): [True: 642k, False: 181k]
  ------------------
  276|   642k|            return 0;
  277|       |
  278|   181k|        if (flags & ASN1_TFLG_SET_OF) {
  ------------------
  |  |  526|   181k|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (278:13): [True: 46.2k, False: 135k]
  ------------------
  279|  46.2k|            isset = 1;
  280|       |            /* 2 means we reorder */
  281|  46.2k|            if (flags & ASN1_TFLG_SEQUENCE_OF)
  ------------------
  |  |  529|  46.2k|# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)
  ------------------
  |  Branch (281:17): [True: 0, False: 46.2k]
  ------------------
  282|      0|                isset = 2;
  283|  46.2k|        } else
  284|   135k|            isset = 0;
  285|       |
  286|       |        /*
  287|       |         * Work out inner tag value: if EXPLICIT or no tagging use underlying
  288|       |         * type.
  289|       |         */
  290|   181k|        if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) {
  ------------------
  |  |  550|  14.1k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (290:13): [True: 14.1k, False: 167k]
  |  Branch (290:29): [True: 9.64k, False: 4.51k]
  ------------------
  291|  9.64k|            sktag = ttag;
  292|  9.64k|            skaclass = tclass;
  293|   171k|        } else {
  294|   171k|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|   171k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  295|   171k|            if (isset)
  ------------------
  |  Branch (295:17): [True: 46.2k, False: 125k]
  ------------------
  296|  46.2k|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  46.2k|# define V_ASN1_SET                      17
  ------------------
  297|   125k|            else
  298|   125k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|   125k|# define V_ASN1_SEQUENCE                 16
  ------------------
  299|   171k|        }
  300|       |
  301|       |        /* Determine total length of items */
  302|   181k|        skcontlen = 0;
  303|   910k|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (303:21): [True: 728k, False: 181k]
  ------------------
  304|   728k|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  305|   728k|            len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|   728k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  306|   728k|                                   -1, iclass);
  307|   728k|            if (len == -1 || (skcontlen > INT_MAX - len))
  ------------------
  |  Branch (307:17): [True: 0, False: 728k]
  |  Branch (307:30): [True: 0, False: 728k]
  ------------------
  308|      0|                return -1;
  309|   728k|            if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|      0|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (309:17): [True: 0, False: 728k]
  |  Branch (309:29): [True: 0, False: 0]
  ------------------
  310|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  311|      0|                return -1;
  312|      0|            }
  313|   728k|            skcontlen += len;
  314|   728k|        }
  315|   181k|        sklen = ASN1_object_size(ndef, skcontlen, sktag);
  316|   181k|        if (sklen == -1)
  ------------------
  |  Branch (316:13): [True: 0, False: 181k]
  ------------------
  317|      0|            return -1;
  318|       |        /* If EXPLICIT need length of surrounding tag */
  319|   181k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|   181k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (319:13): [True: 4.51k, False: 177k]
  ------------------
  320|  4.51k|            ret = ASN1_object_size(ndef, sklen, ttag);
  321|   177k|        else
  322|   177k|            ret = sklen;
  323|       |
  324|   181k|        if (!out || ret == -1)
  ------------------
  |  Branch (324:13): [True: 129k, False: 52.4k]
  |  Branch (324:21): [True: 0, False: 52.4k]
  ------------------
  325|   129k|            return ret;
  326|       |
  327|       |        /* Now encode this lot... */
  328|       |        /* EXPLICIT tag */
  329|  52.4k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|  52.4k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (329:13): [True: 981, False: 51.5k]
  ------------------
  330|    981|            ASN1_put_object(out, ndef, sklen, ttag, tclass);
  331|       |        /* SET or SEQUENCE and IMPLICIT tag */
  332|  52.4k|        ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
  333|       |        /* And the stuff itself */
  334|  52.4k|        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  52.4k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  335|  52.4k|                         isset, iclass);
  336|  52.4k|        if (ndef == 2) {
  ------------------
  |  Branch (336:13): [True: 0, False: 52.4k]
  ------------------
  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|  52.4k|        return ret;
  343|   181k|    }
  344|       |
  345|  5.70M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  5.70M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (345:9): [True: 1.19M, False: 4.51M]
  ------------------
  346|       |        /* EXPLICIT tagging */
  347|       |        /* Find length of tagged item */
  348|  1.19M|        i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  422|  1.19M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  349|  1.19M|        if (i == 0) {
  ------------------
  |  Branch (349:13): [True: 1.03M, False: 156k]
  ------------------
  350|  1.03M|            if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  1.03M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (350:17): [True: 0, False: 1.03M]
  ------------------
  351|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|                return -1;
  353|      0|            }
  354|  1.03M|            return 0;
  355|  1.03M|        }
  356|       |        /* Find length of EXPLICIT tag */
  357|   156k|        ret = ASN1_object_size(ndef, i, ttag);
  358|   156k|        if (out && ret != -1) {
  ------------------
  |  Branch (358:13): [True: 28.4k, False: 128k]
  |  Branch (358:20): [True: 28.4k, False: 0]
  ------------------
  359|       |            /* Output tag and item */
  360|  28.4k|            ASN1_put_object(out, ndef, i, ttag, tclass);
  361|  28.4k|            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  422|  28.4k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  362|  28.4k|            if (ndef == 2)
  ------------------
  |  Branch (362:17): [True: 0, False: 28.4k]
  ------------------
  363|      0|                ASN1_put_eoc(out);
  364|  28.4k|        }
  365|   156k|        return ret;
  366|  1.19M|    }
  367|       |
  368|       |    /* Either normal or IMPLICIT tagging: combine class and flags */
  369|  4.51M|    len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|  4.51M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  370|  4.51M|                              ttag, tclass | iclass);
  371|  4.51M|    if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  1.56M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (371:9): [True: 1.56M, False: 2.94M]
  |  Branch (371:21): [True: 0, False: 1.56M]
  ------------------
  372|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  373|      0|        return -1;
  374|      0|    }
  375|  4.51M|    return len;
  376|  4.51M|}
tasn_enc.c:asn1_set_seq_out:
  403|  52.4k|{
  404|  52.4k|    int i, ret = 0;
  405|  52.4k|    const ASN1_VALUE *skitem;
  406|  52.4k|    unsigned char *tmpdat = NULL, *p = NULL;
  407|  52.4k|    DER_ENC *derlst = NULL, *tder;
  408|       |
  409|  52.4k|    if (do_sort) {
  ------------------
  |  Branch (409:9): [True: 23.1k, False: 29.3k]
  ------------------
  410|       |        /* Don't need to sort less than 2 items */
  411|  23.1k|        if (sk_const_ASN1_VALUE_num(sk) < 2)
  ------------------
  |  Branch (411:13): [True: 22.0k, False: 1.10k]
  ------------------
  412|  22.0k|            do_sort = 0;
  413|  1.10k|        else {
  414|  1.10k|            derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk)
  ------------------
  |  |  102|  1.10k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.10k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.10k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  415|  1.10k|                                    * sizeof(*derlst));
  416|  1.10k|            if (derlst == NULL)
  ------------------
  |  Branch (416:17): [True: 0, False: 1.10k]
  ------------------
  417|      0|                return 0;
  418|  1.10k|            tmpdat = OPENSSL_malloc(skcontlen);
  ------------------
  |  |  102|  1.10k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.10k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.10k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|  1.10k|            if (tmpdat == NULL)
  ------------------
  |  Branch (419:17): [True: 0, False: 1.10k]
  ------------------
  420|      0|                goto err;
  421|  1.10k|        }
  422|  23.1k|    }
  423|       |    /* If not sorting just output each item */
  424|  52.4k|    if (!do_sort) {
  ------------------
  |  Branch (424:9): [True: 51.3k, False: 1.10k]
  ------------------
  425|   163k|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (425:21): [True: 112k, False: 51.3k]
  ------------------
  426|   112k|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  427|   112k|            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
  428|   112k|        }
  429|  51.3k|        return 1;
  430|  51.3k|    }
  431|  1.10k|    p = tmpdat;
  432|       |
  433|       |    /* Doing sort: build up a list of each member's DER encoding */
  434|   112k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (434:32): [True: 111k, False: 1.10k]
  ------------------
  435|   111k|        skitem = sk_const_ASN1_VALUE_value(sk, i);
  436|   111k|        tder->data = p;
  437|   111k|        tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
  438|   111k|        tder->field = skitem;
  439|   111k|    }
  440|       |
  441|       |    /* Now sort them */
  442|  1.10k|    qsort(derlst, sk_const_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
  443|       |    /* Output sorted DER encoding */
  444|  1.10k|    p = *out;
  445|   112k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (445:32): [True: 111k, False: 1.10k]
  ------------------
  446|   111k|        memcpy(p, tder->data, tder->length);
  447|   111k|        p += tder->length;
  448|   111k|    }
  449|  1.10k|    *out = p;
  450|       |    /* If do_sort is 2 then reorder the STACK */
  451|  1.10k|    if (do_sort == 2) {
  ------------------
  |  Branch (451:9): [True: 0, False: 1.10k]
  ------------------
  452|      0|        for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++)
  ------------------
  |  Branch (452:36): [True: 0, False: 0]
  ------------------
  453|      0|            (void)sk_const_ASN1_VALUE_set(sk, i, tder->field);
  454|      0|    }
  455|  1.10k|    ret = 1;
  456|  1.10k|err:
  457|  1.10k|    OPENSSL_free(derlst);
  ------------------
  |  |  115|  1.10k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.10k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.10k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|  1.10k|    OPENSSL_free(tmpdat);
  ------------------
  |  |  115|  1.10k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.10k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.10k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  459|  1.10k|    return ret;
  460|  1.10k|}
tasn_enc.c:der_cmp:
  387|  1.11M|{
  388|  1.11M|    const DER_ENC *d1 = a, *d2 = b;
  389|  1.11M|    int cmplen, i;
  390|  1.11M|    cmplen = (d1->length < d2->length) ? d1->length : d2->length;
  ------------------
  |  Branch (390:14): [True: 62.7k, False: 1.05M]
  ------------------
  391|  1.11M|    i = memcmp(d1->data, d2->data, cmplen);
  392|  1.11M|    if (i)
  ------------------
  |  Branch (392:9): [True: 637k, False: 481k]
  ------------------
  393|   637k|        return i;
  394|   481k|    return d1->length - d2->length;
  395|  1.11M|}
tasn_enc.c:asn1_i2d_ex_primitive:
  464|  3.81M|{
  465|  3.81M|    int len;
  466|  3.81M|    int utype;
  467|  3.81M|    int usetag;
  468|  3.81M|    int ndef = 0;
  469|       |
  470|  3.81M|    utype = it->utype;
  471|       |
  472|       |    /*
  473|       |     * Get length of content octets and maybe find out the underlying type.
  474|       |     */
  475|       |
  476|  3.81M|    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|  3.81M|    if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   74|  3.81M|# define V_ASN1_SEQUENCE                 16
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   75|  3.39M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (483:9): [True: 419k, False: 3.39M]
  |  Branch (483:39): [True: 5.82k, False: 3.38M]
  ------------------
  484|  3.81M|        (utype == V_ASN1_OTHER))
  ------------------
  |  |   57|  3.38M|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (484:9): [True: 12.4k, False: 3.37M]
  ------------------
  485|   437k|        usetag = 0;
  486|  3.37M|    else
  487|  3.37M|        usetag = 1;
  488|       |
  489|       |    /* -1 means omit type */
  490|       |
  491|  3.81M|    if (len == -1)
  ------------------
  |  Branch (491:9): [True: 1.44M, False: 2.36M]
  ------------------
  492|  1.44M|        return 0;
  493|       |
  494|       |    /* -2 return is special meaning use ndef */
  495|  2.36M|    if (len == -2) {
  ------------------
  |  Branch (495:9): [True: 0, False: 2.36M]
  ------------------
  496|      0|        ndef = 2;
  497|      0|        len = 0;
  498|      0|    }
  499|       |
  500|       |    /* If not implicitly tagged get tag from underlying type */
  501|  2.36M|    if (tag == -1)
  ------------------
  |  Branch (501:9): [True: 2.24M, False: 125k]
  ------------------
  502|  2.24M|        tag = utype;
  503|       |
  504|       |    /* Output tag+length followed by content octets */
  505|  2.36M|    if (out) {
  ------------------
  |  Branch (505:9): [True: 454k, False: 1.91M]
  ------------------
  506|   454k|        if (usetag)
  ------------------
  |  Branch (506:13): [True: 355k, False: 98.6k]
  ------------------
  507|   355k|            ASN1_put_object(out, ndef, len, tag, aclass);
  508|   454k|        asn1_ex_i2c(pval, *out, &utype, it);
  509|   454k|        if (ndef)
  ------------------
  |  Branch (509:13): [True: 0, False: 454k]
  ------------------
  510|      0|            ASN1_put_eoc(out);
  511|   454k|        else
  512|   454k|            *out += len;
  513|   454k|    }
  514|       |
  515|  2.36M|    if (usetag)
  ------------------
  |  Branch (515:9): [True: 1.92M, False: 437k]
  ------------------
  516|  1.92M|        return ASN1_object_size(ndef, len, tag);
  517|   437k|    return len;
  518|  2.36M|}
tasn_enc.c:asn1_ex_i2c:
  524|  4.26M|{
  525|  4.26M|    ASN1_BOOLEAN *tbool = NULL;
  526|  4.26M|    ASN1_STRING *strtmp;
  527|  4.26M|    ASN1_OBJECT *otmp;
  528|  4.26M|    int utype;
  529|  4.26M|    const unsigned char *cont;
  530|  4.26M|    unsigned char c;
  531|  4.26M|    int len;
  532|  4.26M|    const ASN1_PRIMITIVE_FUNCS *pf;
  533|  4.26M|    pf = it->funcs;
  534|  4.26M|    if (pf && pf->prim_i2c)
  ------------------
  |  Branch (534:9): [True: 0, False: 4.26M]
  |  Branch (534:15): [True: 0, False: 0]
  ------------------
  535|      0|        return pf->prim_i2c(pval, cout, putype, it);
  536|       |
  537|       |    /* Should type be omitted? */
  538|  4.26M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|  4.26M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (538:9): [True: 667k, False: 3.59M]
  ------------------
  539|  4.26M|        || (it->utype != V_ASN1_BOOLEAN)) {
  ------------------
  |  |   63|  3.59M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (539:12): [True: 3.58M, False: 13.6k]
  ------------------
  540|  4.25M|        if (*pval == NULL)
  ------------------
  |  Branch (540:13): [True: 1.43M, False: 2.81M]
  ------------------
  541|  1.43M|            return -1;
  542|  4.25M|    }
  543|       |
  544|  2.83M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  2.83M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (544:9): [True: 667k, False: 2.16M]
  ------------------
  545|       |        /* If MSTRING type set the underlying type */
  546|   667k|        strtmp = (ASN1_STRING *)*pval;
  547|   667k|        utype = strtmp->type;
  548|   667k|        *putype = utype;
  549|  2.16M|    } else if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  2.16M|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (549:16): [True: 253k, False: 1.91M]
  ------------------
  550|       |        /* If ANY set type and pointer to value */
  551|   253k|        ASN1_TYPE *typ;
  552|   253k|        typ = (ASN1_TYPE *)*pval;
  553|   253k|        utype = typ->type;
  554|   253k|        *putype = utype;
  555|   253k|        pval = (const ASN1_VALUE **)&typ->value.asn1_value; /* actually is const */
  556|   253k|    } else
  557|  1.91M|        utype = *putype;
  558|       |
  559|  2.83M|    switch (utype) {
  560|  1.07M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.07M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (560:5): [True: 1.07M, False: 1.75M]
  ------------------
  561|  1.07M|        otmp = (ASN1_OBJECT *)*pval;
  562|  1.07M|        cont = otmp->data;
  563|  1.07M|        len = otmp->length;
  564|  1.07M|        if (cont == NULL || len == 0)
  ------------------
  |  Branch (564:13): [True: 0, False: 1.07M]
  |  Branch (564:29): [True: 0, False: 1.07M]
  ------------------
  565|      0|            return -1;
  566|  1.07M|        break;
  567|       |
  568|  1.07M|    case V_ASN1_UNDEF:
  ------------------
  |  |   60|      0|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (568:5): [True: 0, False: 2.83M]
  ------------------
  569|      0|        return -2;
  570|       |
  571|  30.3k|    case V_ASN1_NULL:
  ------------------
  |  |   67|  30.3k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (571:5): [True: 30.3k, False: 2.80M]
  ------------------
  572|  30.3k|        cont = NULL;
  573|  30.3k|        len = 0;
  574|  30.3k|        break;
  575|       |
  576|  17.6k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  17.6k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (576:5): [True: 17.6k, False: 2.81M]
  ------------------
  577|  17.6k|        tbool = (ASN1_BOOLEAN *)pval;
  578|  17.6k|        if (*tbool == -1)
  ------------------
  |  Branch (578:13): [True: 0, False: 17.6k]
  ------------------
  579|      0|            return -1;
  580|  17.6k|        if (it->utype != V_ASN1_ANY) {
  ------------------
  |  |   58|  17.6k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (580:13): [True: 13.6k, False: 3.93k]
  ------------------
  581|       |            /*
  582|       |             * Default handling if value == size field then omit
  583|       |             */
  584|  13.6k|            if (*tbool && (it->size > 0))
  ------------------
  |  Branch (584:17): [True: 1.21k, False: 12.4k]
  |  Branch (584:27): [True: 0, False: 1.21k]
  ------------------
  585|      0|                return -1;
  586|  13.6k|            if (!*tbool && !it->size)
  ------------------
  |  Branch (586:17): [True: 12.4k, False: 1.21k]
  |  Branch (586:28): [True: 12.4k, False: 0]
  ------------------
  587|  12.4k|                return -1;
  588|  13.6k|        }
  589|  5.14k|        c = (unsigned char)*tbool;
  590|  5.14k|        cont = &c;
  591|  5.14k|        len = 1;
  592|  5.14k|        break;
  593|       |
  594|   256k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|   256k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (594:5): [True: 256k, False: 2.57M]
  ------------------
  595|   256k|        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
  596|   256k|                                        cout ? &cout : NULL);
  ------------------
  |  Branch (596:41): [True: 33.2k, False: 223k]
  ------------------
  597|       |
  598|   253k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|   253k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (598:5): [True: 253k, False: 2.57M]
  ------------------
  599|   253k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|   253k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (599:5): [True: 121, False: 2.83M]
  ------------------
  600|       |        /*
  601|       |         * These are all have the same content format as ASN1_INTEGER
  602|       |         */
  603|   253k|        return ossl_i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
  ------------------
  |  Branch (603:61): [True: 38.8k, False: 214k]
  ------------------
  604|       |
  605|   105k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|   105k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (605:5): [True: 105k, False: 2.72M]
  ------------------
  606|   116k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   116k|# define V_ASN1_NUMERICSTRING            18
  ------------------
  |  Branch (606:5): [True: 10.9k, False: 2.82M]
  ------------------
  607|   116k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   116k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (607:5): [True: 45, False: 2.83M]
  ------------------
  608|   116k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   116k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (608:5): [True: 32, False: 2.83M]
  ------------------
  609|   117k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   117k|# define V_ASN1_VIDEOTEXSTRING           21
  ------------------
  |  Branch (609:5): [True: 600, False: 2.83M]
  ------------------
  610|   143k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   143k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (610:5): [True: 26.1k, False: 2.80M]
  ------------------
  611|   143k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   143k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (611:5): [True: 467, False: 2.83M]
  ------------------
  612|   147k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   147k|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (612:5): [True: 3.64k, False: 2.82M]
  ------------------
  613|   147k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   147k|# define V_ASN1_GRAPHICSTRING            25
  ------------------
  |  Branch (613:5): [True: 28, False: 2.83M]
  ------------------
  614|   147k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   147k|# define V_ASN1_VISIBLESTRING            26 /* alias */
  ------------------
  |  Branch (614:5): [True: 545, False: 2.83M]
  ------------------
  615|   147k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   147k|# define V_ASN1_GENERALSTRING            27
  ------------------
  |  Branch (615:5): [True: 175, False: 2.83M]
  ------------------
  616|   148k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   148k|# define V_ASN1_UNIVERSALSTRING          28
  ------------------
  |  Branch (616:5): [True: 927, False: 2.83M]
  ------------------
  617|   150k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   150k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (617:5): [True: 1.69k, False: 2.83M]
  ------------------
  618|   613k|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|   613k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (618:5): [True: 462k, False: 2.36M]
  ------------------
  619|  1.12M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  1.12M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (619:5): [True: 515k, False: 2.31M]
  ------------------
  620|  1.13M|    case V_ASN1_SET:
  ------------------
  |  |   75|  1.13M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (620:5): [True: 6.73k, False: 2.82M]
  ------------------
  621|  1.20M|    default:
  ------------------
  |  Branch (621:5): [True: 65.1k, False: 2.76M]
  ------------------
  622|       |        /* All based on ASN1_STRING and handled the same */
  623|  1.20M|        strtmp = (ASN1_STRING *)*pval;
  624|       |        /* Special handling for NDEF */
  625|  1.20M|        if ((it->size == ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  1.20M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (625:13): [True: 0, False: 1.20M]
  ------------------
  626|  1.20M|            && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
  ------------------
  |  |  167|      0|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (626:16): [True: 0, False: 0]
  ------------------
  627|      0|            if (cout) {
  ------------------
  |  Branch (627:17): [True: 0, False: 0]
  ------------------
  628|      0|                strtmp->data = cout;
  629|      0|                strtmp->length = 0;
  630|      0|            }
  631|       |            /* Special return code */
  632|      0|            return -2;
  633|      0|        }
  634|  1.20M|        cont = strtmp->data;
  635|  1.20M|        len = strtmp->length;
  636|       |
  637|  1.20M|        break;
  638|       |
  639|  2.83M|    }
  640|  2.31M|    if (cout && len)
  ------------------
  |  Branch (640:9): [True: 382k, False: 1.92M]
  |  Branch (640:17): [True: 350k, False: 31.2k]
  ------------------
  641|   350k|        memcpy(cout, cont, len);
  642|  2.31M|    return len;
  643|  2.83M|}

ASN1_item_free:
   19|   951k|{
   20|   951k|    ossl_asn1_item_embed_free(&val, it, 0);
   21|   951k|}
ASN1_item_ex_free:
   24|  23.8k|{
   25|  23.8k|    ossl_asn1_item_embed_free(pval, it, 0);
   26|  23.8k|}
ossl_asn1_item_embed_free:
   29|  5.46M|{
   30|  5.46M|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|  5.46M|    const ASN1_EXTERN_FUNCS *ef;
   32|  5.46M|    const ASN1_AUX *aux = it->funcs;
   33|  5.46M|    ASN1_aux_cb *asn1_cb;
   34|  5.46M|    int i;
   35|       |
   36|  5.46M|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 5.46M]
  ------------------
   37|      0|        return;
   38|  5.46M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  5.46M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (38:9): [True: 2.42M, False: 3.04M]
  |  Branch (38:48): [True: 990k, False: 1.43M]
  ------------------
   39|   990k|        return;
   40|  4.47M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 244k, False: 4.22M]
  |  Branch (40:16): [True: 54.7k, False: 190k]
  ------------------
   41|  54.7k|        asn1_cb = aux->asn1_cb;
   42|  4.41M|    else
   43|  4.41M|        asn1_cb = 0;
   44|       |
   45|  4.47M|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 0, False: 4.47M]
  ------------------
   46|       |
   47|  3.04M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  3.04M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (47:5): [True: 3.04M, False: 1.43M]
  ------------------
   48|  3.04M|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 1.08M, False: 1.95M]
  ------------------
   49|  1.08M|            ossl_asn1_template_free(pval, it->templates);
   50|  1.95M|        else
   51|  1.95M|            ossl_asn1_primitive_free(pval, it, embed);
   52|  3.04M|        break;
   53|       |
   54|   306k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   306k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (54:5): [True: 306k, False: 4.16M]
  ------------------
   55|   306k|        ossl_asn1_primitive_free(pval, it, embed);
   56|   306k|        break;
   57|       |
   58|  98.9k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  98.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (58:5): [True: 98.9k, False: 4.37M]
  ------------------
   59|  98.9k|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 262, False: 98.6k]
  ------------------
   60|    262|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|    262|# define ASN1_OP_FREE_PRE        2
  ------------------
   61|    262|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 262]
  ------------------
   62|      0|                return;
   63|    262|        }
   64|  98.9k|        i = ossl_asn1_get_choice_selector(pval, it);
   65|  98.9k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 72.4k, False: 26.5k]
  |  Branch (65:25): [True: 72.4k, False: 0]
  ------------------
   66|  72.4k|            ASN1_VALUE **pchval;
   67|       |
   68|  72.4k|            tt = it->templates + i;
   69|  72.4k|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|  72.4k|            ossl_asn1_template_free(pchval, tt);
   71|  72.4k|        }
   72|  98.9k|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 262, False: 98.6k]
  ------------------
   73|    262|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|    262|# define ASN1_OP_FREE_POST       3
  ------------------
   74|  98.9k|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 98.9k, False: 0]
  ------------------
   75|  98.9k|            OPENSSL_free(*pval);
  ------------------
  |  |  115|  98.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  98.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  98.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|  98.9k|            *pval = NULL;
   77|  98.9k|        }
   78|  98.9k|        break;
   79|       |
   80|   181k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   181k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (80:5): [True: 181k, False: 4.29M]
  ------------------
   81|   181k|        ef = it->funcs;
   82|   181k|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 181k, False: 0]
  |  Branch (82:19): [True: 181k, False: 0]
  ------------------
   83|   181k|            ef->asn1_ex_free(pval, it);
   84|   181k|        break;
   85|       |
   86|     78|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|     78|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (86:5): [True: 78, False: 4.47M]
  ------------------
   87|   842k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|   842k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (87:5): [True: 842k, False: 3.63M]
  ------------------
   88|   842k|        if (ossl_asn1_do_lock(pval, -1, it) != 0) {
  ------------------
  |  Branch (88:13): [True: 1.85k, False: 840k]
  ------------------
   89|       |            /* if error or ref-counter > 0 */
   90|  1.85k|            OPENSSL_assert(embed == 0);
  ------------------
  |  |  438|  1.85k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 1.85k, False: 0]
  |  |  ------------------
  ------------------
   91|  1.85k|            *pval = NULL;
   92|  1.85k|            return;
   93|  1.85k|        }
   94|   840k|        if (asn1_cb) {
  ------------------
  |  Branch (94:13): [True: 43.4k, False: 797k]
  ------------------
   95|  43.4k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|  43.4k|# define ASN1_OP_FREE_PRE        2
  ------------------
   96|  43.4k|            if (i == 2)
  ------------------
  |  Branch (96:17): [True: 2.50k, False: 40.9k]
  ------------------
   97|  2.50k|                return;
   98|  43.4k|        }
   99|   838k|        ossl_asn1_enc_free(pval, it);
  100|       |        /*
  101|       |         * If we free up as normal we will invalidate any ANY DEFINED BY
  102|       |         * field and we won't be able to determine the type of the field it
  103|       |         * defines. So free up in reverse order.
  104|       |         */
  105|   838k|        tt = it->templates + it->tcount;
  106|  3.55M|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (106:21): [True: 2.71M, False: 838k]
  ------------------
  107|  2.71M|            ASN1_VALUE **pseqval;
  108|       |
  109|  2.71M|            tt--;
  110|  2.71M|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  111|  2.71M|            if (!seqtt)
  ------------------
  |  Branch (111:17): [True: 5.56k, False: 2.70M]
  ------------------
  112|  5.56k|                continue;
  113|  2.70M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  114|  2.70M|            ossl_asn1_template_free(pseqval, seqtt);
  115|  2.70M|        }
  116|   838k|        if (asn1_cb)
  ------------------
  |  Branch (116:13): [True: 40.9k, False: 797k]
  ------------------
  117|  40.9k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|  40.9k|# define ASN1_OP_FREE_POST       3
  ------------------
  118|   838k|        if (embed == 0) {
  ------------------
  |  Branch (118:13): [True: 799k, False: 38.4k]
  ------------------
  119|   799k|            OPENSSL_free(*pval);
  ------------------
  |  |  115|   799k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   799k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   799k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|   799k|            *pval = NULL;
  121|   799k|        }
  122|   838k|        break;
  123|  4.47M|    }
  124|  4.47M|}
ossl_asn1_template_free:
  127|  4.81M|{
  128|  4.81M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  4.81M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  129|  4.81M|    ASN1_VALUE *tval;
  130|  4.81M|    if (embed) {
  ------------------
  |  Branch (130:9): [True: 68.5k, False: 4.74M]
  ------------------
  131|  68.5k|        tval = (ASN1_VALUE *)pval;
  132|  68.5k|        pval = &tval;
  133|  68.5k|    }
  134|  4.81M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  4.81M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (134:9): [True: 1.38M, False: 3.42M]
  ------------------
  135|  1.38M|        STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|  1.38M|# define STACK_OF(type) struct stack_st_##type
  ------------------
  136|  1.38M|        int i;
  137|       |
  138|  2.44M|        for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  |  898|  2.44M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (138:21): [True: 1.06M, False: 1.38M]
  ------------------
  139|  1.06M|            ASN1_VALUE *vtmp = sk_ASN1_VALUE_value(sk, i);
  ------------------
  |  |  899|  1.06M|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  140|       |
  141|  1.06M|            ossl_asn1_item_embed_free(&vtmp, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  422|  1.06M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  142|  1.06M|        }
  143|  1.38M|        sk_ASN1_VALUE_free(sk);
  ------------------
  |  |  904|  1.38M|#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
  ------------------
  144|  1.38M|        *pval = NULL;
  145|  3.42M|    } else {
  146|  3.42M|        ossl_asn1_item_embed_free(pval, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  422|  3.42M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  147|  3.42M|    }
  148|  4.81M|}
ossl_asn1_primitive_free:
  151|  2.42M|{
  152|  2.42M|    int utype;
  153|       |
  154|       |    /* Special case: if 'it' is a primitive with a free_func, use that. */
  155|  2.42M|    if (it) {
  ------------------
  |  Branch (155:9): [True: 2.25M, False: 166k]
  ------------------
  156|  2.25M|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  157|       |
  158|  2.25M|        if (embed) {
  ------------------
  |  Branch (158:13): [True: 30.1k, False: 2.22M]
  ------------------
  159|  30.1k|            if (pf && pf->prim_clear) {
  ------------------
  |  Branch (159:17): [True: 5.70k, False: 24.4k]
  |  Branch (159:23): [True: 5.70k, False: 0]
  ------------------
  160|  5.70k|                pf->prim_clear(pval, it);
  161|  5.70k|                return;
  162|  5.70k|            }
  163|  2.22M|        } else if (pf && pf->prim_free) {
  ------------------
  |  Branch (163:20): [True: 3.45k, False: 2.22M]
  |  Branch (163:26): [True: 3.45k, False: 0]
  ------------------
  164|  3.45k|            pf->prim_free(pval, it);
  165|  3.45k|            return;
  166|  3.45k|        }
  167|  2.25M|    }
  168|       |
  169|       |    /* Special case: if 'it' is NULL, free contents of ASN1_TYPE */
  170|  2.41M|    if (!it) {
  ------------------
  |  Branch (170:9): [True: 166k, False: 2.25M]
  ------------------
  171|   166k|        ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
  172|       |
  173|   166k|        utype = typ->type;
  174|   166k|        pval = &typ->value.asn1_value;
  175|   166k|        if (*pval == NULL)
  ------------------
  |  Branch (175:13): [True: 13.2k, False: 153k]
  ------------------
  176|  13.2k|            return;
  177|  2.25M|    } else if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  2.25M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (177:16): [True: 306k, False: 1.94M]
  ------------------
  178|   306k|        utype = -1;
  179|   306k|        if (*pval == NULL)
  ------------------
  |  Branch (179:13): [True: 0, False: 306k]
  ------------------
  180|      0|            return;
  181|  1.94M|    } else {
  182|  1.94M|        utype = it->utype;
  183|  1.94M|        if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
  ------------------
  |  |   63|  1.94M|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (183:13): [True: 1.92M, False: 14.3k]
  |  Branch (183:42): [True: 954k, False: 974k]
  ------------------
  184|   954k|            return;
  185|  1.94M|    }
  186|       |
  187|  1.44M|    switch (utype) {
  188|   586k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|   586k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (188:5): [True: 586k, False: 862k]
  ------------------
  189|   586k|        ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
  190|   586k|        break;
  191|       |
  192|  14.8k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  14.8k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (192:5): [True: 14.8k, False: 1.43M]
  ------------------
  193|  14.8k|        if (it)
  ------------------
  |  Branch (193:13): [True: 14.3k, False: 577]
  ------------------
  194|  14.3k|            *(ASN1_BOOLEAN *)pval = it->size;
  195|    577|        else
  196|    577|            *(ASN1_BOOLEAN *)pval = -1;
  197|  14.8k|        return;
  198|       |
  199|    132|    case V_ASN1_NULL:
  ------------------
  |  |   67|    132|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (199:5): [True: 132, False: 1.44M]
  ------------------
  200|    132|        break;
  201|       |
  202|   166k|    case V_ASN1_ANY:
  ------------------
  |  |   58|   166k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (202:5): [True: 166k, False: 1.28M]
  ------------------
  203|   166k|        ossl_asn1_primitive_free(pval, NULL, 0);
  204|   166k|        OPENSSL_free(*pval);
  ------------------
  |  |  115|   166k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   166k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   166k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|   166k|        break;
  206|       |
  207|   680k|    default:
  ------------------
  |  Branch (207:5): [True: 680k, False: 768k]
  ------------------
  208|   680k|        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
  209|   680k|        break;
  210|  1.44M|    }
  211|  1.43M|    *pval = NULL;
  212|  1.43M|}

ASN1_item_new:
   30|   478k|{
   31|   478k|    ASN1_VALUE *ret = NULL;
   32|   478k|    if (ASN1_item_ex_new(&ret, it) > 0)
  ------------------
  |  Branch (32:9): [True: 478k, False: 0]
  ------------------
   33|   478k|        return ret;
   34|      0|    return NULL;
   35|   478k|}
ASN1_item_new_ex:
   39|  7.77k|{
   40|  7.77k|    ASN1_VALUE *ret = NULL;
   41|  7.77k|    if (asn1_item_embed_new(&ret, it, 0, libctx, propq) > 0)
  ------------------
  |  Branch (41:9): [True: 7.77k, False: 0]
  ------------------
   42|  7.77k|        return ret;
   43|      0|    return NULL;
   44|  7.77k|}
ossl_asn1_item_ex_new_intern:
   51|   359k|{
   52|   359k|    return asn1_item_embed_new(pval, it, 0, libctx, propq);
   53|   359k|}
ASN1_item_ex_new:
   56|   478k|{
   57|   478k|    return asn1_item_embed_new(pval, it, 0, NULL, NULL);
   58|   478k|}
tasn_new.c:asn1_item_embed_new:
   62|  2.05M|{
   63|  2.05M|    const ASN1_TEMPLATE *tt = NULL;
   64|  2.05M|    const ASN1_EXTERN_FUNCS *ef;
   65|  2.05M|    const ASN1_AUX *aux = it->funcs;
   66|  2.05M|    ASN1_aux_cb *asn1_cb;
   67|  2.05M|    ASN1_VALUE **pseqval;
   68|  2.05M|    int i;
   69|  2.05M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (69:9): [True: 120k, False: 1.93M]
  |  Branch (69:16): [True: 63.5k, False: 56.6k]
  ------------------
   70|  63.5k|        asn1_cb = aux->asn1_cb;
   71|  1.98M|    else
   72|  1.98M|        asn1_cb = 0;
   73|       |
   74|  2.05M|    switch (it->itype) {
  ------------------
  |  Branch (74:13): [True: 0, False: 2.05M]
  ------------------
   75|       |
   76|  48.1k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  48.1k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (76:5): [True: 48.1k, False: 2.00M]
  ------------------
   77|  48.1k|        ef = it->funcs;
   78|  48.1k|        if (ef != NULL) {
  ------------------
  |  Branch (78:13): [True: 48.1k, False: 0]
  ------------------
   79|  48.1k|            if (ef->asn1_ex_new_ex != NULL) {
  ------------------
  |  Branch (79:17): [True: 10.5k, False: 37.6k]
  ------------------
   80|  10.5k|                if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (80:21): [True: 0, False: 10.5k]
  ------------------
   81|      0|                    goto asn1err;
   82|  37.6k|            } else if (ef->asn1_ex_new != NULL) {
  ------------------
  |  Branch (82:24): [True: 37.6k, False: 0]
  ------------------
   83|  37.6k|                if (!ef->asn1_ex_new(pval, it))
  ------------------
  |  Branch (83:21): [True: 0, False: 37.6k]
  ------------------
   84|      0|                    goto asn1err;
   85|  37.6k|            }
   86|  48.1k|        }
   87|  48.1k|        break;
   88|       |
   89|   807k|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|   807k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (89:5): [True: 807k, False: 1.24M]
  ------------------
   90|   807k|        if (it->templates) {
  ------------------
  |  Branch (90:13): [True: 23.2k, False: 784k]
  ------------------
   91|  23.2k|            if (!asn1_template_new(pval, it->templates, libctx, propq))
  ------------------
  |  Branch (91:17): [True: 0, False: 23.2k]
  ------------------
   92|      0|                goto asn1err;
   93|   784k|        } else if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (93:20): [True: 0, False: 784k]
  ------------------
   94|      0|            goto asn1err;
   95|   807k|        break;
   96|       |
   97|   807k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   303k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (97:5): [True: 303k, False: 1.74M]
  ------------------
   98|   303k|        if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (98:13): [True: 0, False: 303k]
  ------------------
   99|      0|            goto asn1err;
  100|   303k|        break;
  101|       |
  102|   303k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  98.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (102:5): [True: 98.9k, False: 1.95M]
  ------------------
  103|  98.9k|        if (asn1_cb) {
  ------------------
  |  Branch (103:13): [True: 262, False: 98.6k]
  ------------------
  104|    262|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|    262|# define ASN1_OP_NEW_PRE         0
  ------------------
  105|    262|            if (!i)
  ------------------
  |  Branch (105:17): [True: 0, False: 262]
  ------------------
  106|      0|                goto auxerr;
  107|    262|            if (i == 2) {
  ------------------
  |  Branch (107:17): [True: 0, False: 262]
  ------------------
  108|      0|                return 1;
  109|      0|            }
  110|    262|        }
  111|  98.9k|        if (embed) {
  ------------------
  |  Branch (111:13): [True: 0, False: 98.9k]
  ------------------
  112|      0|            memset(*pval, 0, it->size);
  113|  98.9k|        } else {
  114|  98.9k|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|  98.9k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  98.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  98.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|  98.9k|            if (*pval == NULL)
  ------------------
  |  Branch (115:17): [True: 0, False: 98.9k]
  ------------------
  116|      0|                return 0;
  117|  98.9k|        }
  118|  98.9k|        ossl_asn1_set_choice_selector(pval, -1, it);
  119|  98.9k|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|    262|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (119:13): [True: 262, False: 98.6k]
  |  Branch (119:24): [True: 0, False: 262]
  ------------------
  120|      0|            goto auxerr2;
  121|  98.9k|        break;
  122|       |
  123|  98.9k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|     78|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (123:5): [True: 78, False: 2.05M]
  ------------------
  124|   791k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|   791k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (124:5): [True: 791k, False: 1.25M]
  ------------------
  125|   791k|        if (asn1_cb) {
  ------------------
  |  Branch (125:13): [True: 52.2k, False: 739k]
  ------------------
  126|  52.2k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|  52.2k|# define ASN1_OP_NEW_PRE         0
  ------------------
  127|  52.2k|            if (!i)
  ------------------
  |  Branch (127:17): [True: 0, False: 52.2k]
  ------------------
  128|      0|                goto auxerr;
  129|  52.2k|            if (i == 2) {
  ------------------
  |  Branch (129:17): [True: 11.2k, False: 40.9k]
  ------------------
  130|  11.2k|                return 1;
  131|  11.2k|            }
  132|  52.2k|        }
  133|   780k|        if (embed) {
  ------------------
  |  Branch (133:13): [True: 38.0k, False: 742k]
  ------------------
  134|  38.0k|            memset(*pval, 0, it->size);
  135|   742k|        } else {
  136|   742k|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|   742k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   742k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   742k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|   742k|            if (*pval == NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 742k]
  ------------------
  138|      0|                return 0;
  139|   742k|        }
  140|       |        /* 0 : init. lock */
  141|   780k|        if (ossl_asn1_do_lock(pval, 0, it) < 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 780k]
  ------------------
  142|      0|            if (!embed) {
  ------------------
  |  Branch (142:17): [True: 0, False: 0]
  ------------------
  143|      0|                OPENSSL_free(*pval);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|                *pval = NULL;
  145|      0|            }
  146|      0|            goto asn1err;
  147|      0|        }
  148|   780k|        ossl_asn1_enc_init(pval, it);
  149|  3.38M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (149:41): [True: 2.60M, False: 780k]
  ------------------
  150|  2.60M|            pseqval = ossl_asn1_get_field_ptr(pval, tt);
  151|  2.60M|            if (!asn1_template_new(pseqval, tt, libctx, propq))
  ------------------
  |  Branch (151:17): [True: 0, False: 2.60M]
  ------------------
  152|      0|                goto asn1err2;
  153|  2.60M|        }
  154|   780k|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|  40.9k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (154:13): [True: 40.9k, False: 739k]
  |  Branch (154:24): [True: 0, False: 40.9k]
  ------------------
  155|      0|            goto auxerr2;
  156|   780k|        break;
  157|  2.05M|    }
  158|  2.03M|    return 1;
  159|       |
  160|      0| asn1err2:
  161|      0|    ossl_asn1_item_embed_free(pval, it, embed);
  162|      0| asn1err:
  163|      0|    ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  164|      0|    return 0;
  165|       |
  166|      0| auxerr2:
  167|      0|    ossl_asn1_item_embed_free(pval, it, embed);
  168|      0| auxerr:
  169|      0|    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|    return 0;
  171|       |
  172|      0|}
tasn_new.c:asn1_template_new:
  209|  2.62M|{
  210|  2.62M|    const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
  ------------------
  |  |  422|  2.62M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  211|  2.62M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  2.62M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  212|  2.62M|    ASN1_VALUE *tval;
  213|  2.62M|    int ret;
  214|  2.62M|    if (embed) {
  ------------------
  |  Branch (214:9): [True: 68.2k, False: 2.55M]
  ------------------
  215|  68.2k|        tval = (ASN1_VALUE *)pval;
  216|  68.2k|        pval = &tval;
  217|  68.2k|    }
  218|  2.62M|    if (tt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|  2.62M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (218:9): [True: 1.40M, False: 1.21M]
  ------------------
  219|  1.40M|        asn1_template_clear(pval, tt);
  220|  1.40M|        return 1;
  221|  1.40M|    }
  222|       |    /* If ANY DEFINED BY nothing to do */
  223|       |
  224|  1.21M|    if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  1.21M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (224:9): [True: 9.78k, False: 1.20M]
  ------------------
  225|  9.78k|        *pval = NULL;
  226|  9.78k|        return 1;
  227|  9.78k|    }
  228|       |    /* If SET OF or SEQUENCE OF, its a STACK */
  229|  1.20M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  1.20M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (229:9): [True: 1.91k, False: 1.20M]
  ------------------
  230|  1.91k|        STACK_OF(ASN1_VALUE) *skval;
  ------------------
  |  |   31|  1.91k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  231|  1.91k|        skval = sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  1.91k|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  232|  1.91k|        if (!skval) {
  ------------------
  |  Branch (232:13): [True: 0, False: 1.91k]
  ------------------
  233|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  234|      0|            ret = 0;
  235|      0|            goto done;
  236|      0|        }
  237|  1.91k|        *pval = (ASN1_VALUE *)skval;
  238|  1.91k|        ret = 1;
  239|  1.91k|        goto done;
  240|  1.91k|    }
  241|       |    /* Otherwise pass it back to the item routine */
  242|  1.20M|    ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
  243|  1.20M| done:
  244|  1.20M|    return ret;
  245|  1.20M|}
tasn_new.c:asn1_template_clear:
  248|  1.47M|{
  249|       |    /* If ADB or STACK just NULL the field */
  250|  1.47M|    if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  583|  1.47M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
                  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  539|  1.47M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (250:9): [True: 264k, False: 1.21M]
  ------------------
  251|   264k|        *pval = NULL;
  252|  1.21M|    else
  253|  1.21M|        asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  422|  1.21M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  254|  1.47M|}
tasn_new.c:asn1_item_clear:
  175|  1.21M|{
  176|  1.21M|    const ASN1_EXTERN_FUNCS *ef;
  177|       |
  178|  1.21M|    switch (it->itype) {
  ------------------
  |  Branch (178:13): [True: 0, False: 1.21M]
  ------------------
  179|       |
  180|   216k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   216k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (180:5): [True: 216k, False: 999k]
  ------------------
  181|   216k|        ef = it->funcs;
  182|   216k|        if (ef && ef->asn1_ex_clear)
  ------------------
  |  Branch (182:13): [True: 216k, False: 0]
  |  Branch (182:19): [True: 0, False: 216k]
  ------------------
  183|      0|            ef->asn1_ex_clear(pval, it);
  184|   216k|        else
  185|   216k|            *pval = NULL;
  186|   216k|        break;
  187|       |
  188|   817k|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|   817k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (188:5): [True: 817k, False: 397k]
  ------------------
  189|   817k|        if (it->templates)
  ------------------
  |  Branch (189:13): [True: 70.5k, False: 747k]
  ------------------
  190|  70.5k|            asn1_template_clear(pval, it->templates);
  191|   747k|        else
  192|   747k|            asn1_primitive_clear(pval, it);
  193|   817k|        break;
  194|       |
  195|    868|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|    868|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (195:5): [True: 868, False: 1.21M]
  ------------------
  196|    868|        asn1_primitive_clear(pval, it);
  197|    868|        break;
  198|       |
  199|  1.99k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  1.99k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (199:5): [True: 1.99k, False: 1.21M]
  ------------------
  200|   180k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|   180k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (200:5): [True: 178k, False: 1.03M]
  ------------------
  201|   180k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   180k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (201:5): [True: 0, False: 1.21M]
  ------------------
  202|   180k|        *pval = NULL;
  203|   180k|        break;
  204|  1.21M|    }
  205|  1.21M|}
tasn_new.c:asn1_primitive_clear:
  328|   748k|{
  329|   748k|    int utype;
  330|   748k|    if (it && it->funcs) {
  ------------------
  |  Branch (330:9): [True: 748k, False: 0]
  |  Branch (330:15): [True: 1.62k, False: 746k]
  ------------------
  331|  1.62k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  332|  1.62k|        if (pf->prim_clear)
  ------------------
  |  Branch (332:13): [True: 0, False: 1.62k]
  ------------------
  333|      0|            pf->prim_clear(pval, it);
  334|  1.62k|        else
  335|  1.62k|            *pval = NULL;
  336|  1.62k|        return;
  337|  1.62k|    }
  338|   746k|    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
  ------------------
  |  |   85|   746k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (338:9): [True: 0, False: 746k]
  |  Branch (338:16): [True: 868, False: 745k]
  ------------------
  339|    868|        utype = -1;
  340|   745k|    else
  341|   745k|        utype = it->utype;
  342|   746k|    if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|   746k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (342:9): [True: 8.74k, False: 737k]
  ------------------
  343|  8.74k|        *(ASN1_BOOLEAN *)pval = it->size;
  344|   737k|    else
  345|   737k|        *pval = NULL;
  346|   746k|}
tasn_new.c:asn1_primitive_new:
  263|  1.08M|{
  264|  1.08M|    ASN1_TYPE *typ;
  265|  1.08M|    ASN1_STRING *str;
  266|  1.08M|    int utype;
  267|       |
  268|  1.08M|    if (!it)
  ------------------
  |  Branch (268:9): [True: 0, False: 1.08M]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  1.08M|    if (it->funcs) {
  ------------------
  |  Branch (271:9): [True: 11.0k, False: 1.07M]
  ------------------
  272|  11.0k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  273|  11.0k|        if (embed) {
  ------------------
  |  Branch (273:13): [True: 5.70k, False: 5.34k]
  ------------------
  274|  5.70k|            if (pf->prim_clear) {
  ------------------
  |  Branch (274:17): [True: 5.70k, False: 0]
  ------------------
  275|  5.70k|                pf->prim_clear(pval, it);
  276|  5.70k|                return 1;
  277|  5.70k|            }
  278|  5.70k|        } else if (pf->prim_new) {
  ------------------
  |  Branch (278:20): [True: 5.34k, False: 0]
  ------------------
  279|  5.34k|            return pf->prim_new(pval, it);
  280|  5.34k|        }
  281|  11.0k|    }
  282|       |
  283|  1.07M|    if (it->itype == ASN1_ITYPE_MSTRING)
  ------------------
  |  |   85|  1.07M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (283:9): [True: 303k, False: 773k]
  ------------------
  284|   303k|        utype = -1;
  285|   773k|    else
  286|   773k|        utype = it->utype;
  287|  1.07M|    switch (utype) {
  288|   502k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|   502k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (288:5): [True: 502k, False: 574k]
  ------------------
  289|   502k|        *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
  ------------------
  |  |   18|   502k|#define NID_undef                       0
  ------------------
  290|   502k|        return 1;
  291|       |
  292|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|      0|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (292:5): [True: 0, False: 1.07M]
  ------------------
  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: 1.07M]
  ------------------
  297|      0|        *pval = (ASN1_VALUE *)1;
  298|      0|        return 1;
  299|       |
  300|   166k|    case V_ASN1_ANY:
  ------------------
  |  |   58|   166k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (300:5): [True: 166k, False: 910k]
  ------------------
  301|   166k|        if ((typ = OPENSSL_malloc(sizeof(*typ))) == NULL)
  ------------------
  |  |  102|   166k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   166k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   166k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (301:13): [True: 0, False: 166k]
  ------------------
  302|      0|            return 0;
  303|   166k|        typ->value.ptr = NULL;
  304|   166k|        typ->type = -1;
  305|   166k|        *pval = (ASN1_VALUE *)typ;
  306|   166k|        break;
  307|       |
  308|   407k|    default:
  ------------------
  |  Branch (308:5): [True: 407k, False: 669k]
  ------------------
  309|   407k|        if (embed) {
  ------------------
  |  Branch (309:13): [True: 24.4k, False: 383k]
  ------------------
  310|  24.4k|            str = *(ASN1_STRING **)pval;
  311|  24.4k|            memset(str, 0, sizeof(*str));
  312|  24.4k|            str->type = utype;
  313|  24.4k|            str->flags = ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|  24.4k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  314|   383k|        } else {
  315|   383k|            str = ASN1_STRING_type_new(utype);
  316|   383k|            *pval = (ASN1_VALUE *)str;
  317|   383k|        }
  318|   407k|        if (it->itype == ASN1_ITYPE_MSTRING && str)
  ------------------
  |  |   85|   815k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (318:13): [True: 303k, False: 103k]
  |  Branch (318:48): [True: 303k, False: 0]
  ------------------
  319|   303k|            str->flags |= ASN1_STRING_FLAG_MSTRING;
  ------------------
  |  |  180|   303k|# define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  320|   407k|        break;
  321|  1.07M|    }
  322|   574k|    if (*pval)
  ------------------
  |  Branch (322:9): [True: 574k, False: 0]
  ------------------
  323|   574k|        return 1;
  324|      0|    return 0;
  325|   574k|}

ASN1_item_print:
  121|  17.4k|{
  122|  17.4k|    const char *sname;
  123|  17.4k|    if (pctx == NULL)
  ------------------
  |  Branch (123:9): [True: 6.94k, False: 10.5k]
  ------------------
  124|  6.94k|        pctx = &default_pctx;
  125|  17.4k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_STRUCT_NAME)
  ------------------
  |  | 1067|  17.4k|# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME          0x100
  ------------------
  |  Branch (125:9): [True: 0, False: 17.4k]
  ------------------
  126|      0|        sname = NULL;
  127|  17.4k|    else
  128|  17.4k|        sname = it->sname;
  129|  17.4k|    return asn1_item_print_ctx(out, &ifld, indent, it, NULL, sname, 0, pctx);
  130|  17.4k|}
tasn_prn.c:asn1_item_print_ctx:
  136|   517k|{
  137|   517k|    const ASN1_TEMPLATE *tt;
  138|   517k|    const ASN1_EXTERN_FUNCS *ef;
  139|   517k|    const ASN1_VALUE **tmpfld;
  140|   517k|    const ASN1_AUX *aux = it->funcs;
  141|   517k|    ASN1_aux_const_cb *asn1_cb = NULL;
  142|   517k|    ASN1_PRINT_ARG parg;
  143|   517k|    int i;
  144|   517k|    if (aux != NULL) {
  ------------------
  |  Branch (144:9): [True: 76.4k, False: 441k]
  ------------------
  145|  76.4k|        parg.out = out;
  146|  76.4k|        parg.indent = indent;
  147|  76.4k|        parg.pctx = pctx;
  148|  76.4k|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|  76.4k|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (148:19): [True: 0, False: 76.4k]
  ------------------
  149|  76.4k|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
  150|  76.4k|    }
  151|       |
  152|   517k|   if (((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|   517k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (152:9): [True: 237k, False: 280k]
  ------------------
  153|   517k|       || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) {
  ------------------
  |  |   63|   280k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (153:11): [True: 278k, False: 1.64k]
  |  Branch (153:45): [True: 247k, False: 268k]
  ------------------
  154|   247k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_ABSENT) {
  ------------------
  |  | 1051|   247k|# define ASN1_PCTX_FLAGS_SHOW_ABSENT             0x001
  ------------------
  |  Branch (154:13): [True: 247k, False: 0]
  ------------------
  155|   247k|            if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (155:17): [True: 247k, False: 0]
  |  Branch (155:27): [True: 0, False: 247k]
  ------------------
  156|      0|                return 0;
  157|   247k|            if (BIO_puts(out, "<ABSENT>\n") <= 0)
  ------------------
  |  Branch (157:17): [True: 0, False: 247k]
  ------------------
  158|      0|                return 0;
  159|   247k|        }
  160|   247k|        return 1;
  161|   247k|    }
  162|       |
  163|   269k|    switch (it->itype) {
  164|   128k|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|   128k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (164:5): [True: 128k, False: 141k]
  ------------------
  165|   128k|        if (it->templates) {
  ------------------
  |  Branch (165:13): [True: 9.87k, False: 118k]
  ------------------
  166|  9.87k|            if (!asn1_template_print_ctx(out, fld, indent,
  ------------------
  |  Branch (166:17): [True: 670, False: 9.20k]
  ------------------
  167|  9.87k|                                         it->templates, pctx))
  168|    670|                return 0;
  169|  9.20k|            break;
  170|  9.87k|        }
  171|       |        /* fall through */
  172|   118k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   118k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (172:5): [True: 733, False: 269k]
  ------------------
  173|   118k|        if (!asn1_primitive_print(out, fld, it, indent, fname, sname, pctx))
  ------------------
  |  Branch (173:13): [True: 3.33k, False: 115k]
  ------------------
  174|  3.33k|            return 0;
  175|   115k|        break;
  176|       |
  177|   115k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  18.1k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (177:5): [True: 18.1k, False: 251k]
  ------------------
  178|  18.1k|        if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (178:13): [True: 18.1k, False: 0]
  |  Branch (178:23): [True: 0, False: 18.1k]
  ------------------
  179|      0|            return 0;
  180|       |        /* Use new style print routine if possible */
  181|  18.1k|        ef = it->funcs;
  182|  18.1k|        if (ef && ef->asn1_ex_print) {
  ------------------
  |  Branch (182:13): [True: 18.1k, False: 0]
  |  Branch (182:19): [True: 18.1k, False: 0]
  ------------------
  183|  18.1k|            i = ef->asn1_ex_print(out, fld, indent, "", pctx);
  184|  18.1k|            if (!i)
  ------------------
  |  Branch (184:17): [True: 160, False: 18.0k]
  ------------------
  185|    160|                return 0;
  186|  18.0k|            if ((i == 2) && (BIO_puts(out, "\n") <= 0))
  ------------------
  |  Branch (186:17): [True: 7.64k, False: 10.3k]
  |  Branch (186:29): [True: 0, False: 7.64k]
  ------------------
  187|      0|                return 0;
  188|  18.0k|            return 1;
  189|  18.0k|        } 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|  29.3k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  29.3k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (194:5): [True: 29.3k, False: 240k]
  ------------------
  195|       |        /* CHOICE type, get selector */
  196|  29.3k|        i = ossl_asn1_get_choice_selector_const(fld, it);
  197|       |        /* This should never happen... */
  198|  29.3k|        if ((i < 0) || (i >= it->tcount)) {
  ------------------
  |  Branch (198:13): [True: 0, False: 29.3k]
  |  Branch (198:24): [True: 0, False: 29.3k]
  ------------------
  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|  29.3k|        tt = it->templates + i;
  204|  29.3k|        tmpfld = ossl_asn1_get_const_field_ptr(fld, tt);
  205|  29.3k|        if (!asn1_template_print_ctx(out, tmpfld, indent, tt, pctx))
  ------------------
  |  Branch (205:13): [True: 3.11k, False: 26.2k]
  ------------------
  206|  3.11k|            return 0;
  207|  26.2k|        break;
  208|       |
  209|  93.4k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  93.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (209:5): [True: 93.4k, False: 176k]
  ------------------
  210|  93.4k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  93.4k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (210:5): [True: 0, False: 269k]
  ------------------
  211|  93.4k|        if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (211:13): [True: 62.8k, False: 30.6k]
  |  Branch (211:23): [True: 0, False: 62.8k]
  ------------------
  212|      0|            return 0;
  213|  93.4k|        if (fname || sname) {
  ------------------
  |  Branch (213:13): [True: 45.3k, False: 48.0k]
  |  Branch (213:22): [True: 17.4k, False: 30.6k]
  ------------------
  214|  62.8k|            if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) {
  ------------------
  |  | 1053|  62.8k|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
  |  Branch (214:17): [True: 0, False: 62.8k]
  ------------------
  215|      0|                if (BIO_puts(out, " {\n") <= 0)
  ------------------
  |  Branch (215:21): [True: 0, False: 0]
  ------------------
  216|      0|                    return 0;
  217|  62.8k|            } else {
  218|  62.8k|                if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (218:21): [True: 0, False: 62.8k]
  ------------------
  219|      0|                    return 0;
  220|  62.8k|            }
  221|  62.8k|        }
  222|       |
  223|  93.4k|        if (asn1_cb) {
  ------------------
  |  Branch (223:13): [True: 11.0k, False: 82.4k]
  ------------------
  224|  11.0k|            i = asn1_cb(ASN1_OP_PRINT_PRE, fld, it, &parg);
  ------------------
  |  |  750|  11.0k|# define ASN1_OP_PRINT_PRE       8
  ------------------
  225|  11.0k|            if (i == 0)
  ------------------
  |  Branch (225:17): [True: 0, False: 11.0k]
  ------------------
  226|      0|                return 0;
  227|  11.0k|            if (i == 2)
  ------------------
  |  Branch (227:17): [True: 0, False: 11.0k]
  ------------------
  228|      0|                return 1;
  229|  11.0k|        }
  230|       |
  231|       |        /* Print each field entry */
  232|   533k|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (232:41): [True: 447k, False: 85.5k]
  ------------------
  233|   447k|            const ASN1_TEMPLATE *seqtt;
  234|   447k|            seqtt = ossl_asn1_do_adb(*fld, tt, 1);
  235|   447k|            if (!seqtt)
  ------------------
  |  Branch (235:17): [True: 0, False: 447k]
  ------------------
  236|      0|                return 0;
  237|   447k|            tmpfld = ossl_asn1_get_const_field_ptr(fld, seqtt);
  238|   447k|            if (!asn1_template_print_ctx(out, tmpfld,
  ------------------
  |  Branch (238:17): [True: 7.95k, False: 439k]
  ------------------
  239|   447k|                                         indent + 2, seqtt, pctx))
  240|  7.95k|                return 0;
  241|   447k|        }
  242|  85.5k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) {
  ------------------
  |  | 1053|  85.5k|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
  |  Branch (242:13): [True: 0, False: 85.5k]
  ------------------
  243|      0|            if (BIO_printf(out, "%*s}\n", indent, "") < 0)
  ------------------
  |  Branch (243:17): [True: 0, False: 0]
  ------------------
  244|      0|                return 0;
  245|      0|        }
  246|       |
  247|  85.5k|        if (asn1_cb) {
  ------------------
  |  Branch (247:13): [True: 7.00k, False: 78.5k]
  ------------------
  248|  7.00k|            i = asn1_cb(ASN1_OP_PRINT_POST, fld, it, &parg);
  ------------------
  |  |  751|  7.00k|# define ASN1_OP_PRINT_POST      9
  ------------------
  249|  7.00k|            if (i == 0)
  ------------------
  |  Branch (249:17): [True: 0, False: 7.00k]
  ------------------
  250|      0|                return 0;
  251|  7.00k|        }
  252|  85.5k|        break;
  253|       |
  254|  85.5k|    default:
  ------------------
  |  Branch (254:5): [True: 0, False: 269k]
  ------------------
  255|      0|        BIO_printf(out, "Unprocessed type %d\n", it->itype);
  256|      0|        return 0;
  257|   269k|    }
  258|       |
  259|   236k|    return 1;
  260|   269k|}
tasn_prn.c:asn1_print_fsname:
  332|   447k|{
  333|   447k|    static const char spaces[] = "                    ";
  334|   447k|    static const int nspaces = sizeof(spaces) - 1;
  335|       |
  336|   455k|    while (indent > nspaces) {
  ------------------
  |  Branch (336:12): [True: 8.02k, False: 447k]
  ------------------
  337|  8.02k|        if (BIO_write(out, spaces, nspaces) != nspaces)
  ------------------
  |  Branch (337:13): [True: 0, False: 8.02k]
  ------------------
  338|      0|            return 0;
  339|  8.02k|        indent -= nspaces;
  340|  8.02k|    }
  341|   447k|    if (BIO_write(out, spaces, indent) != indent)
  ------------------
  |  Branch (341:9): [True: 0, False: 447k]
  ------------------
  342|      0|        return 0;
  343|   447k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_STRUCT_NAME)
  ------------------
  |  | 1067|   447k|# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME          0x100
  ------------------
  |  Branch (343:9): [True: 0, False: 447k]
  ------------------
  344|      0|        sname = NULL;
  345|   447k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME)
  ------------------
  |  | 1063|   447k|# define ASN1_PCTX_FLAGS_NO_FIELD_NAME           0x040
  ------------------
  |  Branch (345:9): [True: 0, False: 447k]
  ------------------
  346|      0|        fname = NULL;
  347|   447k|    if (!sname && !fname)
  ------------------
  |  Branch (347:9): [True: 430k, False: 17.4k]
  |  Branch (347:19): [True: 38.8k, False: 391k]
  ------------------
  348|  38.8k|        return 1;
  349|   408k|    if (fname) {
  ------------------
  |  Branch (349:9): [True: 391k, False: 17.4k]
  ------------------
  350|   391k|        if (BIO_puts(out, fname) <= 0)
  ------------------
  |  Branch (350:13): [True: 0, False: 391k]
  ------------------
  351|      0|            return 0;
  352|   391k|    }
  353|   408k|    if (sname) {
  ------------------
  |  Branch (353:9): [True: 17.4k, False: 391k]
  ------------------
  354|  17.4k|        if (fname) {
  ------------------
  |  Branch (354:13): [True: 0, False: 17.4k]
  ------------------
  355|      0|            if (BIO_printf(out, " (%s)", sname) <= 0)
  ------------------
  |  Branch (355:17): [True: 0, False: 0]
  ------------------
  356|      0|                return 0;
  357|  17.4k|        } else {
  358|  17.4k|            if (BIO_puts(out, sname) <= 0)
  ------------------
  |  Branch (358:17): [True: 0, False: 17.4k]
  ------------------
  359|      0|                return 0;
  360|  17.4k|        }
  361|  17.4k|    }
  362|   408k|    if (BIO_write(out, ": ", 2) != 2)
  ------------------
  |  Branch (362:9): [True: 0, False: 408k]
  ------------------
  363|      0|        return 0;
  364|   408k|    return 1;
  365|   408k|}
tasn_prn.c:asn1_template_print_ctx:
  264|   487k|{
  265|   487k|    int i, flags;
  266|   487k|    const char *sname, *fname;
  267|   487k|    const ASN1_VALUE *tfld;
  268|   487k|    flags = tt->flags;
  269|   487k|    if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME)
  ------------------
  |  | 1065|   487k|# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME  0x080
  ------------------
  |  Branch (269:9): [True: 0, False: 487k]
  ------------------
  270|      0|        sname = ASN1_ITEM_ptr(tt->item)->sname;
  ------------------
  |  |  422|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  271|   487k|    else
  272|   487k|        sname = NULL;
  273|   487k|    if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME)
  ------------------
  |  | 1063|   487k|# define ASN1_PCTX_FLAGS_NO_FIELD_NAME           0x040
  ------------------
  |  Branch (273:9): [True: 0, False: 487k]
  ------------------
  274|      0|        fname = NULL;
  275|   487k|    else
  276|   487k|        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|   487k|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|   487k|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (282:9): [True: 3.87k, False: 483k]
  ------------------
  283|  3.87k|        tfld = (const ASN1_VALUE *)fld;
  284|  3.87k|        fld = &tfld;
  285|  3.87k|    }
  286|       |
  287|   487k|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|   487k|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (287:9): [True: 56.6k, False: 430k]
  ------------------
  288|  56.6k|        char *tname;
  289|  56.6k|        const ASN1_VALUE *skitem;
  290|  56.6k|        STACK_OF(const_ASN1_VALUE) *stack;
  ------------------
  |  |   31|  56.6k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  291|       |
  292|       |        /* SET OF, SEQUENCE OF */
  293|  56.6k|        if (fname) {
  ------------------
  |  Branch (293:13): [True: 56.6k, False: 0]
  ------------------
  294|  56.6k|            if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SSOF) {
  ------------------
  |  | 1055|  56.6k|# define ASN1_PCTX_FLAGS_SHOW_SSOF               0x004
  ------------------
  |  Branch (294:17): [True: 0, False: 56.6k]
  ------------------
  295|      0|                if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|      0|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (295:21): [True: 0, False: 0]
  ------------------
  296|      0|                    tname = "SET";
  297|      0|                else
  298|      0|                    tname = "SEQUENCE";
  299|      0|                if (BIO_printf(out, "%*s%s OF %s {\n",
  ------------------
  |  Branch (299:21): [True: 0, False: 0]
  ------------------
  300|      0|                               indent, "", tname, tt->field_name) <= 0)
  301|      0|                    return 0;
  302|  56.6k|            } else if (BIO_printf(out, "%*s%s:\n", indent, "", fname) <= 0)
  ------------------
  |  Branch (302:24): [True: 0, False: 56.6k]
  ------------------
  303|      0|                return 0;
  304|  56.6k|        }
  305|  56.6k|        stack = (STACK_OF(const_ASN1_VALUE) *)*fld;
  306|   125k|        for (i = 0; i < sk_const_ASN1_VALUE_num(stack); i++) {
  ------------------
  |  Branch (306:21): [True: 69.4k, False: 55.6k]
  ------------------
  307|  69.4k|            if ((i > 0) && (BIO_puts(out, "\n") <= 0))
  ------------------
  |  Branch (307:17): [True: 65.0k, False: 4.39k]
  |  Branch (307:28): [True: 0, False: 65.0k]
  ------------------
  308|      0|                return 0;
  309|       |
  310|  69.4k|            skitem = sk_const_ASN1_VALUE_value(stack, i);
  311|  69.4k|            if (!asn1_item_print_ctx(out, &skitem, indent + 2,
  ------------------
  |  Branch (311:17): [True: 962, False: 68.5k]
  ------------------
  312|  69.4k|                                     ASN1_ITEM_ptr(tt->item), NULL, NULL, 1,
  ------------------
  |  |  422|  69.4k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  313|  69.4k|                                     pctx))
  314|    962|                return 0;
  315|  69.4k|        }
  316|  55.6k|        if (i == 0 && BIO_printf(out, "%*s<%s>\n", indent + 2, "",
  ------------------
  |  Branch (316:13): [True: 52.2k, False: 3.43k]
  |  Branch (316:23): [True: 0, False: 52.2k]
  ------------------
  317|  52.2k|                                 stack == NULL ? "ABSENT" : "EMPTY") <= 0)
  ------------------
  |  Branch (317:34): [True: 45.2k, False: 6.94k]
  ------------------
  318|      0|            return 0;
  319|  55.6k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) {
  ------------------
  |  | 1053|  55.6k|# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002
  ------------------
  |  Branch (319:13): [True: 0, False: 55.6k]
  ------------------
  320|      0|            if (BIO_printf(out, "%*s}\n", indent, "") <= 0)
  ------------------
  |  Branch (320:17): [True: 0, False: 0]
  ------------------
  321|      0|                return 0;
  322|      0|        }
  323|  55.6k|        return 1;
  324|  55.6k|    }
  325|   430k|    return asn1_item_print_ctx(out, fld, indent, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  422|   430k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  326|   430k|                               fname, sname, 0, pctx);
  327|   487k|}
tasn_prn.c:asn1_primitive_print:
  435|   118k|{
  436|   118k|    long utype;
  437|   118k|    ASN1_STRING *str;
  438|   118k|    int ret = 1, needlf = 1;
  439|   118k|    const char *pname;
  440|   118k|    const ASN1_PRIMITIVE_FUNCS *pf;
  441|   118k|    pf = it->funcs;
  442|   118k|    if (!asn1_print_fsname(out, indent, fname, sname, pctx))
  ------------------
  |  Branch (442:9): [True: 0, False: 118k]
  ------------------
  443|      0|        return 0;
  444|   118k|    if (pf && pf->prim_print)
  ------------------
  |  Branch (444:9): [True: 0, False: 118k]
  |  Branch (444:15): [True: 0, False: 0]
  ------------------
  445|      0|        return pf->prim_print(out, fld, it, indent, pctx);
  446|   118k|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|   118k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (446:9): [True: 733, False: 118k]
  ------------------
  447|    733|        str = (ASN1_STRING *)*fld;
  448|    733|        utype = str->type & ~V_ASN1_NEG;
  ------------------
  |  |   97|    733|# define V_ASN1_NEG                      0x100
  ------------------
  449|   118k|    } else {
  450|   118k|        utype = it->utype;
  451|   118k|        if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|   118k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (451:13): [True: 1.64k, False: 116k]
  ------------------
  452|  1.64k|            str = NULL;
  453|   116k|        else
  454|   116k|            str = (ASN1_STRING *)*fld;
  455|   118k|    }
  456|   118k|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|   118k|# define V_ASN1_ANY                      -4 /* used in ASN1 template code */
  ------------------
  |  Branch (456:9): [True: 14.9k, False: 104k]
  ------------------
  457|  14.9k|        const ASN1_TYPE *atype = (const ASN1_TYPE *)*fld;
  458|  14.9k|        utype = atype->type;
  459|  14.9k|        fld = (const ASN1_VALUE **)&atype->value.asn1_value; /* actually is const */
  460|  14.9k|        str = (ASN1_STRING *)*fld;
  461|  14.9k|        if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE)
  ------------------
  |  | 1059|  14.9k|# define ASN1_PCTX_FLAGS_NO_ANY_TYPE             0x010
  ------------------
  |  Branch (461:13): [True: 0, False: 14.9k]
  ------------------
  462|      0|            pname = NULL;
  463|  14.9k|        else
  464|  14.9k|            pname = ASN1_tag2str(utype);
  465|   104k|    } else {
  466|   104k|        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_TYPE)
  ------------------
  |  | 1057|   104k|# define ASN1_PCTX_FLAGS_SHOW_TYPE               0x008
  ------------------
  |  Branch (466:13): [True: 0, False: 104k]
  ------------------
  467|      0|            pname = ASN1_tag2str(utype);
  468|   104k|        else
  469|   104k|            pname = NULL;
  470|   104k|    }
  471|       |
  472|   118k|    if (utype == V_ASN1_NULL) {
  ------------------
  |  |   67|   118k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (472:9): [True: 1.87k, False: 117k]
  ------------------
  473|  1.87k|        if (BIO_puts(out, "NULL\n") <= 0)
  ------------------
  |  Branch (473:13): [True: 0, False: 1.87k]
  ------------------
  474|      0|            return 0;
  475|  1.87k|        return 1;
  476|  1.87k|    }
  477|       |
  478|   117k|    if (pname) {
  ------------------
  |  Branch (478:9): [True: 13.1k, False: 103k]
  ------------------
  479|  13.1k|        if (BIO_puts(out, pname) <= 0)
  ------------------
  |  Branch (479:13): [True: 0, False: 13.1k]
  ------------------
  480|      0|            return 0;
  481|  13.1k|        if (BIO_puts(out, ":") <= 0)
  ------------------
  |  Branch (481:13): [True: 0, False: 13.1k]
  ------------------
  482|      0|            return 0;
  483|  13.1k|    }
  484|       |
  485|   117k|    switch (utype) {
  486|  2.19k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  2.19k|# define V_ASN1_BOOLEAN                  1
  ------------------
  |  Branch (486:5): [True: 2.19k, False: 114k]
  ------------------
  487|  2.19k|        {
  488|  2.19k|            int boolval = *(int *)fld;
  489|  2.19k|            if (boolval == -1)
  ------------------
  |  Branch (489:17): [True: 0, False: 2.19k]
  ------------------
  490|      0|                boolval = it->size;
  491|  2.19k|            ret = asn1_print_boolean(out, boolval);
  492|  2.19k|        }
  493|  2.19k|        break;
  494|       |
  495|  29.2k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  29.2k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (495:5): [True: 29.2k, False: 87.8k]
  ------------------
  496|  29.2k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  29.2k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (496:5): [True: 11, False: 117k]
  ------------------
  497|  29.2k|        ret = asn1_print_integer(out, str);
  498|  29.2k|        break;
  499|       |
  500|    816|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|    816|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (500:5): [True: 816, False: 116k]
  ------------------
  501|    816|        ret = ASN1_UTCTIME_print(out, str);
  502|    816|        break;
  503|       |
  504|    396|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|    396|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (504:5): [True: 396, False: 116k]
  ------------------
  505|    396|        ret = ASN1_GENERALIZEDTIME_print(out, str);
  506|    396|        break;
  507|       |
  508|  25.1k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  25.1k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (508:5): [True: 25.1k, False: 91.8k]
  ------------------
  509|  25.1k|        ret = asn1_print_oid(out, (const ASN1_OBJECT *)*fld);
  510|  25.1k|        break;
  511|       |
  512|  10.3k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|  10.3k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (512:5): [True: 10.3k, False: 106k]
  ------------------
  513|  22.5k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|  22.5k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (513:5): [True: 12.1k, False: 104k]
  ------------------
  514|  22.5k|        ret = asn1_print_obstring(out, str, indent);
  515|  22.5k|        needlf = 0;
  516|  22.5k|        break;
  517|       |
  518|  8.26k|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  8.26k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (518:5): [True: 8.26k, False: 108k]
  ------------------
  519|  8.95k|    case V_ASN1_SET:
  ------------------
  |  |   75|  8.95k|# define V_ASN1_SET                      17
  ------------------
  |  Branch (519:5): [True: 698, False: 116k]
  ------------------
  520|  10.1k|    case V_ASN1_OTHER:
  ------------------
  |  |   57|  10.1k|# define V_ASN1_OTHER                    -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (520:5): [True: 1.23k, False: 115k]
  ------------------
  521|  10.1k|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (521:13): [True: 0, False: 10.1k]
  ------------------
  522|      0|            return 0;
  523|  10.1k|        if (ASN1_parse_dump(out, str->data, str->length, indent, 0) <= 0)
  ------------------
  |  Branch (523:13): [True: 551, False: 9.64k]
  ------------------
  524|    551|            ret = 0;
  525|  10.1k|        needlf = 0;
  526|  10.1k|        break;
  527|       |
  528|  26.4k|    default:
  ------------------
  |  Branch (528:5): [True: 26.4k, False: 90.5k]
  ------------------
  529|  26.4k|        ret = ASN1_STRING_print_ex(out, str, pctx->str_flags);
  530|       |
  531|   117k|    }
  532|   117k|    if (!ret)
  ------------------
  |  Branch (532:9): [True: 3.33k, False: 113k]
  ------------------
  533|  3.33k|        return 0;
  534|   113k|    if (needlf && BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (534:9): [True: 81.5k, False: 32.1k]
  |  Branch (534:19): [True: 0, False: 81.5k]
  ------------------
  535|      0|        return 0;
  536|   113k|    return 1;
  537|   113k|}
tasn_prn.c:asn1_print_boolean:
  368|  2.19k|{
  369|  2.19k|    const char *str;
  370|  2.19k|    switch (boolval) {
  371|      0|    case -1:
  ------------------
  |  Branch (371:5): [True: 0, False: 2.19k]
  ------------------
  372|      0|        str = "BOOL ABSENT";
  373|      0|        break;
  374|       |
  375|  1.27k|    case 0:
  ------------------
  |  Branch (375:5): [True: 1.27k, False: 925]
  ------------------
  376|  1.27k|        str = "FALSE";
  377|  1.27k|        break;
  378|       |
  379|    925|    default:
  ------------------
  |  Branch (379:5): [True: 925, False: 1.27k]
  ------------------
  380|    925|        str = "TRUE";
  381|    925|        break;
  382|       |
  383|  2.19k|    }
  384|       |
  385|  2.19k|    if (BIO_puts(out, str) <= 0)
  ------------------
  |  Branch (385:9): [True: 0, False: 2.19k]
  ------------------
  386|      0|        return 0;
  387|  2.19k|    return 1;
  388|       |
  389|  2.19k|}
tasn_prn.c:asn1_print_integer:
  392|  29.2k|{
  393|  29.2k|    char *s;
  394|  29.2k|    int ret = 1;
  395|  29.2k|    s = i2s_ASN1_INTEGER(NULL, str);
  396|  29.2k|    if (s == NULL)
  ------------------
  |  Branch (396:9): [True: 11, False: 29.2k]
  ------------------
  397|     11|        return 0;
  398|  29.2k|    if (BIO_puts(out, s) <= 0)
  ------------------
  |  Branch (398:9): [True: 0, False: 29.2k]
  ------------------
  399|      0|        ret = 0;
  400|  29.2k|    OPENSSL_free(s);
  ------------------
  |  |  115|  29.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  29.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  29.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  401|  29.2k|    return ret;
  402|  29.2k|}
tasn_prn.c:asn1_print_oid:
  405|  25.1k|{
  406|  25.1k|    char objbuf[80];
  407|  25.1k|    const char *ln;
  408|  25.1k|    ln = OBJ_nid2ln(OBJ_obj2nid(oid));
  409|  25.1k|    if (!ln)
  ------------------
  |  Branch (409:9): [True: 0, False: 25.1k]
  ------------------
  410|      0|        ln = "";
  411|  25.1k|    OBJ_obj2txt(objbuf, sizeof(objbuf), oid, 1);
  412|  25.1k|    if (BIO_printf(out, "%s (%s)", ln, objbuf) <= 0)
  ------------------
  |  Branch (412:9): [True: 0, False: 25.1k]
  ------------------
  413|      0|        return 0;
  414|  25.1k|    return 1;
  415|  25.1k|}
tasn_prn.c:asn1_print_obstring:
  418|  22.5k|{
  419|  22.5k|    if (str->type == V_ASN1_BIT_STRING) {
  ------------------
  |  |   65|  22.5k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (419:9): [True: 12.1k, False: 10.3k]
  ------------------
  420|  12.1k|        if (BIO_printf(out, " (%ld unused bits)\n", str->flags & 0x7) <= 0)
  ------------------
  |  Branch (420:13): [True: 0, False: 12.1k]
  ------------------
  421|      0|            return 0;
  422|  12.1k|    } else if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (422:16): [True: 0, False: 10.3k]
  ------------------
  423|      0|        return 0;
  424|  22.5k|    if ((str->length > 0)
  ------------------
  |  Branch (424:9): [True: 9.65k, False: 12.8k]
  ------------------
  425|  22.5k|        && BIO_dump_indent(out, (const char *)str->data, str->length,
  ------------------
  |  Branch (425:12): [True: 0, False: 9.65k]
  ------------------
  426|  9.65k|                           indent + 2) <= 0)
  427|      0|        return 0;
  428|  22.5k|    return 1;
  429|  22.5k|}

ASN1_OCTET_STRING_new:
   19|  21.5k|sname *sname##_new(void) \
   20|  21.5k|{ \
   21|  21.5k|    return ASN1_STRING_type_new(V_##sname); \
   22|  21.5k|} \
ASN1_OCTET_STRING_free:
   23|   188k|void sname##_free(sname *x) \
   24|   188k|{ \
   25|   188k|    ASN1_STRING_free(x); \
   26|   188k|}
ASN1_INTEGER_new:
   19|  34.3k|sname *sname##_new(void) \
   20|  34.3k|{ \
   21|  34.3k|    return ASN1_STRING_type_new(V_##sname); \
   22|  34.3k|} \
ASN1_INTEGER_free:
   23|  53.3k|void sname##_free(sname *x) \
   24|  53.3k|{ \
   25|  53.3k|    ASN1_STRING_free(x); \
   26|  53.3k|}
ASN1_ENUMERATED_free:
   23|  24.5k|void sname##_free(sname *x) \
   24|  24.5k|{ \
   25|  24.5k|    ASN1_STRING_free(x); \
   26|  24.5k|}
ASN1_BIT_STRING_new:
   19|   194k|sname *sname##_new(void) \
   20|   194k|{ \
   21|   194k|    return ASN1_STRING_type_new(V_##sname); \
   22|   194k|} \
ASN1_BIT_STRING_free:
   23|   127k|void sname##_free(sname *x) \
   24|   127k|{ \
   25|   127k|    ASN1_STRING_free(x); \
   26|   127k|}
ASN1_UTF8STRING_new:
   19|  21.1k|sname *sname##_new(void) \
   20|  21.1k|{ \
   21|  21.1k|    return ASN1_STRING_type_new(V_##sname); \
   22|  21.1k|} \
ASN1_GENERALIZEDTIME_new:
   19|  7.77k|sname *sname##_new(void) \
   20|  7.77k|{ \
   21|  7.77k|    return ASN1_STRING_type_new(V_##sname); \
   22|  7.77k|} \

ossl_asn1_get_choice_selector:
   30|   148k|{
   31|   148k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   148k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   32|       |
   33|   148k|    return *sel;
   34|   148k|}
ossl_asn1_get_choice_selector_const:
   38|   270k|{
   39|   270k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   270k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   40|       |
   41|   270k|    return *sel;
   42|   270k|}
ossl_asn1_set_choice_selector:
   50|   148k|{
   51|   148k|    int *sel, ret;
   52|       |
   53|   148k|    sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   148k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   54|   148k|    ret = *sel;
   55|   148k|    *sel = value;
   56|   148k|    return ret;
   57|   148k|}
ossl_asn1_do_lock:
   69|  1.62M|{
   70|  1.62M|    const ASN1_AUX *aux;
   71|  1.62M|    CRYPTO_RWLOCK **lock;
   72|  1.62M|    CRYPTO_REF_COUNT *refcnt;
   73|  1.62M|    int ret = -1;
   74|       |
   75|  1.62M|    if ((it->itype != ASN1_ITYPE_SEQUENCE)
  ------------------
  |  |   81|  1.62M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (75:9): [True: 156, False: 1.62M]
  ------------------
   76|  1.62M|        && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))
  ------------------
  |  |   86|    156|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (76:12): [True: 0, False: 156]
  ------------------
   77|      0|        return 0;
   78|  1.62M|    aux = it->funcs;
   79|  1.62M|    if (aux == NULL || (aux->flags & ASN1_AFLG_REFCOUNT) == 0)
  ------------------
  |  |  732|   103k|# define ASN1_AFLG_REFCOUNT      1
  ------------------
  |  Branch (79:9): [True: 1.52M, False: 103k]
  |  Branch (79:24): [True: 80.0k, False: 23.0k]
  ------------------
   80|  1.60M|        return 0;
   81|  23.0k|    lock = offset2ptr(*pval, aux->ref_lock);
  ------------------
  |  |   23|  23.0k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   82|  23.0k|    refcnt = offset2ptr(*pval, aux->ref_offset);
  ------------------
  |  |   23|  23.0k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   83|       |
   84|  23.0k|    switch (op) {
  ------------------
  |  Branch (84:13): [True: 0, False: 23.0k]
  ------------------
   85|  10.5k|    case 0:
  ------------------
  |  Branch (85:5): [True: 10.5k, False: 12.4k]
  ------------------
   86|  10.5k|        if (!CRYPTO_NEW_REF(refcnt, 1))
  ------------------
  |  Branch (86:13): [True: 0, False: 10.5k]
  ------------------
   87|      0|            return -1;
   88|  10.5k|        *lock = CRYPTO_THREAD_lock_new();
   89|  10.5k|        if (*lock == NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 10.5k]
  ------------------
   90|      0|            CRYPTO_FREE_REF(refcnt);
   91|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|            return -1;
   93|      0|        }
   94|  10.5k|        ret = 1;
   95|  10.5k|        break;
   96|      0|    case 1:
  ------------------
  |  Branch (96:5): [True: 0, False: 23.0k]
  ------------------
   97|      0|        if (!CRYPTO_UP_REF(refcnt, &ret))
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            return -1;
   99|      0|        break;
  100|  12.4k|    case -1:
  ------------------
  |  Branch (100:5): [True: 12.4k, False: 10.5k]
  ------------------
  101|  12.4k|        if (!CRYPTO_DOWN_REF(refcnt, &ret))
  ------------------
  |  Branch (101:13): [True: 0, False: 12.4k]
  ------------------
  102|      0|            return -1;  /* failed */
  103|  12.4k|        REF_PRINT_EX(it->sname, ret, (void *)it);
  ------------------
  |  |  299|  12.4k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  ------------------
  |  |  |  |  295|  12.4k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  12.4k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  12.4k|        REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|  12.4k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 12.4k]
  |  |  ------------------
  ------------------
  105|  12.4k|        if (ret == 0) {
  ------------------
  |  Branch (105:13): [True: 10.5k, False: 1.85k]
  ------------------
  106|  10.5k|            CRYPTO_THREAD_lock_free(*lock);
  107|  10.5k|            *lock = NULL;
  108|  10.5k|            CRYPTO_FREE_REF(refcnt);
  109|  10.5k|        }
  110|  12.4k|        break;
  111|  23.0k|    }
  112|       |
  113|  23.0k|    return ret;
  114|  23.0k|}
ossl_asn1_enc_init:
  142|   780k|{
  143|   780k|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  144|       |
  145|   780k|    if (enc != NULL) {
  ------------------
  |  Branch (145:9): [True: 10.5k, False: 769k]
  ------------------
  146|  10.5k|        enc->enc = NULL;
  147|  10.5k|        enc->len = 0;
  148|  10.5k|        enc->modified = 1;
  149|  10.5k|    }
  150|   780k|}
ossl_asn1_enc_free:
  153|   838k|{
  154|   838k|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  155|       |
  156|   838k|    if (enc != NULL) {
  ------------------
  |  Branch (156:9): [True: 10.5k, False: 827k]
  ------------------
  157|  10.5k|        OPENSSL_free(enc->enc);
  ------------------
  |  |  115|  10.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  10.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  10.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|  10.5k|        enc->enc = NULL;
  159|  10.5k|        enc->len = 0;
  160|  10.5k|        enc->modified = 1;
  161|  10.5k|    }
  162|   838k|}
ossl_asn1_enc_save:
  166|   715k|{
  167|   715k|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  168|       |
  169|   715k|    if (enc == NULL)
  ------------------
  |  Branch (169:9): [True: 711k, False: 3.58k]
  ------------------
  170|   711k|        return 1;
  171|       |
  172|  3.58k|    OPENSSL_free(enc->enc);
  ------------------
  |  |  115|  3.58k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.58k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.58k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|  3.58k|    if (inlen <= 0)
  ------------------
  |  Branch (173:9): [True: 0, False: 3.58k]
  ------------------
  174|      0|        return 0;
  175|  3.58k|    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
  ------------------
  |  |  102|  3.58k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.58k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.58k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (175:9): [True: 0, False: 3.58k]
  ------------------
  176|      0|        return 0;
  177|  3.58k|    memcpy(enc->enc, in, inlen);
  178|  3.58k|    enc->len = inlen;
  179|  3.58k|    enc->modified = 0;
  180|       |
  181|  3.58k|    return 1;
  182|  3.58k|}
ossl_asn1_enc_restore:
  186|  1.32M|{
  187|  1.32M|    const ASN1_ENCODING *enc = asn1_get_const_enc_ptr(pval, it);
  188|       |
  189|  1.32M|    if (enc == NULL || enc->modified)
  ------------------
  |  Branch (189:9): [True: 1.30M, False: 25.4k]
  |  Branch (189:24): [True: 0, False: 25.4k]
  ------------------
  190|  1.30M|        return 0;
  191|  25.4k|    if (out) {
  ------------------
  |  Branch (191:9): [True: 4.81k, False: 20.6k]
  ------------------
  192|  4.81k|        memcpy(*out, enc->enc, enc->len);
  193|  4.81k|        *out += enc->len;
  194|  4.81k|    }
  195|  25.4k|    if (len != NULL)
  ------------------
  |  Branch (195:9): [True: 25.4k, False: 0]
  ------------------
  196|  25.4k|        *len = enc->len;
  197|  25.4k|    return 1;
  198|  1.32M|}
ossl_asn1_get_field_ptr:
  202|  8.29M|{
  203|  8.29M|    ASN1_VALUE **pvaltmp = offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  8.29M|#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|  8.29M|    return pvaltmp;
  210|  8.29M|}
ossl_asn1_get_const_field_ptr:
  215|  6.67M|{
  216|  6.67M|    return offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  6.67M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  217|  6.67M|}
ossl_asn1_do_adb:
  227|  11.5M|{
  228|  11.5M|    const ASN1_ADB *adb;
  229|  11.5M|    const ASN1_ADB_TABLE *atbl;
  230|  11.5M|    long selector;
  231|  11.5M|    const ASN1_VALUE **sfld;
  232|  11.5M|    int i;
  233|       |
  234|  11.5M|    if ((tt->flags & ASN1_TFLG_ADB_MASK) == 0)
  ------------------
  |  |  583|  11.5M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (234:9): [True: 11.5M, False: 47.7k]
  ------------------
  235|  11.5M|        return tt;
  236|       |
  237|       |    /* Else ANY DEFINED BY ... get the table */
  238|  47.7k|    adb = ASN1_ADB_ptr(tt->item);
  ------------------
  |  |   89|  47.7k|# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
  ------------------
  239|       |
  240|       |    /* Get the selector field */
  241|  47.7k|    sfld = offset2ptr(val, adb->offset);
  ------------------
  |  |   23|  47.7k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  242|       |
  243|       |    /* Check if NULL */
  244|  47.7k|    if (*sfld == NULL) {
  ------------------
  |  Branch (244:9): [True: 11.4k, False: 36.3k]
  ------------------
  245|  11.4k|        if (adb->null_tt == NULL)
  ------------------
  |  Branch (245:13): [True: 11.4k, False: 0]
  ------------------
  246|  11.4k|            goto err;
  247|      0|        return adb->null_tt;
  248|  11.4k|    }
  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|  36.3k|    if ((tt->flags & ASN1_TFLG_ADB_OID) != 0)
  ------------------
  |  |  585|  36.3k|# define ASN1_TFLG_ADB_OID       (0x1<<8)
  ------------------
  |  Branch (254:9): [True: 36.3k, False: 0]
  ------------------
  255|  36.3k|        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|  36.3k|    if (adb->adb_cb != NULL && adb->adb_cb(&selector) == 0) {
  ------------------
  |  Branch (260:9): [True: 0, False: 36.3k]
  |  Branch (260:32): [True: 0, False: 0]
  ------------------
  261|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        return NULL;
  263|      0|    }
  264|       |
  265|       |    /*
  266|       |     * Try to find matching entry in table Maybe should check application
  267|       |     * types first to allow application override? Might also be useful to
  268|       |     * have a flag which indicates table is sorted and we can do a binary
  269|       |     * search. For now stick to a linear search.
  270|       |     */
  271|       |
  272|   698k|    for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++)
  ------------------
  |  Branch (272:34): [True: 665k, False: 32.9k]
  ------------------
  273|   665k|        if (atbl->value == selector)
  ------------------
  |  Branch (273:13): [True: 3.38k, False: 661k]
  ------------------
  274|  3.38k|            return &atbl->tt;
  275|       |
  276|       |    /* FIXME: need to search application table too */
  277|       |
  278|       |    /* No match, return default type */
  279|  32.9k|    if (!adb->default_tt)
  ------------------
  |  Branch (279:9): [True: 0, False: 32.9k]
  ------------------
  280|      0|        goto err;
  281|  32.9k|    return adb->default_tt;
  282|       |
  283|  11.4k| err:
  284|       |    /* FIXME: should log the value or OID of unsupported type */
  285|  11.4k|    if (nullerr)
  ------------------
  |  Branch (285:9): [True: 0, False: 11.4k]
  ------------------
  286|  11.4k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|  11.4k|    return NULL;
  288|  32.9k|}
tasn_utl.c:asn1_get_enc_ptr:
  117|  2.33M|{
  118|  2.33M|    const ASN1_AUX *aux;
  119|       |
  120|  2.33M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2.33M]
  |  Branch (120:25): [True: 0, False: 2.33M]
  ------------------
  121|      0|        return NULL;
  122|  2.33M|    aux = it->funcs;
  123|  2.33M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|   131k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (123:9): [True: 2.20M, False: 131k]
  |  Branch (123:24): [True: 106k, False: 24.7k]
  ------------------
  124|  2.30M|        return NULL;
  125|  24.7k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  24.7k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  126|  2.33M|}
tasn_utl.c:asn1_get_const_enc_ptr:
  130|  1.32M|{
  131|  1.32M|    const ASN1_AUX *aux;
  132|       |
  133|  1.32M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 1.32M]
  |  Branch (133:25): [True: 0, False: 1.32M]
  ------------------
  134|      0|        return NULL;
  135|  1.32M|    aux = it->funcs;
  136|  1.32M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|   102k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (136:9): [True: 1.22M, False: 102k]
  |  Branch (136:24): [True: 77.2k, False: 25.4k]
  ------------------
  137|  1.30M|        return NULL;
  138|  25.4k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  25.4k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  139|  1.32M|}

X509_ALGOR_get0:
   74|   136k|{
   75|   136k|    if (paobj)
  ------------------
  |  Branch (75:9): [True: 64.8k, False: 72.0k]
  ------------------
   76|  64.8k|        *paobj = algor->algorithm;
   77|   136k|    if (pptype) {
  ------------------
  |  Branch (77:9): [True: 80.1k, False: 56.7k]
  ------------------
   78|  80.1k|        if (algor->parameter == NULL) {
  ------------------
  |  Branch (78:13): [True: 5.50k, False: 74.5k]
  ------------------
   79|  5.50k|            *pptype = V_ASN1_UNDEF;
  ------------------
  |  |   60|  5.50k|# define V_ASN1_UNDEF                    -1
  ------------------
   80|  5.50k|            return;
   81|  5.50k|        } else
   82|  74.5k|            *pptype = algor->parameter->type;
   83|  74.5k|        if (ppval)
  ------------------
  |  Branch (83:13): [True: 74.5k, False: 8]
  ------------------
   84|  74.5k|            *ppval = algor->parameter->value.ptr;
   85|  74.5k|    }
   86|   136k|}
ossl_x509_algor_get_md:
  158|  5.87k|{
  159|  5.87k|    const EVP_MD *md;
  160|       |
  161|  5.87k|    if (alg == NULL)
  ------------------
  |  Branch (161:9): [True: 5.87k, False: 0]
  ------------------
  162|  5.87k|        return EVP_sha1();
  163|      0|    md = EVP_get_digestbyobj(alg->algorithm);
  ------------------
  |  |  553|      0|# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
  |  |  ------------------
  |  |  |  |  552|      0|# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
  |  |  ------------------
  ------------------
  164|      0|    if (md == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_DIGEST);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|    return md;
  167|  5.87k|}

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

INT32_it:
  250|  16.3k|ASN1_ITEM_start(INT32)
  ------------------
  |  |   95|  16.3k|        { \
  |  |   96|  16.3k|                static const ASN1_ITEM local_it = {
  ------------------
  251|  16.3k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  16.3k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  16.3k|# define V_ASN1_INTEGER                  2
  ------------------
  252|  16.3k|    INTxx_FLAG_SIGNED, "INT32"
  ------------------
  |  |   27|  16.3k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  253|  16.3k|ASN1_ITEM_end(INT32)
  ------------------
  |  |  102|  16.3k|                }; \
  |  |  103|  16.3k|        return &local_it; \
  |  |  104|  16.3k|        }
  ------------------
x_int64.c:uint32_clear:
  136|  11.4k|{
  137|  11.4k|    **(uint32_t **)pval = 0;
  138|  11.4k|}
x_int64.c:uint32_c2i:
  173|  4.49k|{
  174|  4.49k|    uint64_t utmp = 0;
  175|  4.49k|    uint32_t utmp2 = 0;
  176|  4.49k|    char *cp;
  177|  4.49k|    int neg = 0;
  178|       |
  179|  4.49k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (179:9): [True: 0, False: 4.49k]
  |  Branch (179:26): [True: 0, False: 0]
  ------------------
  180|      0|        return 0;
  181|       |
  182|  4.49k|    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|  4.49k|    if (len == 0)
  ------------------
  |  Branch (190:9): [True: 1.90k, False: 2.59k]
  ------------------
  191|  1.90k|        goto long_compat;
  192|       |
  193|  2.59k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (193:9): [True: 160, False: 2.43k]
  ------------------
  194|    160|        return 0;
  195|  2.43k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  2.43k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (195:9): [True: 0, False: 2.43k]
  |  Branch (195:48): [True: 0, False: 0]
  ------------------
  196|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|        return 0;
  198|      0|    }
  199|  2.43k|    if (neg) {
  ------------------
  |  Branch (199:9): [True: 1.00k, False: 1.42k]
  ------------------
  200|  1.00k|        if (utmp > ABS_INT32_MIN) {
  ------------------
  |  |  169|  1.00k|#define ABS_INT32_MIN ((uint32_t)INT32_MAX + 1)
  ------------------
  |  Branch (200:13): [True: 73, False: 936]
  ------------------
  201|     73|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|     73|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     73|    (ERR_new(),                                                 \
  |  |  |  |  404|     73|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     73|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     73|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     73|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     73|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|     73|            return 0;
  203|     73|        }
  204|    936|        utmp = 0 - utmp;
  205|  1.42k|    } else {
  206|  1.42k|        if (((it->size & INTxx_FLAG_SIGNED) != 0 && utmp > INT32_MAX)
  ------------------
  |  |   27|  1.42k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (206:14): [True: 1.42k, False: 0]
  |  Branch (206:53): [True: 252, False: 1.17k]
  ------------------
  207|  1.42k|            || ((it->size & INTxx_FLAG_SIGNED) == 0 && utmp > UINT32_MAX)) {
  ------------------
  |  |   27|  1.17k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (207:17): [True: 0, False: 1.17k]
  |  Branch (207:56): [True: 0, False: 0]
  ------------------
  208|    252|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    252|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    252|    (ERR_new(),                                                 \
  |  |  |  |  404|    252|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    252|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    252|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    252|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    252|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|    252|            return 0;
  210|    252|        }
  211|  1.42k|    }
  212|       |
  213|  4.01k| long_compat:
  214|  4.01k|    utmp2 = (uint32_t)utmp;
  215|  4.01k|    memcpy(cp, &utmp2, sizeof(utmp2));
  216|  4.01k|    return 1;
  217|  2.43k|}

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

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

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

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

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

BIO_printf:
  886|  2.18M|{
  887|  2.18M|    va_list args;
  888|  2.18M|    int ret;
  889|       |
  890|  2.18M|    va_start(args, format);
  891|       |
  892|  2.18M|    ret = BIO_vprintf(bio, format, args);
  893|       |
  894|  2.18M|    va_end(args);
  895|  2.18M|    return ret;
  896|  2.18M|}
BIO_vprintf:
  899|  2.18M|{
  900|  2.18M|    int ret;
  901|  2.18M|    size_t retlen;
  902|  2.18M|    char hugebuf[1024 * 2];     /* Was previously 10k, which is unreasonable
  903|       |                                 * in small-stack environments, like threads
  904|       |                                 * or DOS programs. */
  905|  2.18M|    char *hugebufp = hugebuf;
  906|  2.18M|    size_t hugebufsize = sizeof(hugebuf);
  907|  2.18M|    char *dynbuf = NULL;
  908|  2.18M|    int ignored;
  909|       |
  910|  2.18M|    dynbuf = NULL;
  911|  2.18M|    if (!_dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format,
  ------------------
  |  Branch (911:9): [True: 0, False: 2.18M]
  ------------------
  912|  2.18M|                args)) {
  913|      0|        OPENSSL_free(dynbuf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  914|      0|        return -1;
  915|      0|    }
  916|  2.18M|    if (dynbuf) {
  ------------------
  |  Branch (916:9): [True: 0, False: 2.18M]
  ------------------
  917|      0|        ret = BIO_write(bio, dynbuf, (int)retlen);
  918|      0|        OPENSSL_free(dynbuf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  919|  2.18M|    } else {
  920|  2.18M|        ret = BIO_write(bio, hugebuf, (int)retlen);
  921|  2.18M|    }
  922|  2.18M|    return ret;
  923|  2.18M|}
BIO_snprintf:
  932|  13.2M|{
  933|  13.2M|    va_list args;
  934|  13.2M|    int ret;
  935|       |
  936|  13.2M|    va_start(args, format);
  937|       |
  938|  13.2M|    ret = BIO_vsnprintf(buf, n, format, args);
  939|       |
  940|  13.2M|    va_end(args);
  941|  13.2M|    return ret;
  942|  13.2M|}
BIO_vsnprintf:
  945|  13.3M|{
  946|  13.3M|    size_t retlen;
  947|  13.3M|    int truncated;
  948|       |
  949|  13.3M|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (949:9): [True: 0, False: 13.3M]
  ------------------
  950|      0|        return -1;
  951|       |
  952|  13.3M|    if (truncated)
  ------------------
  |  Branch (952:9): [True: 0, False: 13.3M]
  ------------------
  953|       |        /*
  954|       |         * In case of truncation, return -1 like traditional snprintf.
  955|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
  956|       |         * number of characters that would have been written, had the buffer
  957|       |         * been large enough.)
  958|       |         */
  959|      0|        return -1;
  960|  13.3M|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (960:12): [True: 13.3M, False: 0]
  ------------------
  961|  13.3M|}
bio_print.c:_dopr:
   91|  15.5M|{
   92|  15.5M|    char ch;
   93|  15.5M|    int64_t value;
   94|  15.5M|#ifndef OPENSSL_SYS_UEFI
   95|  15.5M|    LDOUBLE fvalue;
  ------------------
  |  |   28|  15.5M|# define LDOUBLE double
  ------------------
   96|  15.5M|#endif
   97|  15.5M|    char *strvalue;
   98|  15.5M|    int min;
   99|  15.5M|    int max;
  100|  15.5M|    int state;
  101|  15.5M|    int flags;
  102|  15.5M|    int cflags;
  103|  15.5M|    size_t currlen;
  104|       |
  105|  15.5M|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  15.5M|#define DP_S_DEFAULT    0
  ------------------
  106|  15.5M|    flags = currlen = cflags = min = 0;
  107|  15.5M|    max = -1;
  108|  15.5M|    ch = *format++;
  109|       |
  110|   241M|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|   241M|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 225M, False: 15.5M]
  ------------------
  111|   225M|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 15.5M, False: 210M]
  |  Branch (111:28): [True: 191M, False: 18.5M]
  |  Branch (111:46): [True: 0, False: 191M]
  ------------------
  112|  15.5M|            state = DP_S_DONE;
  ------------------
  |  |   52|  15.5M|#define DP_S_DONE       7
  ------------------
  113|       |
  114|   225M|        switch (state) {
  115|  35.5M|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  35.5M|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 35.5M, False: 190M]
  ------------------
  116|  35.5M|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 28.9M, False: 6.63M]
  ------------------
  117|  28.9M|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  28.9M|#define DP_S_FLAGS      1
  ------------------
  118|  6.63M|            else
  119|  6.63M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 6.63M]
  ------------------
  120|      0|                    return 0;
  121|  35.5M|            ch = *format++;
  122|  35.5M|            break;
  123|  43.8M|        case DP_S_FLAGS:
  ------------------
  |  |   46|  43.8M|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 43.8M, False: 181M]
  ------------------
  124|  43.8M|            switch (ch) {
  125|   122k|            case '-':
  ------------------
  |  Branch (125:13): [True: 122k, False: 43.7M]
  ------------------
  126|   122k|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|   122k|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|   122k|                ch = *format++;
  128|   122k|                break;
  129|     12|            case '+':
  ------------------
  |  Branch (129:13): [True: 12, False: 43.8M]
  ------------------
  130|     12|                flags |= DP_F_PLUS;
  ------------------
  |  |   58|     12|#define DP_F_PLUS       (1 << 1)
  ------------------
  131|     12|                ch = *format++;
  132|     12|                break;
  133|      0|            case ' ':
  ------------------
  |  Branch (133:13): [True: 0, False: 43.8M]
  ------------------
  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: 43.8M]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|  14.7M|            case '0':
  ------------------
  |  Branch (141:13): [True: 14.7M, False: 29.0M]
  ------------------
  142|  14.7M|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|  14.7M|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|  14.7M|                ch = *format++;
  144|  14.7M|                break;
  145|  28.9M|            default:
  ------------------
  |  Branch (145:13): [True: 28.9M, False: 14.9M]
  ------------------
  146|  28.9M|                state = DP_S_MIN;
  ------------------
  |  |   47|  28.9M|#define DP_S_MIN        2
  ------------------
  147|  28.9M|                break;
  148|  43.8M|            }
  149|  43.8M|            break;
  150|  44.0M|        case DP_S_MIN:
  ------------------
  |  |   47|  44.0M|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 44.0M, False: 181M]
  ------------------
  151|  44.0M|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 15.0M, False: 28.9M]
  ------------------
  152|  15.0M|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|  15.0M|#define char_to_int(p) (p - '0')
  ------------------
  153|  15.0M|                ch = *format++;
  154|  28.9M|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 1.06M, False: 27.8M]
  ------------------
  155|  1.06M|                min = va_arg(args, int);
  156|  1.06M|                ch = *format++;
  157|  1.06M|                state = DP_S_DOT;
  ------------------
  |  |   48|  1.06M|#define DP_S_DOT        3
  ------------------
  158|  1.06M|            } else
  159|  27.8M|                state = DP_S_DOT;
  ------------------
  |  |   48|  27.8M|#define DP_S_DOT        3
  ------------------
  160|  44.0M|            break;
  161|  28.9M|        case DP_S_DOT:
  ------------------
  |  |   48|  28.9M|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 28.9M, False: 196M]
  ------------------
  162|  28.9M|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 19, False: 28.9M]
  ------------------
  163|     19|                state = DP_S_MAX;
  ------------------
  |  |   49|     19|#define DP_S_MAX        4
  ------------------
  164|     19|                ch = *format++;
  165|     19|            } else
  166|  28.9M|                state = DP_S_MOD;
  ------------------
  |  |   50|  28.9M|#define DP_S_MOD        5
  ------------------
  167|  28.9M|            break;
  168|     19|        case DP_S_MAX:
  ------------------
  |  |   49|     19|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 19, False: 225M]
  ------------------
  169|     19|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 19]
  ------------------
  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|     19|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 19, False: 0]
  ------------------
  175|     19|                max = va_arg(args, int);
  176|     19|                ch = *format++;
  177|     19|                state = DP_S_MOD;
  ------------------
  |  |   50|     19|#define DP_S_MOD        5
  ------------------
  178|     19|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|     19|            break;
  181|  28.9M|        case DP_S_MOD:
  ------------------
  |  |   50|  28.9M|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 28.9M, False: 196M]
  ------------------
  182|  28.9M|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 28.9M]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|   584k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 584k, False: 28.3M]
  ------------------
  188|   584k|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 12, False: 584k]
  ------------------
  189|     12|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|     12|#define DP_C_LLONG      4
  ------------------
  190|     12|                    format++;
  191|     12|                } else
  192|   584k|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|   584k|#define DP_C_LONG       2
  ------------------
  193|   584k|                ch = *format++;
  194|   584k|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 28.9M]
  ------------------
  196|  1.48k|            case 'j':
  ------------------
  |  Branch (196:13): [True: 1.48k, False: 28.9M]
  ------------------
  197|  1.48k|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|  1.48k|#define DP_C_LLONG      4
  ------------------
  198|  1.48k|                ch = *format++;
  199|  1.48k|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 28.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: 28.9M]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|  28.3M|            default:
  ------------------
  |  Branch (208:13): [True: 28.3M, False: 585k]
  ------------------
  209|  28.3M|                break;
  210|  28.9M|            }
  211|  28.9M|            state = DP_S_CONV;
  ------------------
  |  |   51|  28.9M|#define DP_S_CONV       6
  ------------------
  212|  28.9M|            break;
  213|  28.9M|        case DP_S_CONV:
  ------------------
  |  |   51|  28.9M|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 28.9M, False: 196M]
  ------------------
  214|  28.9M|            switch (ch) {
  215|   348k|            case 'd':
  ------------------
  |  Branch (215:13): [True: 348k, False: 28.5M]
  ------------------
  216|   348k|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 28.9M]
  ------------------
  217|   348k|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 348k]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|   202k|                case DP_C_LONG:
  ------------------
  |  |   72|   202k|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 202k, False: 145k]
  ------------------
  222|   202k|                    value = va_arg(args, long int);
  223|   202k|                    break;
  224|     12|                case DP_C_LLONG:
  ------------------
  |  |   74|     12|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 12, False: 348k]
  ------------------
  225|     12|                    value = va_arg(args, int64_t);
  226|     12|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 348k]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|   145k|                default:
  ------------------
  |  Branch (230:17): [True: 145k, False: 202k]
  ------------------
  231|   145k|                    value = va_arg(args, int);
  232|   145k|                    break;
  233|   348k|                }
  234|   348k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 348k]
  ------------------
  235|   348k|                            max, flags))
  236|      0|                    return 0;
  237|   348k|                break;
  238|  1.96M|            case 'X':
  ------------------
  |  Branch (238:13): [True: 1.96M, False: 26.9M]
  ------------------
  239|  1.96M|                flags |= DP_F_UP;
  ------------------
  |  |   66|  1.96M|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|  14.7M|            case 'x':
  ------------------
  |  Branch (241:13): [True: 12.7M, False: 16.1M]
  ------------------
  242|  14.7M|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 28.9M]
  ------------------
  243|  15.0M|            case 'u':
  ------------------
  |  Branch (243:13): [True: 321k, False: 28.5M]
  ------------------
  244|  15.0M|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  15.0M|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  15.0M|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 15.0M]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|   381k|                case DP_C_LONG:
  ------------------
  |  |   72|   381k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 381k, False: 14.6M]
  ------------------
  250|   381k|                    value = va_arg(args, unsigned long int);
  251|   381k|                    break;
  252|  1.48k|                case DP_C_LLONG:
  ------------------
  |  |   74|  1.48k|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 1.48k, False: 15.0M]
  ------------------
  253|  1.48k|                    value = va_arg(args, uint64_t);
  254|  1.48k|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 15.0M]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|  14.6M|                default:
  ------------------
  |  Branch (258:17): [True: 14.6M, False: 383k]
  ------------------
  259|  14.6M|                    value = va_arg(args, unsigned int);
  260|  14.6M|                    break;
  261|  15.0M|                }
  262|  15.0M|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 15.0M]
  ------------------
  263|  15.0M|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 15.0M]
  |  Branch (263:46): [True: 321k, False: 14.7M]
  ------------------
  264|  15.0M|                            min, max, flags))
  265|      0|                    return 0;
  266|  15.0M|                break;
  267|  15.0M|#ifndef OPENSSL_SYS_UEFI
  268|  15.0M|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 28.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: 28.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: 28.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: 28.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: 28.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|  11.8M|            case 'c':
  ------------------
  |  Branch (311:13): [True: 11.8M, False: 17.0M]
  ------------------
  312|  11.8M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 11.8M]
  ------------------
  313|  11.8M|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|  11.8M|                break;
  316|  11.8M|            case 's':
  ------------------
  |  Branch (316:13): [True: 1.66M, False: 27.2M]
  ------------------
  317|  1.66M|                strvalue = va_arg(args, char *);
  318|  1.66M|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 1.66M, False: 19]
  ------------------
  319|  1.66M|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 406k, False: 1.25M]
  ------------------
  320|   406k|                        max = INT_MAX;
  321|  1.25M|                    else
  322|  1.25M|                        max = *maxlen;
  323|  1.66M|                }
  324|  1.66M|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 1.66M]
  ------------------
  325|  1.66M|                            flags, min, max))
  326|      0|                    return 0;
  327|  1.66M|                break;
  328|  1.66M|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 28.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: 28.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: 28.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: 28.9M]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 28.9M]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  28.9M|            }
  353|  28.9M|            ch = *format++;
  354|  28.9M|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  28.9M|#define DP_S_DEFAULT    0
  ------------------
  355|  28.9M|            flags = cflags = min = 0;
  356|  28.9M|            max = -1;
  357|  28.9M|            break;
  358|  15.5M|        case DP_S_DONE:
  ------------------
  |  |   52|  15.5M|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 15.5M, False: 210M]
  ------------------
  359|  15.5M|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 225M]
  ------------------
  361|      0|            break;
  362|   225M|        }
  363|   225M|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  15.5M|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 13.3M, False: 2.18M]
  ------------------
  369|  13.3M|        *truncated = (currlen > *maxlen - 1);
  370|  13.3M|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 13.3M]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  13.3M|    }
  373|  15.5M|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 15.5M]
  ------------------
  374|      0|        return 0;
  375|  15.5M|    *retlen = currlen - 1;
  376|  15.5M|    return 1;
  377|  15.5M|}
bio_print.c:doapr_outch:
  840|  89.0M|{
  841|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  842|  89.0M|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|  89.0M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 89.0M, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  89.0M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (842:9): [True: 0, False: 89.0M]
  ------------------
  843|      0|        return 0;
  844|       |
  845|       |    /* |currlen| must always be <= |*maxlen| */
  846|  89.0M|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|  89.0M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  89.0M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (846:9): [True: 0, False: 89.0M]
  ------------------
  847|      0|        return 0;
  848|       |
  849|  89.0M|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (849:9): [True: 10.9M, False: 78.0M]
  |  Branch (849:19): [True: 0, False: 10.9M]
  ------------------
  850|      0|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  835|      0|#define BUFFER_INC  1024
  ------------------
  |  Branch (850:13): [True: 0, False: 0]
  ------------------
  851|      0|            return 0;
  852|       |
  853|      0|        *maxlen += BUFFER_INC;
  ------------------
  |  |  835|      0|#define BUFFER_INC  1024
  ------------------
  854|      0|        if (*buffer == NULL) {
  ------------------
  |  Branch (854:13): [True: 0, False: 0]
  ------------------
  855|      0|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL)
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (855:17): [True: 0, False: 0]
  ------------------
  856|      0|                return 0;
  857|      0|            if (*currlen > 0) {
  ------------------
  |  Branch (857:17): [True: 0, False: 0]
  ------------------
  858|      0|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (858:21): [True: 0, False: 0]
  ------------------
  859|      0|                    return 0;
  860|      0|                memcpy(*buffer, *sbuffer, *currlen);
  861|      0|            }
  862|      0|            *sbuffer = NULL;
  863|      0|        } else {
  864|      0|            char *tmpbuf;
  865|       |
  866|      0|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (867:17): [True: 0, False: 0]
  ------------------
  868|      0|                return 0;
  869|      0|            *buffer = tmpbuf;
  870|      0|        }
  871|      0|    }
  872|       |
  873|  89.0M|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (873:9): [True: 89.0M, False: 0]
  ------------------
  874|  89.0M|        if (*sbuffer)
  ------------------
  |  Branch (874:13): [True: 89.0M, False: 0]
  ------------------
  875|  89.0M|            (*sbuffer)[(*currlen)++] = (char)c;
  876|      0|        else
  877|      0|            (*buffer)[(*currlen)++] = (char)c;
  878|  89.0M|    }
  879|       |
  880|  89.0M|    return 1;
  881|  89.0M|}
bio_print.c:fmtint:
  436|  15.3M|{
  437|  15.3M|    int signvalue = 0;
  438|  15.3M|    const char *prefix = "";
  439|  15.3M|    uint64_t uvalue;
  440|  15.3M|    char convert[DECIMAL_SIZE(value) + 3];
  441|  15.3M|    int place = 0;
  442|  15.3M|    int spadlen = 0;
  443|  15.3M|    int zpadlen = 0;
  444|  15.3M|    int caps = 0;
  445|       |
  446|  15.3M|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 15.3M, False: 0]
  ------------------
  447|  15.3M|        max = 0;
  448|  15.3M|    uvalue = value;
  449|  15.3M|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  15.3M|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 348k, False: 15.0M]
  ------------------
  450|   348k|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 9, False: 348k]
  ------------------
  451|      9|            signvalue = '-';
  452|      9|            uvalue = 0 - (uint64_t)value;
  453|   348k|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|   348k|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 3, False: 348k]
  ------------------
  454|      3|            signvalue = '+';
  455|   348k|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|   348k|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 348k]
  ------------------
  456|      0|            signvalue = ' ';
  457|   348k|    }
  458|  15.3M|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  15.3M|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 15.3M]
  ------------------
  459|      0|        if (base == 8)
  ------------------
  |  Branch (459:13): [True: 0, False: 0]
  ------------------
  460|      0|            prefix = "0";
  461|      0|        if (base == 16)
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            prefix = "0x";
  463|      0|    }
  464|  15.3M|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  15.3M|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 1.96M, False: 13.4M]
  ------------------
  465|  1.96M|        caps = 1;
  466|  30.5M|    do {
  467|  30.5M|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 3.49M, False: 27.0M]
  ------------------
  468|  30.5M|            [uvalue % (unsigned)base];
  469|  30.5M|        uvalue = (uvalue / (unsigned)base);
  470|  30.5M|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 15.1M, False: 15.3M]
  |  Branch (470:24): [True: 15.1M, False: 0]
  ------------------
  471|  15.3M|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 15.3M]
  ------------------
  472|      0|        place--;
  473|  15.3M|    convert[place] = 0;
  474|       |
  475|  15.3M|    zpadlen = max - place;
  476|  15.3M|    spadlen =
  477|  15.3M|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  15.3M|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 15.3M]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 12, False: 15.3M]
  ------------------
  478|  15.3M|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 15.3M, False: 0]
  ------------------
  479|  15.3M|        zpadlen = 0;
  480|  15.3M|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 979k, False: 14.4M]
  ------------------
  481|   979k|        spadlen = 0;
  482|  15.3M|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  15.3M|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 14.7M, False: 597k]
  ------------------
  483|  14.7M|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|  14.7M|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 11.9M, False: 2.79M]
  |  |  ------------------
  ------------------
  484|  14.7M|        spadlen = 0;
  485|  14.7M|    }
  486|  15.3M|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  15.3M|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 61.2k, False: 15.3M]
  ------------------
  487|  61.2k|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  15.6M|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 291k, False: 15.3M]
  ------------------
  491|   291k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 291k]
  ------------------
  492|      0|            return 0;
  493|   291k|        --spadlen;
  494|   291k|    }
  495|       |
  496|       |    /* sign */
  497|  15.3M|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 12, False: 15.3M]
  ------------------
  498|     12|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 12]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  15.3M|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 15.3M]
  ------------------
  503|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            return 0;
  505|      0|        prefix++;
  506|      0|    }
  507|       |
  508|       |    /* zeros */
  509|  15.3M|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 2.79M, False: 12.5M]
  ------------------
  510|  5.65M|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 2.85M, False: 2.79M]
  ------------------
  511|  2.85M|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 2.85M]
  ------------------
  512|      0|                return 0;
  513|  2.85M|            --zpadlen;
  514|  2.85M|        }
  515|  2.79M|    }
  516|       |    /* digits */
  517|  45.9M|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 30.5M, False: 15.3M]
  ------------------
  518|  30.5M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 30.5M]
  ------------------
  519|      0|            return 0;
  520|  30.5M|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  15.4M|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 58.7k, False: 15.3M]
  ------------------
  524|  58.7k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 58.7k]
  ------------------
  525|      0|            return 0;
  526|  58.7k|        ++spadlen;
  527|  58.7k|    }
  528|  15.3M|    return 1;
  529|  15.3M|}
bio_print.c:fmtstr:
  384|  1.66M|{
  385|  1.66M|    int padlen;
  386|  1.66M|    size_t strln;
  387|  1.66M|    int cnt = 0;
  388|       |
  389|  1.66M|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 1.66M]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|  1.66M|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 1.66M]
  ------------------
  393|       |
  394|  1.66M|    padlen = min - strln;
  395|  1.66M|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 1.66M]
  |  Branch (395:20): [True: 529k, False: 1.13M]
  ------------------
  396|   529k|        padlen = 0;
  397|  1.66M|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 1.66M, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|  1.66M|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 1.25M, False: 406k]
  ------------------
  403|  1.25M|            max += padlen;
  404|   406k|        else
  405|   406k|            max = INT_MAX;
  406|  1.66M|    }
  407|  1.66M|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  1.66M|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 61.2k, False: 1.59M]
  ------------------
  408|  61.2k|        padlen = -padlen;
  409|       |
  410|  15.2M|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 13.5M, False: 1.66M]
  |  Branch (410:29): [True: 0, False: 13.5M]
  |  Branch (410:40): [True: 13.5M, False: 0]
  ------------------
  411|  13.5M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 13.5M]
  ------------------
  412|      0|            return 0;
  413|  13.5M|        --padlen;
  414|  13.5M|        ++cnt;
  415|  13.5M|    }
  416|  8.67M|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 7.01M, False: 1.66M]
  |  Branch (416:26): [True: 0, False: 7.01M]
  |  Branch (416:37): [True: 7.01M, False: 0]
  ------------------
  417|  7.01M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 7.01M]
  ------------------
  418|      0|            return 0;
  419|  7.01M|        --strln;
  420|  7.01M|        ++cnt;
  421|  7.01M|    }
  422|  2.31M|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 649k, False: 1.66M]
  |  Branch (422:29): [True: 0, False: 649k]
  |  Branch (422:40): [True: 649k, False: 0]
  ------------------
  423|   649k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 649k]
  ------------------
  424|      0|            return 0;
  425|   649k|        ++padlen;
  426|   649k|        ++cnt;
  427|   649k|    }
  428|  1.66M|    return 1;
  429|  1.66M|}

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

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

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

BIO_s_mem:
   73|   129k|{
   74|   129k|    return &mem_method;
   75|   129k|}
BIO_new_mem_buf:
   83|   118k|{
   84|   118k|    BIO *ret;
   85|   118k|    BUF_MEM *b;
   86|   118k|    BIO_BUF_MEM *bb;
   87|   118k|    size_t sz;
   88|       |
   89|   118k|    if (buf == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 118k]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|   118k|    sz = (len < 0) ? strlen(buf) : (size_t)len;
  ------------------
  |  Branch (93:10): [True: 0, False: 118k]
  ------------------
   94|   118k|    if ((ret = BIO_new(BIO_s_mem())) == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 118k]
  ------------------
   95|      0|        return NULL;
   96|   118k|    bb = (BIO_BUF_MEM *)ret->ptr;
   97|   118k|    b = bb->buf;
   98|       |    /* Cast away const and trust in the MEM_RDONLY flag. */
   99|   118k|    b->data = (void *)buf;
  100|   118k|    b->length = sz;
  101|   118k|    b->max = sz;
  102|   118k|    *bb->readp = *bb->buf;
  103|   118k|    ret->flags |= BIO_FLAGS_MEM_RDONLY;
  ------------------
  |  |  237|   118k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  104|       |    /* Since this is static data retrying won't help */
  105|   118k|    ret->num = 0;
  106|   118k|    return ret;
  107|   118k|}
bss_mem.c:mem_write:
  215|  89.3k|{
  216|  89.3k|    int ret = -1;
  217|  89.3k|    int blen;
  218|  89.3k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|  89.3k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  237|  89.3k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 89.3k]
  ------------------
  221|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|  89.3k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  261|  89.3k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|  89.3k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|  89.3k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|  89.3k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  89.3k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|  89.3k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|  89.3k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 3, False: 89.3k]
  ------------------
  226|      3|        return 0;
  227|  89.3k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 89.3k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|  89.3k|    blen = bbm->readp->length;
  232|  89.3k|    mem_buf_sync(b);
  233|  89.3k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 89.3k]
  ------------------
  234|      0|        goto end;
  235|  89.3k|    memcpy(bbm->buf->data + blen, in, inl);
  236|  89.3k|    *bbm->readp = *bbm->buf;
  237|  89.3k|    ret = inl;
  238|  89.3k| end:
  239|  89.3k|    return ret;
  240|  89.3k|}
bss_mem.c:mem_buf_sync:
  178|  89.3k|{
  179|  89.3k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 89.3k, False: 0]
  |  Branch (179:22): [True: 89.3k, False: 0]
  |  Branch (179:38): [True: 89.3k, False: 0]
  ------------------
  180|  89.3k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|  89.3k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 0, False: 89.3k]
  ------------------
  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|  89.3k|    }
  188|  89.3k|    return 0;
  189|  89.3k|}
bss_mem.c:mem_read:
  192|  8.69M|{
  193|  8.69M|    int ret = -1;
  194|  8.69M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|  8.69M|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|  8.69M|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|  8.69M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 716k, False: 7.97M]
  ------------------
  198|   716k|        bm = bbm->buf;
  199|  8.69M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  261|  8.69M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|  8.69M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|  8.69M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|  8.69M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  8.69M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|  8.69M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|  8.69M|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 8.69M, False: 0]
  |  Branch (200:25): [True: 119k, False: 8.57M]
  ------------------
  201|  8.69M|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 8.69M, False: 0]
  |  Branch (201:26): [True: 8.61M, False: 78.2k]
  ------------------
  202|  8.61M|        memcpy(out, bm->data, ret);
  203|  8.61M|        bm->length -= ret;
  204|  8.61M|        bm->max -= ret;
  205|  8.61M|        bm->data += ret;
  206|  8.61M|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 78.2k, False: 0]
  ------------------
  207|  78.2k|        ret = b->num;
  208|  78.2k|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 12.7k, False: 65.4k]
  ------------------
  209|  12.7k|            BIO_set_retry_read(b);
  ------------------
  |  |  255|  12.7k|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|  12.7k|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|  12.7k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|  78.2k|    }
  211|  8.69M|    return ret;
  212|  8.69M|}
bss_mem.c:mem_puts:
  380|  1.82k|{
  381|  1.82k|    int n, ret;
  382|       |
  383|  1.82k|    n = strlen(str);
  384|  1.82k|    ret = mem_write(bp, str, n);
  385|       |    /* memory semantics is that it will always work */
  386|  1.82k|    return ret;
  387|  1.82k|}
bss_mem.c:mem_ctrl:
  243|   418k|{
  244|   418k|    long ret = 1;
  245|   418k|    char **pptr;
  246|   418k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|   418k|    BUF_MEM *bm, *bo;            /* bio_mem, bio_other */
  248|   418k|    long off, remain;
  249|       |
  250|   418k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  237|   418k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (250:9): [True: 417k, False: 1.48k]
  ------------------
  251|   417k|        bm = bbm->buf;
  252|   417k|        bo = bbm->readp;
  253|   417k|    } else {
  254|  1.48k|        bm = bbm->readp;
  255|  1.48k|        bo = bbm->buf;
  256|  1.48k|    }
  257|   418k|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 399k, False: 19.4k]
  ------------------
  258|   418k|    remain = bm->length;
  259|       |
  260|   418k|    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: 418k]
  ------------------
  262|      0|        bm = bbm->buf;
  263|      0|        if (bm->data != NULL) {
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY)) {
  ------------------
  |  |  237|      0|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                if (!(b->flags & BIO_FLAGS_NONCLEAR_RST)) {
  ------------------
  |  |  238|      0|# define BIO_FLAGS_NONCLEAR_RST  0x400
  ------------------
  |  Branch (265:21): [True: 0, False: 0]
  ------------------
  266|      0|                    memset(bm->data, 0, bm->max);
  267|      0|                    bm->length = 0;
  268|      0|                }
  269|      0|                *bbm->readp = *bbm->buf;
  270|      0|            } else {
  271|       |                /* For read only case just reset to the start again */
  272|      0|                *bbm->buf = *bbm->readp;
  273|      0|            }
  274|      0|        }
  275|      0|        break;
  276|   113k|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  459|   113k|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (276:5): [True: 113k, False: 305k]
  ------------------
  277|   113k|        if (num < 0 || num > off + remain)
  ------------------
  |  Branch (277:13): [True: 0, False: 113k]
  |  Branch (277:24): [True: 0, False: 113k]
  ------------------
  278|      0|            return -1;   /* Can't see outside of the current buffer */
  279|       |
  280|   113k|        bm->data = (num != 0) ? bo->data + num : bo->data;
  ------------------
  |  Branch (280:20): [True: 0, False: 113k]
  ------------------
  281|   113k|        bm->length = bo->length - num;
  282|   113k|        bm->max = bo->max - num;
  283|   113k|        off = num;
  284|       |        /* FALLTHRU */
  285|   398k|    case BIO_C_FILE_TELL:
  ------------------
  |  |  465|   398k|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (285:5): [True: 284k, False: 134k]
  ------------------
  286|   398k|        ret = off;
  287|   398k|        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: 418k]
  ------------------
  289|      0|        ret = (long)(bm->length == 0);
  290|      0|        break;
  291|      0|    case BIO_C_SET_BUF_MEM_EOF_RETURN:
  ------------------
  |  |  461|      0|# define BIO_C_SET_BUF_MEM_EOF_RETURN            130/* return end of input
  ------------------
  |  Branch (291:5): [True: 0, False: 418k]
  ------------------
  292|      0|        b->num = (int)num;
  293|      0|        break;
  294|  20.7k|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|  20.7k|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (294:5): [True: 20.7k, False: 398k]
  ------------------
  295|  20.7k|        ret = (long)bm->length;
  296|  20.7k|        if (ptr != NULL) {
  ------------------
  |  Branch (296:13): [True: 20.7k, False: 0]
  ------------------
  297|  20.7k|            pptr = (char **)ptr;
  298|  20.7k|            *pptr = (char *)(bm->data);
  299|  20.7k|        }
  300|  20.7k|        break;
  301|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  445|      0|# define BIO_C_SET_BUF_MEM                       114
  ------------------
  |  Branch (301:5): [True: 0, False: 418k]
  ------------------
  302|      0|        mem_buf_free(b);
  303|      0|        b->shutdown = (int)num;
  304|      0|        bbm->buf = ptr;
  305|      0|        *bbm->readp = *bbm->buf;
  306|      0|        break;
  307|      0|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  446|      0|# define BIO_C_GET_BUF_MEM_PTR                   115
  ------------------
  |  Branch (307:5): [True: 0, False: 418k]
  ------------------
  308|      0|        if (ptr != NULL) {
  ------------------
  |  Branch (308:13): [True: 0, False: 0]
  ------------------
  309|      0|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  237|      0|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (309:17): [True: 0, False: 0]
  ------------------
  310|      0|                mem_buf_sync(b);
  311|      0|            bm = bbm->buf;
  312|      0|            pptr = (char **)ptr;
  313|      0|            *pptr = (char *)bm;
  314|      0|        }
  315|      0|        break;
  316|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   95|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (316:5): [True: 0, False: 418k]
  ------------------
  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: 418k]
  ------------------
  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: 418k]
  ------------------
  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: 418k]
  ------------------
  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: 418k]
  ------------------
  329|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (329:5): [True: 0, False: 418k]
  ------------------
  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: 418k]
  ------------------
  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: 418k]
  ------------------
  334|      0|    default:
  ------------------
  |  Branch (334:5): [True: 0, False: 418k]
  ------------------
  335|      0|        ret = 0;
  336|      0|        break;
  337|   418k|    }
  338|   418k|    return ret;
  339|   418k|}
bss_mem.c:mem_buf_free:
  158|   129k|{
  159|   129k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 129k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|   129k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 129k, False: 0]
  |  Branch (162:24): [True: 129k, False: 0]
  |  Branch (162:35): [True: 129k, False: 0]
  ------------------
  163|   129k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|   129k|        BUF_MEM *b = bb->buf;
  165|       |
  166|   129k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|   129k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 118k, False: 11.1k]
  ------------------
  167|   118k|            b->data = NULL;
  168|   129k|        BUF_MEM_free(b);
  169|   129k|    }
  170|   129k|    return 1;
  171|   129k|}
bss_mem.c:mem_new:
  133|   129k|{
  134|   129k|    return mem_init(bi, 0L);
  135|   129k|}
bss_mem.c:mem_init:
  110|   129k|{
  111|   129k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  104|   129k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   129k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   129k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|   129k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 129k]
  ------------------
  114|      0|        return 0;
  115|   129k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 129k]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|   129k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  104|   129k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   129k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   129k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 129k]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|   129k|    *bb->readp = *bb->buf;
  125|   129k|    bi->shutdown = 1;
  126|   129k|    bi->init = 1;
  127|   129k|    bi->num = -1;
  128|   129k|    bi->ptr = (char *)bb;
  129|   129k|    return 1;
  130|   129k|}
bss_mem.c:mem_free:
  143|   129k|{
  144|   129k|    BIO_BUF_MEM *bb;
  145|       |
  146|   129k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 129k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|   129k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|   129k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 129k]
  ------------------
  151|      0|        return 0;
  152|   129k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  115|   129k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   129k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   129k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|   129k|    OPENSSL_free(bb);
  ------------------
  |  |  115|   129k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   129k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   129k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|   129k|    return 1;
  155|   129k|}

BIO_s_null:
   36|  6.94k|{
   37|  6.94k|    return &null_method;
   38|  6.94k|}
bss_null.c:null_write:
   46|  4.37M|{
   47|  4.37M|    return inl;
   48|  4.37M|}
bss_null.c:null_puts:
   81|   973k|{
   82|   973k|    if (str == NULL)
  ------------------
  |  Branch (82:9): [True: 0, False: 973k]
  ------------------
   83|      0|        return 0;
   84|   973k|    return strlen(str);
   85|   973k|}
bss_null.c:null_ctrl:
   51|   183k|{
   52|   183k|    long ret = 1;
   53|       |
   54|   183k|    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: 183k]
  ------------------
   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: 183k]
  ------------------
   57|      0|    case BIO_CTRL_SET:
  ------------------
  |  |   91|      0|# define BIO_CTRL_SET            4/* man - set the 'IO' type */
  ------------------
  |  Branch (57:5): [True: 0, False: 183k]
  ------------------
   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: 183k]
  ------------------
   59|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (59:5): [True: 0, False: 183k]
  ------------------
   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: 183k]
  ------------------
   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: 183k]
  ------------------
   64|      0|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|      0|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (64:5): [True: 0, False: 183k]
  ------------------
   65|      0|    case BIO_CTRL_GET:
  ------------------
  |  |   92|      0|# define BIO_CTRL_GET            5/* man - get the 'IO' type */
  ------------------
  |  Branch (65:5): [True: 0, False: 183k]
  ------------------
   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: 183k]
  ------------------
   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: 183k]
  ------------------
   68|   183k|    default:
  ------------------
  |  Branch (68:5): [True: 183k, False: 0]
  ------------------
   69|   183k|        ret = 0;
   70|   183k|        break;
   71|   183k|    }
   72|   183k|    return ret;
   73|   183k|}

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

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

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

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

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

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

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

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|  5.52k|{
  100|  5.52k|    int ret;
  101|       |
  102|  5.52k|    bn_check_top(a);
  103|  5.52k|    bn_check_top(p);
  104|  5.52k|    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|  5.52k|#define MONT_MUL_MOD
  138|  5.52k|#define MONT_EXP_WORD
  139|  5.52k|#define RECP_MUL_MOD
  140|       |
  141|  5.52k|#ifdef MONT_MUL_MOD
  142|  5.52k|    if (BN_is_odd(m)) {
  ------------------
  |  Branch (142:9): [True: 5.52k, False: 0]
  ------------------
  143|  5.52k|# ifdef MONT_EXP_WORD
  144|  5.52k|        if (a->top == 1 && !a->neg
  ------------------
  |  Branch (144:13): [True: 0, False: 5.52k]
  |  Branch (144:28): [True: 0, False: 0]
  ------------------
  145|  5.52k|            && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (145:16): [True: 0, False: 0]
  ------------------
  146|  5.52k|            && (BN_get_flags(a, BN_FLG_CONSTTIME) == 0)
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (146:16): [True: 0, False: 0]
  ------------------
  147|  5.52k|            && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) {
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (147:16): [True: 0, False: 0]
  ------------------
  148|      0|            BN_ULONG A = a->d[0];
  ------------------
  |  |   37|      0|#  define BN_ULONG        unsigned long
  ------------------
  149|      0|            ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
  150|      0|        } else
  151|  5.52k|# endif
  152|  5.52k|            ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
  153|  5.52k|    } else
  154|      0|#endif
  155|      0|#ifdef RECP_MUL_MOD
  156|      0|    {
  157|      0|        ret = BN_mod_exp_recp(r, a, p, m, ctx);
  158|      0|    }
  159|       |#else
  160|       |    {
  161|       |        ret = BN_mod_exp_simple(r, a, p, m, ctx);
  162|       |    }
  163|       |#endif
  164|       |
  165|  5.52k|    bn_check_top(r);
  166|  5.52k|    return ret;
  167|  5.52k|}
BN_mod_exp_mont:
  314|  6.15k|{
  315|  6.15k|    int i, j, bits, ret = 0, wstart, wend, window;
  316|  6.15k|    int start = 1;
  317|  6.15k|    BIGNUM *d, *r;
  318|  6.15k|    const BIGNUM *aa;
  319|       |    /* Table of variables obtained from 'ctx' */
  320|  6.15k|    BIGNUM *val[TABLE_SIZE];
  321|  6.15k|    BN_MONT_CTX *mont = NULL;
  322|       |
  323|  6.15k|    bn_check_top(a);
  324|  6.15k|    bn_check_top(p);
  325|  6.15k|    bn_check_top(m);
  326|       |
  327|  6.15k|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 6.15k]
  ------------------
  328|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  329|      0|        return 0;
  330|      0|    }
  331|       |
  332|  6.15k|    if (m->top <= BN_CONSTTIME_SIZE_LIMIT
  ------------------
  |  |   46|  12.3k|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|  6.15k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (332:9): [True: 6.15k, False: 0]
  ------------------
  333|  6.15k|        && (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  6.15k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (333:13): [True: 0, False: 6.15k]
  ------------------
  334|  6.15k|            || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  6.15k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (334:16): [True: 0, False: 6.15k]
  ------------------
  335|  6.15k|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|  6.15k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (335:16): [True: 0, False: 6.15k]
  ------------------
  336|      0|        return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
  337|      0|    }
  338|       |
  339|  6.15k|    bits = BN_num_bits(p);
  340|  6.15k|    if (bits == 0) {
  ------------------
  |  Branch (340:9): [True: 9, False: 6.14k]
  ------------------
  341|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  342|      9|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (342:13): [True: 0, False: 9]
  ------------------
  343|      0|            ret = 1;
  344|      0|            BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  345|      9|        } else {
  346|      9|            ret = BN_one(rr);
  ------------------
  |  |  197|      9|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  347|      9|        }
  348|      9|        return ret;
  349|      9|    }
  350|       |
  351|  6.14k|    BN_CTX_start(ctx);
  352|  6.14k|    d = BN_CTX_get(ctx);
  353|  6.14k|    r = BN_CTX_get(ctx);
  354|  6.14k|    val[0] = BN_CTX_get(ctx);
  355|  6.14k|    if (val[0] == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 6.14k]
  ------------------
  356|      0|        goto err;
  357|       |
  358|       |    /*
  359|       |     * If this is not done, things will break in the montgomery part
  360|       |     */
  361|       |
  362|  6.14k|    if (in_mont != NULL)
  ------------------
  |  Branch (362:9): [True: 622, False: 5.52k]
  ------------------
  363|    622|        mont = in_mont;
  364|  5.52k|    else {
  365|  5.52k|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (365:13): [True: 0, False: 5.52k]
  ------------------
  366|      0|            goto err;
  367|  5.52k|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (367:13): [True: 0, False: 5.52k]
  ------------------
  368|      0|            goto err;
  369|  5.52k|    }
  370|       |
  371|  6.14k|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (371:9): [True: 0, False: 6.14k]
  |  Branch (371:19): [True: 0, False: 6.14k]
  ------------------
  372|      0|        if (!BN_nnmod(val[0], a, m, ctx))
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  ------------------
  373|      0|            goto err;
  374|      0|        aa = val[0];
  375|      0|    } else
  376|  6.14k|        aa = a;
  377|  6.14k|    if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
  ------------------
  |  Branch (377:9): [True: 0, False: 6.14k]
  ------------------
  378|      0|        goto err;               /* 1 */
  379|       |
  380|  6.14k|    window = BN_window_bits_for_exponent_size(bits);
  ------------------
  |  |  322|  6.14k|                ((b) > 671 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (322:18): [True: 0, False: 6.14k]
  |  |  ------------------
  |  |  323|  6.14k|                 (b) > 239 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (323:18): [True: 652, False: 5.49k]
  |  |  ------------------
  |  |  324|  6.14k|                 (b) >  79 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (324:18): [True: 4.86k, False: 622]
  |  |  ------------------
  |  |  325|  5.49k|                 (b) >  23 ? 3 : 1)
  |  |  ------------------
  |  |  |  Branch (325:18): [True: 306, False: 316]
  |  |  ------------------
  ------------------
  381|  6.14k|    if (window > 1) {
  ------------------
  |  Branch (381:9): [True: 5.82k, False: 316]
  ------------------
  382|  5.82k|        if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx))
  ------------------
  |  Branch (382:13): [True: 0, False: 5.82k]
  ------------------
  383|      0|            goto err;           /* 2 */
  384|  5.82k|        j = 1 << (window - 1);
  385|  50.6k|        for (i = 1; i < j; i++) {
  ------------------
  |  Branch (385:21): [True: 44.7k, False: 5.82k]
  ------------------
  386|  44.7k|            if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
  ------------------
  |  Branch (386:17): [True: 0, False: 44.7k]
  ------------------
  387|  44.7k|                !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx))
  ------------------
  |  Branch (387:17): [True: 0, False: 44.7k]
  ------------------
  388|      0|                goto err;
  389|  44.7k|        }
  390|  5.82k|    }
  391|       |
  392|  6.14k|    start = 1;                  /* This is used to avoid multiplication etc
  393|       |                                 * when there is only the value '1' in the
  394|       |                                 * buffer. */
  395|  6.14k|    wstart = bits - 1;          /* The top bit of the window */
  396|  6.14k|    wend = 0;                   /* The bottom bit of the window */
  397|       |
  398|  6.14k|#if 1                           /* by Shay Gueron's suggestion */
  399|  6.14k|    j = m->top;                 /* borrow j */
  400|  6.14k|    if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|  6.14k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  6.14k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (400:9): [True: 4.96k, False: 1.17k]
  ------------------
  401|  4.96k|        if (bn_wexpand(r, j) == NULL)
  ------------------
  |  Branch (401:13): [True: 0, False: 4.96k]
  ------------------
  402|      0|            goto err;
  403|       |        /* 2^(top*BN_BITS2) - m */
  404|  4.96k|        r->d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   94|  4.96k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  405|  22.4k|        for (i = 1; i < j; i++)
  ------------------
  |  Branch (405:21): [True: 17.5k, False: 4.96k]
  ------------------
  406|  17.5k|            r->d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   94|  22.4k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  407|  4.96k|        r->top = j;
  408|  4.96k|        r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  4.96k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  409|  4.96k|    } else
  410|  1.17k|#endif
  411|  1.17k|    if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (411:9): [True: 0, False: 1.17k]
  ------------------
  412|      0|        goto err;
  413|   646k|    for (;;) {
  414|   646k|        int wvalue;             /* The 'value' of the window */
  415|       |
  416|   646k|        if (BN_is_bit_set(p, wstart) == 0) {
  ------------------
  |  Branch (416:13): [True: 476k, False: 169k]
  ------------------
  417|   476k|            if (!start) {
  ------------------
  |  Branch (417:17): [True: 476k, False: 0]
  ------------------
  418|   476k|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (418:21): [True: 0, False: 476k]
  ------------------
  419|      0|                    goto err;
  420|   476k|            }
  421|   476k|            if (wstart == 0)
  ------------------
  |  Branch (421:17): [True: 5.92k, False: 470k]
  ------------------
  422|  5.92k|                break;
  423|   470k|            wstart--;
  424|   470k|            continue;
  425|   476k|        }
  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|   169k|        wvalue = 1;
  432|   169k|        wend = 0;
  433|   676k|        for (i = 1; i < window; i++) {
  ------------------
  |  Branch (433:21): [True: 506k, False: 169k]
  ------------------
  434|   506k|            if (wstart - i < 0)
  ------------------
  |  Branch (434:17): [True: 44, False: 506k]
  ------------------
  435|     44|                break;
  436|   506k|            if (BN_is_bit_set(p, wstart - i)) {
  ------------------
  |  Branch (436:17): [True: 494k, False: 11.8k]
  ------------------
  437|   494k|                wvalue <<= (i - wend);
  438|   494k|                wvalue |= 1;
  439|   494k|                wend = i;
  440|   494k|            }
  441|   506k|        }
  442|       |
  443|       |        /* wend is the size of the current window */
  444|   169k|        j = wend + 1;
  445|       |        /* add the 'bytes above' */
  446|   169k|        if (!start)
  ------------------
  |  Branch (446:13): [True: 163k, False: 6.14k]
  ------------------
  447|   804k|            for (i = 0; i < j; i++) {
  ------------------
  |  Branch (447:25): [True: 640k, False: 163k]
  ------------------
  448|   640k|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (448:21): [True: 0, False: 640k]
  ------------------
  449|      0|                    goto err;
  450|   640k|            }
  451|       |
  452|       |        /* wvalue will be an odd number < 2^window */
  453|   169k|        if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx))
  ------------------
  |  Branch (453:13): [True: 0, False: 169k]
  ------------------
  454|      0|            goto err;
  455|       |
  456|       |        /* move the 'window' down further */
  457|   169k|        wstart -= wend + 1;
  458|   169k|        start = 0;
  459|   169k|        if (wstart < 0)
  ------------------
  |  Branch (459:13): [True: 217, False: 169k]
  ------------------
  460|    217|            break;
  461|   169k|    }
  462|       |    /*
  463|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
  464|       |     * removes padding [if any] and makes return value suitable for public
  465|       |     * API consumer.
  466|       |     */
  467|       |#if defined(SPARC_T4_MONT)
  468|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
  469|       |        j = mont->N.top;        /* borrow j */
  470|       |        val[0]->d[0] = 1;       /* borrow val[0] */
  471|       |        for (i = 1; i < j; i++)
  472|       |            val[0]->d[i] = 0;
  473|       |        val[0]->top = j;
  474|       |        if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx))
  475|       |            goto err;
  476|       |    } else
  477|       |#endif
  478|  6.14k|    if (!BN_from_montgomery(rr, r, mont, ctx))
  ------------------
  |  Branch (478:9): [True: 0, False: 6.14k]
  ------------------
  479|      0|        goto err;
  480|  6.14k|    ret = 1;
  481|  6.14k| err:
  482|  6.14k|    if (in_mont == NULL)
  ------------------
  |  Branch (482:9): [True: 5.52k, False: 622]
  ------------------
  483|  5.52k|        BN_MONT_CTX_free(mont);
  484|  6.14k|    BN_CTX_end(ctx);
  485|  6.14k|    bn_check_top(rr);
  486|  6.14k|    return ret;
  487|  6.14k|}
bn_mod_exp_mont_fixed_top:
  612|     64|{
  613|     64|    int i, bits, ret = 0, window, wvalue, wmask, window0;
  614|     64|    int top;
  615|     64|    BN_MONT_CTX *mont = NULL;
  616|       |
  617|     64|    int numPowers;
  618|     64|    unsigned char *powerbufFree = NULL;
  619|     64|    int powerbufLen = 0;
  620|     64|    unsigned char *powerbuf = NULL;
  621|     64|    BIGNUM tmp, am;
  622|       |#if defined(SPARC_T4_MONT)
  623|       |    unsigned int t4 = 0;
  624|       |#endif
  625|       |
  626|     64|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (626:9): [True: 0, False: 64]
  ------------------
  627|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  628|      0|        return 0;
  629|      0|    }
  630|       |
  631|     64|    top = m->top;
  632|       |
  633|     64|    if (top > BN_CONSTTIME_SIZE_LIMIT) {
  ------------------
  |  |   46|     64|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (633:9): [True: 0, False: 64]
  ------------------
  634|       |        /* Prevent overflowing the powerbufLen computation below */
  635|      0|        return BN_mod_exp_mont(rr, a, p, m, ctx, in_mont);
  636|      0|    }
  637|       |
  638|       |    /*
  639|       |     * Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak
  640|       |     * whether the top bits are zero.
  641|       |     */
  642|     64|    bits = p->top * BN_BITS2;
  ------------------
  |  |   54|     64|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  643|     64|    if (bits == 0) {
  ------------------
  |  Branch (643:9): [True: 0, False: 64]
  ------------------
  644|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  645|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (645:13): [True: 0, False: 0]
  ------------------
  646|      0|            ret = 1;
  647|      0|            BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  648|      0|        } else {
  649|      0|            ret = BN_one(rr);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  650|      0|        }
  651|      0|        return ret;
  652|      0|    }
  653|       |
  654|     64|    BN_CTX_start(ctx);
  655|       |
  656|       |    /*
  657|       |     * Allocate a montgomery context if it was not supplied by the caller. If
  658|       |     * this is not done, things will break in the montgomery part.
  659|       |     */
  660|     64|    if (in_mont != NULL)
  ------------------
  |  Branch (660:9): [True: 64, False: 0]
  ------------------
  661|     64|        mont = in_mont;
  662|      0|    else {
  663|      0|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (663:13): [True: 0, False: 0]
  ------------------
  664|      0|            goto err;
  665|      0|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (665:13): [True: 0, False: 0]
  ------------------
  666|      0|            goto err;
  667|      0|    }
  668|       |
  669|     64|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (669:9): [True: 0, False: 64]
  |  Branch (669:19): [True: 0, False: 64]
  ------------------
  670|      0|        BIGNUM *reduced = BN_CTX_get(ctx);
  671|      0|        if (reduced == NULL
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  ------------------
  672|      0|            || !BN_nnmod(reduced, a, m, ctx)) {
  ------------------
  |  Branch (672:16): [True: 0, False: 0]
  ------------------
  673|      0|            goto err;
  674|      0|        }
  675|      0|        a = reduced;
  676|      0|    }
  677|       |
  678|     64|#ifdef RSAZ_ENABLED
  679|       |    /*
  680|       |     * If the size of the operands allow it, perform the optimized
  681|       |     * RSAZ exponentiation. For further information see
  682|       |     * crypto/bn/rsaz_exp.c and accompanying assembly modules.
  683|       |     */
  684|     64|    if ((16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024)
  ------------------
  |  Branch (684:9): [True: 0, False: 64]
  |  Branch (684:27): [True: 0, False: 0]
  |  Branch (684:45): [True: 0, False: 0]
  ------------------
  685|     64|        && rsaz_avx2_eligible()) {
  ------------------
  |  Branch (685:12): [True: 0, False: 0]
  ------------------
  686|      0|        if (NULL == bn_wexpand(rr, 16))
  ------------------
  |  Branch (686:13): [True: 0, False: 0]
  ------------------
  687|      0|            goto err;
  688|      0|        RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d,
  689|      0|                               mont->n0[0]);
  690|      0|        rr->top = 16;
  691|      0|        rr->neg = 0;
  692|      0|        bn_correct_top(rr);
  693|      0|        ret = 1;
  694|      0|        goto err;
  695|     64|    } else if ((8 == a->top) && (8 == p->top) && (BN_num_bits(m) == 512)) {
  ------------------
  |  Branch (695:16): [True: 0, False: 64]
  |  Branch (695:33): [True: 0, False: 0]
  |  Branch (695:50): [True: 0, False: 0]
  ------------------
  696|      0|        if (NULL == bn_wexpand(rr, 8))
  ------------------
  |  Branch (696:13): [True: 0, False: 0]
  ------------------
  697|      0|            goto err;
  698|      0|        RSAZ_512_mod_exp(rr->d, a->d, p->d, m->d, mont->n0[0], mont->RR.d);
  699|      0|        rr->top = 8;
  700|      0|        rr->neg = 0;
  701|      0|        bn_correct_top(rr);
  702|      0|        ret = 1;
  703|      0|        goto err;
  704|      0|    }
  705|     64|#endif
  706|       |
  707|       |    /* Get the window size to use with size of p. */
  708|     64|    window = BN_window_bits_for_ctime_exponent_size(bits);
  ------------------
  |  |  346|     64|                ((b) > 937 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (346:18): [True: 0, False: 64]
  |  |  ------------------
  |  |  347|     64|                 (b) > 306 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (347:18): [True: 64, False: 0]
  |  |  ------------------
  |  |  348|     64|                 (b) >  89 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (348:18): [True: 0, False: 0]
  |  |  ------------------
  |  |  349|      0|                 (b) >  22 ? 3 : 1)
  |  |  ------------------
  |  |  |  Branch (349:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  709|       |#if defined(SPARC_T4_MONT)
  710|       |    if (window >= 5 && (top & 15) == 0 && top <= 64 &&
  711|       |        (OPENSSL_sparcv9cap_P[1] & (CFR_MONTMUL | CFR_MONTSQR)) ==
  712|       |        (CFR_MONTMUL | CFR_MONTSQR) && (t4 = OPENSSL_sparcv9cap_P[0]))
  713|       |        window = 5;
  714|       |    else
  715|       |#endif
  716|     64|#if defined(OPENSSL_BN_ASM_MONT5)
  717|     64|    if (window >= 5 && top <= BN_SOFT_LIMIT) {
  ------------------
  |  |   62|     64|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (717:9): [True: 64, False: 0]
  |  Branch (717:24): [True: 64, False: 0]
  ------------------
  718|     64|        window = 5;             /* ~5% improvement for RSA2048 sign, and even
  719|       |                                 * for RSA4096 */
  720|       |        /* reserve space for mont->N.d[] copy */
  721|     64|        powerbufLen += top * sizeof(mont->N.d[0]);
  722|     64|    }
  723|     64|#endif
  724|     64|    (void)0;
  725|       |
  726|       |    /*
  727|       |     * Allocate a buffer large enough to hold all of the pre-computed powers
  728|       |     * of am, am itself and tmp.
  729|       |     */
  730|     64|    numPowers = 1 << window;
  731|     64|    powerbufLen += sizeof(m->d[0]) * (top * numPowers +
  732|     64|                                      ((2 * top) >
  ------------------
  |  Branch (732:40): [True: 0, False: 64]
  ------------------
  733|     64|                                       numPowers ? (2 * top) : numPowers));
  734|     64|#ifdef alloca
  735|     64|    if (powerbufLen < 3072)
  ------------------
  |  Branch (735:9): [True: 64, False: 0]
  ------------------
  736|     64|        powerbufFree =
  737|     64|            alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH);
  738|      0|    else
  739|      0|#endif
  740|      0|        if ((powerbufFree =
  ------------------
  |  Branch (740:13): [True: 0, False: 0]
  ------------------
  741|      0|             OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH))
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  742|      0|            == NULL)
  743|      0|        goto err;
  744|       |
  745|     64|    powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
  ------------------
  |  |  600|     64|        ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  |  |  ------------------
  |  |  |  |  331|     64|# 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|     64|# define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK       (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  331|     64|# define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH      ( 64 )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|     64|    memset(powerbuf, 0, powerbufLen);
  747|       |
  748|     64|#ifdef alloca
  749|     64|    if (powerbufLen < 3072)
  ------------------
  |  Branch (749:9): [True: 64, False: 0]
  ------------------
  750|     64|        powerbufFree = NULL;
  751|     64|#endif
  752|       |
  753|       |    /* lay down tmp and am right after powers table */
  754|     64|    tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers);
  755|     64|    am.d = tmp.d + top;
  756|     64|    tmp.top = am.top = 0;
  757|     64|    tmp.dmax = am.dmax = top;
  758|     64|    tmp.neg = am.neg = 0;
  759|     64|    tmp.flags = am.flags = BN_FLG_STATIC_DATA;
  ------------------
  |  |   59|     64|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  760|       |
  761|       |    /* prepare a^0 in Montgomery domain */
  762|     64|#if 1                           /* by Shay Gueron's suggestion */
  763|     64|    if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|     64|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (763:9): [True: 0, False: 64]
  ------------------
  764|       |        /* 2^(top*BN_BITS2) - m */
  765|      0|        tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  766|      0|        for (i = 1; i < top; i++)
  ------------------
  |  Branch (766:21): [True: 0, False: 0]
  ------------------
  767|      0|            tmp.d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  768|      0|        tmp.top = top;
  769|      0|    } else
  770|     64|#endif
  771|     64|    if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (771:9): [True: 0, False: 64]
  ------------------
  772|      0|        goto err;
  773|       |
  774|       |    /* prepare a^1 in Montgomery domain */
  775|     64|    if (!bn_to_mont_fixed_top(&am, a, mont, ctx))
  ------------------
  |  Branch (775:9): [True: 0, False: 64]
  ------------------
  776|      0|        goto err;
  777|       |
  778|     64|    if (top > BN_SOFT_LIMIT)
  ------------------
  |  |   62|     64|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (778:9): [True: 0, False: 64]
  ------------------
  779|      0|        goto fallback;
  780|       |
  781|       |#if defined(SPARC_T4_MONT)
  782|       |    if (t4) {
  783|       |        typedef int (*bn_pwr5_mont_f) (BN_ULONG *tp, const BN_ULONG *np,
  784|       |                                       const BN_ULONG *n0, const void *table,
  785|       |                                       int power, int bits);
  786|       |        int bn_pwr5_mont_t4_8(BN_ULONG *tp, const BN_ULONG *np,
  787|       |                              const BN_ULONG *n0, const void *table,
  788|       |                              int power, int bits);
  789|       |        int bn_pwr5_mont_t4_16(BN_ULONG *tp, const BN_ULONG *np,
  790|       |                               const BN_ULONG *n0, const void *table,
  791|       |                               int power, int bits);
  792|       |        int bn_pwr5_mont_t4_24(BN_ULONG *tp, const BN_ULONG *np,
  793|       |                               const BN_ULONG *n0, const void *table,
  794|       |                               int power, int bits);
  795|       |        int bn_pwr5_mont_t4_32(BN_ULONG *tp, const BN_ULONG *np,
  796|       |                               const BN_ULONG *n0, const void *table,
  797|       |                               int power, int bits);
  798|       |        static const bn_pwr5_mont_f pwr5_funcs[4] = {
  799|       |            bn_pwr5_mont_t4_8, bn_pwr5_mont_t4_16,
  800|       |            bn_pwr5_mont_t4_24, bn_pwr5_mont_t4_32
  801|       |        };
  802|       |        bn_pwr5_mont_f pwr5_worker = pwr5_funcs[top / 16 - 1];
  803|       |
  804|       |        typedef int (*bn_mul_mont_f) (BN_ULONG *rp, const BN_ULONG *ap,
  805|       |                                      const void *bp, const BN_ULONG *np,
  806|       |                                      const BN_ULONG *n0);
  807|       |        int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const void *bp,
  808|       |                             const BN_ULONG *np, const BN_ULONG *n0);
  809|       |        int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap,
  810|       |                              const void *bp, const BN_ULONG *np,
  811|       |                              const BN_ULONG *n0);
  812|       |        int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap,
  813|       |                              const void *bp, const BN_ULONG *np,
  814|       |                              const BN_ULONG *n0);
  815|       |        int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap,
  816|       |                              const void *bp, const BN_ULONG *np,
  817|       |                              const BN_ULONG *n0);
  818|       |        static const bn_mul_mont_f mul_funcs[4] = {
  819|       |            bn_mul_mont_t4_8, bn_mul_mont_t4_16,
  820|       |            bn_mul_mont_t4_24, bn_mul_mont_t4_32
  821|       |        };
  822|       |        bn_mul_mont_f mul_worker = mul_funcs[top / 16 - 1];
  823|       |
  824|       |        void bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap,
  825|       |                              const void *bp, const BN_ULONG *np,
  826|       |                              const BN_ULONG *n0, int num);
  827|       |        void bn_mul_mont_t4(BN_ULONG *rp, const BN_ULONG *ap,
  828|       |                            const void *bp, const BN_ULONG *np,
  829|       |                            const BN_ULONG *n0, int num);
  830|       |        void bn_mul_mont_gather5_t4(BN_ULONG *rp, const BN_ULONG *ap,
  831|       |                                    const void *table, const BN_ULONG *np,
  832|       |                                    const BN_ULONG *n0, int num, int power);
  833|       |        void bn_flip_n_scatter5_t4(const BN_ULONG *inp, size_t num,
  834|       |                                   void *table, size_t power);
  835|       |        void bn_gather5_t4(BN_ULONG *out, size_t num,
  836|       |                           void *table, size_t power);
  837|       |        void bn_flip_t4(BN_ULONG *dst, BN_ULONG *src, size_t num);
  838|       |
  839|       |        BN_ULONG *np = mont->N.d, *n0 = mont->n0;
  840|       |        int stride = 5 * (6 - (top / 16 - 1)); /* multiple of 5, but less
  841|       |                                                * than 32 */
  842|       |
  843|       |        /*
  844|       |         * BN_to_montgomery can contaminate words above .top [in
  845|       |         * BN_DEBUG build...
  846|       |         */
  847|       |        for (i = am.top; i < top; i++)
  848|       |            am.d[i] = 0;
  849|       |        for (i = tmp.top; i < top; i++)
  850|       |            tmp.d[i] = 0;
  851|       |
  852|       |        bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 0);
  853|       |        bn_flip_n_scatter5_t4(am.d, top, powerbuf, 1);
  854|       |        if (!(*mul_worker) (tmp.d, am.d, am.d, np, n0) &&
  855|       |            !(*mul_worker) (tmp.d, am.d, am.d, np, n0))
  856|       |            bn_mul_mont_vis3(tmp.d, am.d, am.d, np, n0, top);
  857|       |        bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 2);
  858|       |
  859|       |        for (i = 3; i < 32; i++) {
  860|       |            /* Calculate a^i = a^(i-1) * a */
  861|       |            if (!(*mul_worker) (tmp.d, tmp.d, am.d, np, n0) &&
  862|       |                !(*mul_worker) (tmp.d, tmp.d, am.d, np, n0))
  863|       |                bn_mul_mont_vis3(tmp.d, tmp.d, am.d, np, n0, top);
  864|       |            bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, i);
  865|       |        }
  866|       |
  867|       |        /* switch to 64-bit domain */
  868|       |        np = alloca(top * sizeof(BN_ULONG));
  869|       |        top /= 2;
  870|       |        bn_flip_t4(np, mont->N.d, top);
  871|       |
  872|       |        /*
  873|       |         * The exponent may not have a whole number of fixed-size windows.
  874|       |         * To simplify the main loop, the initial window has between 1 and
  875|       |         * full-window-size bits such that what remains is always a whole
  876|       |         * number of windows
  877|       |         */
  878|       |        window0 = (bits - 1) % 5 + 1;
  879|       |        wmask = (1 << window0) - 1;
  880|       |        bits -= window0;
  881|       |        wvalue = bn_get_bits(p, bits) & wmask;
  882|       |        bn_gather5_t4(tmp.d, top, powerbuf, wvalue);
  883|       |
  884|       |        /*
  885|       |         * Scan the exponent one window at a time starting from the most
  886|       |         * significant bits.
  887|       |         */
  888|       |        while (bits > 0) {
  889|       |            if (bits < stride)
  890|       |                stride = bits;
  891|       |            bits -= stride;
  892|       |            wvalue = bn_get_bits(p, bits);
  893|       |
  894|       |            if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
  895|       |                continue;
  896|       |            /* retry once and fall back */
  897|       |            if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
  898|       |                continue;
  899|       |
  900|       |            bits += stride - 5;
  901|       |            wvalue >>= stride - 5;
  902|       |            wvalue &= 31;
  903|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  904|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  905|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  906|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  907|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  908|       |            bn_mul_mont_gather5_t4(tmp.d, tmp.d, powerbuf, np, n0, top,
  909|       |                                   wvalue);
  910|       |        }
  911|       |
  912|       |        bn_flip_t4(tmp.d, tmp.d, top);
  913|       |        top *= 2;
  914|       |        /* back to 32-bit domain */
  915|       |        tmp.top = top;
  916|       |        bn_correct_top(&tmp);
  917|       |        OPENSSL_cleanse(np, top * sizeof(BN_ULONG));
  918|       |    } else
  919|       |#endif
  920|     64|#if defined(OPENSSL_BN_ASM_MONT5)
  921|     64|    if (window == 5 && top > 1) {
  ------------------
  |  Branch (921:9): [True: 64, False: 0]
  |  Branch (921:24): [True: 64, False: 0]
  ------------------
  922|       |        /*
  923|       |         * This optimization uses ideas from https://eprint.iacr.org/2011/239,
  924|       |         * specifically optimization of cache-timing attack countermeasures,
  925|       |         * pre-computation optimization, and Almost Montgomery Multiplication.
  926|       |         *
  927|       |         * The paper discusses a 4-bit window to optimize 512-bit modular
  928|       |         * exponentiation, used in RSA-1024 with CRT, but RSA-1024 is no longer
  929|       |         * important.
  930|       |         *
  931|       |         * |bn_mul_mont_gather5| and |bn_power5| implement the "almost"
  932|       |         * reduction variant, so the values here may not be fully reduced.
  933|       |         * They are bounded by R (i.e. they fit in |top| words), not |m|.
  934|       |         * Additionally, we pass these "almost" reduced inputs into
  935|       |         * |bn_mul_mont|, which implements the normal reduction variant.
  936|       |         * Given those inputs, |bn_mul_mont| may not give reduced
  937|       |         * output, but it will still produce "almost" reduced output.
  938|       |         */
  939|     64|        void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
  940|     64|                                 const void *table, const BN_ULONG *np,
  941|     64|                                 const BN_ULONG *n0, int num, int power);
  942|     64|        void bn_scatter5(const BN_ULONG *inp, size_t num,
  943|     64|                         void *table, size_t power);
  944|     64|        void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
  945|     64|        void bn_power5(BN_ULONG *rp, const BN_ULONG *ap,
  946|     64|                       const void *table, const BN_ULONG *np,
  947|     64|                       const BN_ULONG *n0, int num, int power);
  948|     64|        int bn_get_bits5(const BN_ULONG *ap, int off);
  949|       |
  950|     64|        BN_ULONG *n0 = mont->n0, *np;
  ------------------
  |  |   37|     64|#  define BN_ULONG        unsigned long
  ------------------
  951|       |
  952|       |        /*
  953|       |         * BN_to_montgomery can contaminate words above .top [in
  954|       |         * BN_DEBUG build...
  955|       |         */
  956|     64|        for (i = am.top; i < top; i++)
  ------------------
  |  Branch (956:26): [True: 0, False: 64]
  ------------------
  957|      0|            am.d[i] = 0;
  958|     64|        for (i = tmp.top; i < top; i++)
  ------------------
  |  Branch (958:27): [True: 0, False: 64]
  ------------------
  959|      0|            tmp.d[i] = 0;
  960|       |
  961|       |        /*
  962|       |         * copy mont->N.d[] to improve cache locality
  963|       |         */
  964|    448|        for (np = am.d + top, i = 0; i < top; i++)
  ------------------
  |  Branch (964:38): [True: 384, False: 64]
  ------------------
  965|    384|            np[i] = mont->N.d[i];
  966|       |
  967|     64|        bn_scatter5(tmp.d, top, powerbuf, 0);
  968|     64|        bn_scatter5(am.d, am.top, powerbuf, 1);
  969|     64|        bn_mul_mont(tmp.d, am.d, am.d, np, n0, top);
  970|     64|        bn_scatter5(tmp.d, top, powerbuf, 2);
  971|       |
  972|       |# if 0
  973|       |        for (i = 3; i < 32; i++) {
  974|       |            /* Calculate a^i = a^(i-1) * a */
  975|       |            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  976|       |            bn_scatter5(tmp.d, top, powerbuf, i);
  977|       |        }
  978|       |# else
  979|       |        /* same as above, but uses squaring for 1/2 of operations */
  980|    256|        for (i = 4; i < 32; i *= 2) {
  ------------------
  |  Branch (980:21): [True: 192, False: 64]
  ------------------
  981|    192|            bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  982|    192|            bn_scatter5(tmp.d, top, powerbuf, i);
  983|    192|        }
  984|    256|        for (i = 3; i < 8; i += 2) {
  ------------------
  |  Branch (984:21): [True: 192, False: 64]
  ------------------
  985|    192|            int j;
  986|    192|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  987|    192|            bn_scatter5(tmp.d, top, powerbuf, i);
  988|    640|            for (j = 2 * i; j < 32; j *= 2) {
  ------------------
  |  Branch (988:29): [True: 448, False: 192]
  ------------------
  989|    448|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  990|    448|                bn_scatter5(tmp.d, top, powerbuf, j);
  991|    448|            }
  992|    192|        }
  993|    320|        for (; i < 16; i += 2) {
  ------------------
  |  Branch (993:16): [True: 256, False: 64]
  ------------------
  994|    256|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  995|    256|            bn_scatter5(tmp.d, top, powerbuf, i);
  996|    256|            bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  997|    256|            bn_scatter5(tmp.d, top, powerbuf, 2 * i);
  998|    256|        }
  999|    576|        for (; i < 32; i += 2) {
  ------------------
  |  Branch (999:16): [True: 512, False: 64]
  ------------------
 1000|    512|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
 1001|    512|            bn_scatter5(tmp.d, top, powerbuf, i);
 1002|    512|        }
 1003|     64|# endif
 1004|       |        /*
 1005|       |         * The exponent may not have a whole number of fixed-size windows.
 1006|       |         * To simplify the main loop, the initial window has between 1 and
 1007|       |         * full-window-size bits such that what remains is always a whole
 1008|       |         * number of windows
 1009|       |         */
 1010|     64|        window0 = (bits - 1) % 5 + 1;
 1011|     64|        wmask = (1 << window0) - 1;
 1012|     64|        bits -= window0;
 1013|     64|        wvalue = bn_get_bits(p, bits) & wmask;
 1014|     64|        bn_gather5(tmp.d, top, powerbuf, wvalue);
 1015|       |
 1016|       |        /*
 1017|       |         * Scan the exponent one window at a time starting from the most
 1018|       |         * significant bits.
 1019|       |         */
 1020|     64|        if (top & 7) {
  ------------------
  |  Branch (1020:13): [True: 64, False: 0]
  ------------------
 1021|  4.92k|            while (bits > 0) {
  ------------------
  |  Branch (1021:20): [True: 4.86k, False: 64]
  ------------------
 1022|  4.86k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1023|  4.86k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1024|  4.86k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1025|  4.86k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1026|  4.86k|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1027|  4.86k|                bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top,
 1028|  4.86k|                                    bn_get_bits5(p->d, bits -= 5));
 1029|  4.86k|            }
 1030|     64|        } else {
 1031|      0|            while (bits > 0) {
  ------------------
  |  Branch (1031:20): [True: 0, False: 0]
  ------------------
 1032|      0|                bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top,
 1033|      0|                          bn_get_bits5(p->d, bits -= 5));
 1034|      0|            }
 1035|      0|        }
 1036|       |
 1037|     64|        tmp.top = top;
 1038|       |        /*
 1039|       |         * The result is now in |tmp| in Montgomery form, but it may not be
 1040|       |         * fully reduced. This is within bounds for |BN_from_montgomery|
 1041|       |         * (tmp < R <= m*R) so it will, when converting from Montgomery form,
 1042|       |         * produce a fully reduced result.
 1043|       |         *
 1044|       |         * This differs from Figure 2 of the paper, which uses AMM(h, 1) to
 1045|       |         * convert from Montgomery form with unreduced output, followed by an
 1046|       |         * extra reduction step. In the paper's terminology, we replace
 1047|       |         * steps 9 and 10 with MM(h, 1).
 1048|       |         */
 1049|     64|    } else
 1050|      0|#endif
 1051|      0|    {
 1052|      0| fallback:
 1053|      0|        if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window))
  ------------------
  |  Branch (1053:13): [True: 0, False: 0]
  ------------------
 1054|      0|            goto err;
 1055|      0|        if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window))
  ------------------
  |  Branch (1055:13): [True: 0, False: 0]
  ------------------
 1056|      0|            goto err;
 1057|       |
 1058|       |        /*
 1059|       |         * If the window size is greater than 1, then calculate
 1060|       |         * val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) (even
 1061|       |         * powers could instead be computed as (a^(i/2))^2 to use the slight
 1062|       |         * performance advantage of sqr over mul).
 1063|       |         */
 1064|      0|        if (window > 1) {
  ------------------
  |  Branch (1064:13): [True: 0, False: 0]
  ------------------
 1065|      0|            if (!bn_mul_mont_fixed_top(&tmp, &am, &am, mont, ctx))
  ------------------
  |  Branch (1065:17): [True: 0, False: 0]
  ------------------
 1066|      0|                goto err;
 1067|      0|            if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2,
  ------------------
  |  Branch (1067:17): [True: 0, False: 0]
  ------------------
 1068|      0|                                              window))
 1069|      0|                goto err;
 1070|      0|            for (i = 3; i < numPowers; i++) {
  ------------------
  |  Branch (1070:25): [True: 0, False: 0]
  ------------------
 1071|       |                /* Calculate a^i = a^(i-1) * a */
 1072|      0|                if (!bn_mul_mont_fixed_top(&tmp, &am, &tmp, mont, ctx))
  ------------------
  |  Branch (1072:21): [True: 0, False: 0]
  ------------------
 1073|      0|                    goto err;
 1074|      0|                if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i,
  ------------------
  |  Branch (1074:21): [True: 0, False: 0]
  ------------------
 1075|      0|                                                  window))
 1076|      0|                    goto err;
 1077|      0|            }
 1078|      0|        }
 1079|       |
 1080|       |        /*
 1081|       |         * The exponent may not have a whole number of fixed-size windows.
 1082|       |         * To simplify the main loop, the initial window has between 1 and
 1083|       |         * full-window-size bits such that what remains is always a whole
 1084|       |         * number of windows
 1085|       |         */
 1086|      0|        window0 = (bits - 1) % window + 1;
 1087|      0|        wmask = (1 << window0) - 1;
 1088|      0|        bits -= window0;
 1089|      0|        wvalue = bn_get_bits(p, bits) & wmask;
 1090|      0|        if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
  ------------------
  |  Branch (1090:13): [True: 0, False: 0]
  ------------------
 1091|      0|                                            window))
 1092|      0|            goto err;
 1093|       |
 1094|      0|        wmask = (1 << window) - 1;
 1095|       |        /*
 1096|       |         * Scan the exponent one window at a time starting from the most
 1097|       |         * significant bits.
 1098|       |         */
 1099|      0|        while (bits > 0) {
  ------------------
  |  Branch (1099:16): [True: 0, False: 0]
  ------------------
 1100|       |
 1101|       |            /* Square the result window-size times */
 1102|      0|            for (i = 0; i < window; i++)
  ------------------
  |  Branch (1102:25): [True: 0, False: 0]
  ------------------
 1103|      0|                if (!bn_mul_mont_fixed_top(&tmp, &tmp, &tmp, mont, ctx))
  ------------------
  |  Branch (1103:21): [True: 0, False: 0]
  ------------------
 1104|      0|                    goto err;
 1105|       |
 1106|       |            /*
 1107|       |             * Get a window's worth of bits from the exponent
 1108|       |             * This avoids calling BN_is_bit_set for each bit, which
 1109|       |             * is not only slower but also makes each bit vulnerable to
 1110|       |             * EM (and likely other) side-channel attacks like One&Done
 1111|       |             * (for details see "One&Done: A Single-Decryption EM-Based
 1112|       |             *  Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam,
 1113|       |             *  H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and
 1114|       |             *  M. Prvulovic, in USENIX Security'18)
 1115|       |             */
 1116|      0|            bits -= window;
 1117|      0|            wvalue = bn_get_bits(p, bits) & wmask;
 1118|       |            /*
 1119|       |             * Fetch the appropriate pre-computed value from the pre-buf
 1120|       |             */
 1121|      0|            if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue,
  ------------------
  |  Branch (1121:17): [True: 0, False: 0]
  ------------------
 1122|      0|                                                window))
 1123|      0|                goto err;
 1124|       |
 1125|       |            /* Multiply the result into the intermediate result */
 1126|      0|            if (!bn_mul_mont_fixed_top(&tmp, &tmp, &am, mont, ctx))
  ------------------
  |  Branch (1126:17): [True: 0, False: 0]
  ------------------
 1127|      0|                goto err;
 1128|      0|        }
 1129|      0|    }
 1130|       |
 1131|       |    /*
 1132|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
 1133|       |     * removes padding [if any] and makes return value suitable for public
 1134|       |     * API consumer.
 1135|       |     */
 1136|       |#if defined(SPARC_T4_MONT)
 1137|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
 1138|       |        am.d[0] = 1;            /* borrow am */
 1139|       |        for (i = 1; i < top; i++)
 1140|       |            am.d[i] = 0;
 1141|       |        if (!BN_mod_mul_montgomery(rr, &tmp, &am, mont, ctx))
 1142|       |            goto err;
 1143|       |    } else
 1144|       |#endif
 1145|     64|    if (!bn_from_mont_fixed_top(rr, &tmp, mont, ctx))
  ------------------
  |  Branch (1145:9): [True: 0, False: 64]
  ------------------
 1146|      0|        goto err;
 1147|     64|    ret = 1;
 1148|     64| err:
 1149|     64|    if (in_mont == NULL)
  ------------------
  |  Branch (1149:9): [True: 0, False: 64]
  ------------------
 1150|      0|        BN_MONT_CTX_free(mont);
 1151|     64|    if (powerbuf != NULL) {
  ------------------
  |  Branch (1151:9): [True: 64, False: 0]
  ------------------
 1152|     64|        OPENSSL_cleanse(powerbuf, powerbufLen);
 1153|     64|        OPENSSL_free(powerbufFree);
  ------------------
  |  |  115|     64|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     64|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     64|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1154|     64|    }
 1155|     64|    BN_CTX_end(ctx);
 1156|     64|    return ret;
 1157|     64|}
bn_exp.c:bn_get_bits:
  490|     64|{
  491|     64|    BN_ULONG ret = 0;
  ------------------
  |  |   37|     64|#  define BN_ULONG        unsigned long
  ------------------
  492|     64|    int wordpos;
  493|       |
  494|     64|    wordpos = bitpos / BN_BITS2;
  ------------------
  |  |   54|     64|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  495|     64|    bitpos %= BN_BITS2;
  ------------------
  |  |   54|     64|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     64|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  496|     64|    if (wordpos >= 0 && wordpos < a->top) {
  ------------------
  |  Branch (496:9): [True: 64, False: 0]
  |  Branch (496:25): [True: 64, False: 0]
  ------------------
  497|     64|        ret = a->d[wordpos] & BN_MASK2;
  ------------------
  |  |   94|     64|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  498|     64|        if (bitpos) {
  ------------------
  |  Branch (498:13): [True: 64, False: 0]
  ------------------
  499|     64|            ret >>= bitpos;
  500|     64|            if (++wordpos < a->top)
  ------------------
  |  Branch (500:17): [True: 0, False: 64]
  ------------------
  501|      0|                ret |= a->d[wordpos] << (BN_BITS2 - bitpos);
  ------------------
  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  502|     64|        }
  503|     64|    }
  504|       |
  505|     64|    return ret & BN_MASK2;
  ------------------
  |  |   94|     64|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  506|     64|}

int_bn_mod_inverse:
  201|  40.5k|{
  202|  40.5k|    BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL;
  203|  40.5k|    BIGNUM *ret = NULL;
  204|  40.5k|    int sign;
  205|       |
  206|       |    /* This is invalid input so we don't worry about constant time here */
  207|  40.5k|    if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
  ------------------
  |  Branch (207:9): [True: 0, False: 40.5k]
  |  Branch (207:33): [True: 3, False: 40.5k]
  ------------------
  208|      3|        *pnoinv = 1;
  209|      3|        return NULL;
  210|      3|    }
  211|       |
  212|  40.5k|    *pnoinv = 0;
  213|       |
  214|  40.5k|    if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  40.5k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (214:9): [True: 0, False: 40.5k]
  ------------------
  215|  40.5k|        || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|  40.5k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (215:12): [True: 0, False: 40.5k]
  ------------------
  216|      0|        return bn_mod_inverse_no_branch(in, a, n, ctx, pnoinv);
  217|      0|    }
  218|       |
  219|  40.5k|    bn_check_top(a);
  220|  40.5k|    bn_check_top(n);
  221|       |
  222|  40.5k|    BN_CTX_start(ctx);
  223|  40.5k|    A = BN_CTX_get(ctx);
  224|  40.5k|    B = BN_CTX_get(ctx);
  225|  40.5k|    X = BN_CTX_get(ctx);
  226|  40.5k|    D = BN_CTX_get(ctx);
  227|  40.5k|    M = BN_CTX_get(ctx);
  228|  40.5k|    Y = BN_CTX_get(ctx);
  229|  40.5k|    T = BN_CTX_get(ctx);
  230|  40.5k|    if (T == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 40.5k]
  ------------------
  231|      0|        goto err;
  232|       |
  233|  40.5k|    if (in == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 40.5k]
  ------------------
  234|      0|        R = BN_new();
  235|  40.5k|    else
  236|  40.5k|        R = in;
  237|  40.5k|    if (R == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 40.5k]
  ------------------
  238|      0|        goto err;
  239|       |
  240|  40.5k|    if (!BN_one(X))
  ------------------
  |  |  197|  40.5k|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (240:9): [True: 0, False: 40.5k]
  ------------------
  241|      0|        goto err;
  242|  40.5k|    BN_zero(Y);
  ------------------
  |  |  202|  40.5k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  243|  40.5k|    if (BN_copy(B, a) == NULL)
  ------------------
  |  Branch (243:9): [True: 0, False: 40.5k]
  ------------------
  244|      0|        goto err;
  245|  40.5k|    if (BN_copy(A, n) == NULL)
  ------------------
  |  Branch (245:9): [True: 0, False: 40.5k]
  ------------------
  246|      0|        goto err;
  247|  40.5k|    A->neg = 0;
  248|  40.5k|    if (B->neg || (BN_ucmp(B, A) >= 0)) {
  ------------------
  |  Branch (248:9): [True: 0, False: 40.5k]
  |  Branch (248:19): [True: 40.5k, False: 0]
  ------------------
  249|  40.5k|        if (!BN_nnmod(B, B, A, ctx))
  ------------------
  |  Branch (249:13): [True: 0, False: 40.5k]
  ------------------
  250|      0|            goto err;
  251|  40.5k|    }
  252|  40.5k|    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|  40.5k|    if (BN_is_odd(n) && (BN_num_bits(n) <= 2048)) {
  ------------------
  |  Branch (261:9): [True: 40.4k, False: 116]
  |  Branch (261:25): [True: 40.4k, False: 0]
  ------------------
  262|       |        /*
  263|       |         * Binary inversion algorithm; requires odd modulus. This is faster
  264|       |         * than the general algorithm if the modulus is sufficiently small
  265|       |         * (about 400 .. 500 bits on 32-bit systems, but much more on 64-bit
  266|       |         * systems)
  267|       |         */
  268|  40.4k|        int shift;
  269|       |
  270|  2.56M|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (270:16): [True: 2.52M, False: 40.4k]
  ------------------
  271|       |            /*-
  272|       |             *      0 < B < |n|,
  273|       |             *      0 < A <= |n|,
  274|       |             * (1) -sign*X*a  ==  B   (mod |n|),
  275|       |             * (2)  sign*Y*a  ==  A   (mod |n|)
  276|       |             */
  277|       |
  278|       |            /*
  279|       |             * Now divide B by the maximum possible power of two in the
  280|       |             * integers, and divide X by the same value mod |n|. When we're
  281|       |             * done, (1) still holds.
  282|       |             */
  283|  2.52M|            shift = 0;
  284|  3.44M|            while (!BN_is_bit_set(B, shift)) { /* note that 0 < B */
  ------------------
  |  Branch (284:20): [True: 916k, False: 2.52M]
  ------------------
  285|   916k|                shift++;
  286|       |
  287|   916k|                if (BN_is_odd(X)) {
  ------------------
  |  Branch (287:21): [True: 468k, False: 447k]
  ------------------
  288|   468k|                    if (!BN_uadd(X, X, n))
  ------------------
  |  Branch (288:25): [True: 0, False: 468k]
  ------------------
  289|      0|                        goto err;
  290|   468k|                }
  291|       |                /*
  292|       |                 * now X is even, so we can easily divide it by two
  293|       |                 */
  294|   916k|                if (!BN_rshift1(X, X))
  ------------------
  |  Branch (294:21): [True: 0, False: 916k]
  ------------------
  295|      0|                    goto err;
  296|   916k|            }
  297|  2.52M|            if (shift > 0) {
  ------------------
  |  Branch (297:17): [True: 877k, False: 1.64M]
  ------------------
  298|   877k|                if (!BN_rshift(B, B, shift))
  ------------------
  |  Branch (298:21): [True: 0, False: 877k]
  ------------------
  299|      0|                    goto err;
  300|   877k|            }
  301|       |
  302|       |            /*
  303|       |             * Same for A and Y.  Afterwards, (2) still holds.
  304|       |             */
  305|  2.52M|            shift = 0;
  306|  4.15M|            while (!BN_is_bit_set(A, shift)) { /* note that 0 < A */
  ------------------
  |  Branch (306:20): [True: 1.62M, False: 2.52M]
  ------------------
  307|  1.62M|                shift++;
  308|       |
  309|  1.62M|                if (BN_is_odd(Y)) {
  ------------------
  |  Branch (309:21): [True: 1.15M, False: 469k]
  ------------------
  310|  1.15M|                    if (!BN_uadd(Y, Y, n))
  ------------------
  |  Branch (310:25): [True: 0, False: 1.15M]
  ------------------
  311|      0|                        goto err;
  312|  1.15M|                }
  313|       |                /* now Y is even */
  314|  1.62M|                if (!BN_rshift1(Y, Y))
  ------------------
  |  Branch (314:21): [True: 0, False: 1.62M]
  ------------------
  315|      0|                    goto err;
  316|  1.62M|            }
  317|  2.52M|            if (shift > 0) {
  ------------------
  |  Branch (317:17): [True: 1.61M, False: 910k]
  ------------------
  318|  1.61M|                if (!BN_rshift(A, A, shift))
  ------------------
  |  Branch (318:21): [True: 0, False: 1.61M]
  ------------------
  319|      0|                    goto err;
  320|  1.61M|            }
  321|       |
  322|       |            /*-
  323|       |             * We still have (1) and (2).
  324|       |             * Both  A  and  B  are odd.
  325|       |             * The following computations ensure that
  326|       |             *
  327|       |             *     0 <= B < |n|,
  328|       |             *      0 < A < |n|,
  329|       |             * (1) -sign*X*a  ==  B   (mod |n|),
  330|       |             * (2)  sign*Y*a  ==  A   (mod |n|),
  331|       |             *
  332|       |             * and that either  A  or  B  is even in the next iteration.
  333|       |             */
  334|  2.52M|            if (BN_ucmp(B, A) >= 0) {
  ------------------
  |  Branch (334:17): [True: 910k, False: 1.61M]
  ------------------
  335|       |                /* -sign*(X + Y)*a == B - A  (mod |n|) */
  336|   910k|                if (!BN_uadd(X, X, Y))
  ------------------
  |  Branch (336:21): [True: 0, False: 910k]
  ------------------
  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|   910k|                if (!BN_usub(B, B, A))
  ------------------
  |  Branch (342:21): [True: 0, False: 910k]
  ------------------
  343|      0|                    goto err;
  344|  1.61M|            } else {
  345|       |                /*  sign*(X + Y)*a == A - B  (mod |n|) */
  346|  1.61M|                if (!BN_uadd(Y, Y, X))
  ------------------
  |  Branch (346:21): [True: 0, False: 1.61M]
  ------------------
  347|      0|                    goto err;
  348|       |                /*
  349|       |                 * as above, BN_mod_add_quick(Y, Y, X, n) would slow things down
  350|       |                 */
  351|  1.61M|                if (!BN_usub(A, A, B))
  ------------------
  |  Branch (351:21): [True: 0, False: 1.61M]
  ------------------
  352|      0|                    goto err;
  353|  1.61M|            }
  354|  2.52M|        }
  355|  40.4k|    } else {
  356|       |        /* general inversion algorithm */
  357|       |
  358|  2.34k|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (358:16): [True: 2.22k, False: 116]
  ------------------
  359|  2.22k|            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|  2.22k|            if (BN_num_bits(A) == BN_num_bits(B)) {
  ------------------
  |  Branch (368:17): [True: 422, False: 1.80k]
  ------------------
  369|    422|                if (!BN_one(D))
  ------------------
  |  |  197|    422|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (369:21): [True: 0, False: 422]
  ------------------
  370|      0|                    goto err;
  371|    422|                if (!BN_sub(M, A, B))
  ------------------
  |  Branch (371:21): [True: 0, False: 422]
  ------------------
  372|      0|                    goto err;
  373|  1.80k|            } else if (BN_num_bits(A) == BN_num_bits(B) + 1) {
  ------------------
  |  Branch (373:24): [True: 859, False: 945]
  ------------------
  374|       |                /* A/B is 1, 2, or 3 */
  375|    859|                if (!BN_lshift1(T, B))
  ------------------
  |  Branch (375:21): [True: 0, False: 859]
  ------------------
  376|      0|                    goto err;
  377|    859|                if (BN_ucmp(A, T) < 0) {
  ------------------
  |  Branch (377:21): [True: 425, False: 434]
  ------------------
  378|       |                    /* A < 2*B, so D=1 */
  379|    425|                    if (!BN_one(D))
  ------------------
  |  |  197|    425|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (379:25): [True: 0, False: 425]
  ------------------
  380|      0|                        goto err;
  381|    425|                    if (!BN_sub(M, A, B))
  ------------------
  |  Branch (381:25): [True: 0, False: 425]
  ------------------
  382|      0|                        goto err;
  383|    434|                } else {
  384|       |                    /* A >= 2*B, so D=2 or D=3 */
  385|    434|                    if (!BN_sub(M, A, T))
  ------------------
  |  Branch (385:25): [True: 0, False: 434]
  ------------------
  386|      0|                        goto err;
  387|    434|                    if (!BN_add(D, T, B))
  ------------------
  |  Branch (387:25): [True: 0, False: 434]
  ------------------
  388|      0|                        goto err; /* use D (:= 3*B) as temp */
  389|    434|                    if (BN_ucmp(A, D) < 0) {
  ------------------
  |  Branch (389:25): [True: 335, False: 99]
  ------------------
  390|       |                        /* A < 3*B, so D=2 */
  391|    335|                        if (!BN_set_word(D, 2))
  ------------------
  |  Branch (391:29): [True: 0, False: 335]
  ------------------
  392|      0|                            goto err;
  393|       |                        /*
  394|       |                         * M (= A - 2*B) already has the correct value
  395|       |                         */
  396|    335|                    } else {
  397|       |                        /* only D=3 remains */
  398|     99|                        if (!BN_set_word(D, 3))
  ------------------
  |  Branch (398:29): [True: 0, False: 99]
  ------------------
  399|      0|                            goto err;
  400|       |                        /*
  401|       |                         * currently M = A - 2*B, but we need M = A - 3*B
  402|       |                         */
  403|     99|                        if (!BN_sub(M, M, B))
  ------------------
  |  Branch (403:29): [True: 0, False: 99]
  ------------------
  404|      0|                            goto err;
  405|     99|                    }
  406|    434|                }
  407|    945|            } else {
  408|    945|                if (!BN_div(D, M, A, B, ctx))
  ------------------
  |  Branch (408:21): [True: 0, False: 945]
  ------------------
  409|      0|                    goto err;
  410|    945|            }
  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|  2.22k|            tmp = A;    /* keep the BIGNUM object, the value does not matter */
  420|       |
  421|       |            /* (A, B) := (B, A mod B) ... */
  422|  2.22k|            A = B;
  423|  2.22k|            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|  2.22k|            if (BN_is_one(D)) {
  ------------------
  |  Branch (449:17): [True: 847, False: 1.37k]
  ------------------
  450|    847|                if (!BN_add(tmp, X, Y))
  ------------------
  |  Branch (450:21): [True: 0, False: 847]
  ------------------
  451|      0|                    goto err;
  452|  1.37k|            } else {
  453|  1.37k|                if (BN_is_word(D, 2)) {
  ------------------
  |  Branch (453:21): [True: 466, False: 913]
  ------------------
  454|    466|                    if (!BN_lshift1(tmp, X))
  ------------------
  |  Branch (454:25): [True: 0, False: 466]
  ------------------
  455|      0|                        goto err;
  456|    913|                } else if (BN_is_word(D, 4)) {
  ------------------
  |  Branch (456:28): [True: 142, False: 771]
  ------------------
  457|    142|                    if (!BN_lshift(tmp, X, 2))
  ------------------
  |  Branch (457:25): [True: 0, False: 142]
  ------------------
  458|      0|                        goto err;
  459|    771|                } else if (D->top == 1) {
  ------------------
  |  Branch (459:28): [True: 771, False: 0]
  ------------------
  460|    771|                    if (!BN_copy(tmp, X))
  ------------------
  |  Branch (460:25): [True: 0, False: 771]
  ------------------
  461|      0|                        goto err;
  462|    771|                    if (!BN_mul_word(tmp, D->d[0]))
  ------------------
  |  Branch (462:25): [True: 0, False: 771]
  ------------------
  463|      0|                        goto err;
  464|    771|                } 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.37k|                if (!BN_add(tmp, tmp, Y))
  ------------------
  |  Branch (468:21): [True: 0, False: 1.37k]
  ------------------
  469|      0|                    goto err;
  470|  1.37k|            }
  471|       |
  472|  2.22k|            M = Y;      /* keep the BIGNUM object, the value does not matter */
  473|  2.22k|            Y = X;
  474|  2.22k|            X = tmp;
  475|  2.22k|            sign = -sign;
  476|  2.22k|        }
  477|    116|    }
  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|  40.5k|    if (sign < 0) {
  ------------------
  |  Branch (487:9): [True: 40.5k, False: 64]
  ------------------
  488|  40.5k|        if (!BN_sub(Y, n, Y))
  ------------------
  |  Branch (488:13): [True: 0, False: 40.5k]
  ------------------
  489|      0|            goto err;
  490|  40.5k|    }
  491|       |    /* Now  Y*a  ==  A  (mod |n|).  */
  492|       |
  493|  40.5k|    if (BN_is_one(A)) {
  ------------------
  |  Branch (493:9): [True: 40.4k, False: 116]
  ------------------
  494|       |        /* Y*a == 1  (mod |n|) */
  495|  40.4k|        if (!Y->neg && BN_ucmp(Y, n) < 0) {
  ------------------
  |  Branch (495:13): [True: 12.5k, False: 27.8k]
  |  Branch (495:24): [True: 12.5k, False: 0]
  ------------------
  496|  12.5k|            if (!BN_copy(R, Y))
  ------------------
  |  Branch (496:17): [True: 0, False: 12.5k]
  ------------------
  497|      0|                goto err;
  498|  27.8k|        } else {
  499|  27.8k|            if (!BN_nnmod(R, Y, n, ctx))
  ------------------
  |  Branch (499:17): [True: 0, False: 27.8k]
  ------------------
  500|      0|                goto err;
  501|  27.8k|        }
  502|  40.4k|    } else {
  503|    116|        *pnoinv = 1;
  504|    116|        goto err;
  505|    116|    }
  506|  40.4k|    ret = R;
  507|  40.5k| err:
  508|  40.5k|    if ((ret == NULL) && (in == NULL))
  ------------------
  |  Branch (508:9): [True: 116, False: 40.4k]
  |  Branch (508:26): [True: 0, False: 116]
  ------------------
  509|      0|        BN_free(R);
  510|  40.5k|    BN_CTX_end(ctx);
  511|  40.5k|    bn_check_top(ret);
  512|  40.5k|    return ret;
  513|  40.4k|}
BN_mod_inverse:
  518|  40.5k|{
  519|  40.5k|    BN_CTX *new_ctx = NULL;
  520|  40.5k|    BIGNUM *rv;
  521|  40.5k|    int noinv = 0;
  522|       |
  523|  40.5k|    if (ctx == NULL) {
  ------------------
  |  Branch (523:9): [True: 0, False: 40.5k]
  ------------------
  524|      0|        ctx = new_ctx = BN_CTX_new_ex(NULL);
  525|      0|        if (ctx == NULL) {
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  ------------------
  526|      0|            ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  527|      0|            return NULL;
  528|      0|        }
  529|      0|    }
  530|       |
  531|  40.5k|    rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
  532|  40.5k|    if (noinv)
  ------------------
  |  Branch (532:9): [True: 119, False: 40.4k]
  ------------------
  533|  40.5k|        ERR_raise(ERR_LIB_BN, BN_R_NO_INVERSE);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    119|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    119|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    119|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    119|     ERR_set_error)
  |  |  ------------------
  ------------------
  534|  40.5k|    BN_CTX_free(new_ctx);
  535|  40.5k|    return rv;
  536|  40.5k|}

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

bn_get_top:
  138|    396|{
  139|    396|    return a->top;
  140|    396|}
bn_set_all_zero:
  148|  54.6k|{
  149|  54.6k|    int i;
  150|       |
  151|   108k|    for (i = a->top; i < a->dmax; i++)
  ------------------
  |  Branch (151:22): [True: 53.5k, False: 54.6k]
  ------------------
  152|  53.5k|        a->d[i] = 0;
  153|  54.6k|}
bn_copy_words:
  156|     70|{
  157|     70|    if (in->top > size)
  ------------------
  |  Branch (157:9): [True: 0, False: 70]
  ------------------
  158|      0|        return 0;
  159|       |
  160|     70|    memset(out, 0, sizeof(*out) * size);
  161|     70|    if (in->d != NULL)
  ------------------
  |  Branch (161:9): [True: 70, False: 0]
  ------------------
  162|     70|        memcpy(out, in->d, sizeof(*out) * in->top);
  163|     70|    return 1;
  164|     70|}
bn_get_words:
  167|    120|{
  168|    120|    return a->d;
  169|    120|}
bn_set_words:
  185|     50|{
  186|     50|    if (bn_wexpand(a, num_words) == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 50]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |
  191|     50|    memcpy(a->d, words, sizeof(BN_ULONG) * num_words);
  192|     50|    a->top = num_words;
  193|     50|    bn_correct_top(a);
  194|     50|    return 1;
  195|     50|}

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

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

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

BN_mod_mul_montgomery:
   28|  91.6k|{
   29|  91.6k|    int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
   30|       |
   31|  91.6k|    bn_correct_top(r);
   32|  91.6k|    bn_check_top(r);
   33|       |
   34|  91.6k|    return ret;
   35|  91.6k|}
bn_mul_mont_fixed_top:
   39|  1.43M|{
   40|  1.43M|    BIGNUM *tmp;
   41|  1.43M|    int ret = 0;
   42|  1.43M|    int num = mont->N.top;
   43|       |
   44|  1.43M|#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)
   45|  1.43M|    if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) {
  ------------------
  |  |   62|  2.87M|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|  1.43M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 1.43M, False: 0]
  |  Branch (45:20): [True: 1.43M, False: 0]
  |  Branch (45:44): [True: 1.41M, False: 20.5k]
  |  Branch (45:61): [True: 1.41M, False: 1.74k]
  ------------------
   46|  1.41M|        if (bn_wexpand(r, num) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 1.41M]
  ------------------
   47|      0|            return 0;
   48|  1.41M|        if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {
  ------------------
  |  Branch (48:13): [True: 1.41M, False: 0]
  ------------------
   49|  1.41M|            r->neg = a->neg ^ b->neg;
   50|  1.41M|            r->top = num;
   51|  1.41M|            r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  1.41M|#  define BN_FLG_FIXED_TOP 0
  ------------------
   52|  1.41M|            return 1;
   53|  1.41M|        }
   54|  1.41M|    }
   55|  22.3k|#endif
   56|       |
   57|  22.3k|    if ((a->top + b->top) > 2 * num)
  ------------------
  |  Branch (57:9): [True: 0, False: 22.3k]
  ------------------
   58|      0|        return 0;
   59|       |
   60|  22.3k|    BN_CTX_start(ctx);
   61|  22.3k|    tmp = BN_CTX_get(ctx);
   62|  22.3k|    if (tmp == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 22.3k]
  ------------------
   63|      0|        goto err;
   64|       |
   65|  22.3k|    bn_check_top(tmp);
   66|  22.3k|    if (a == b) {
  ------------------
  |  Branch (66:9): [True: 3.43k, False: 18.9k]
  ------------------
   67|  3.43k|        if (!bn_sqr_fixed_top(tmp, a, ctx))
  ------------------
  |  Branch (67:13): [True: 0, False: 3.43k]
  ------------------
   68|      0|            goto err;
   69|  18.9k|    } else {
   70|  18.9k|        if (!bn_mul_fixed_top(tmp, a, b, ctx))
  ------------------
  |  Branch (70:13): [True: 0, False: 18.9k]
  ------------------
   71|      0|            goto err;
   72|  18.9k|    }
   73|       |    /* reduce from aRR to aR */
   74|  22.3k|#ifdef MONT_WORD
   75|  22.3k|    if (!bn_from_montgomery_word(r, tmp, mont))
  ------------------
  |  Branch (75:9): [True: 0, False: 22.3k]
  ------------------
   76|      0|        goto err;
   77|       |#else
   78|       |    if (!BN_from_montgomery(r, tmp, mont, ctx))
   79|       |        goto err;
   80|       |#endif
   81|  22.3k|    ret = 1;
   82|  22.3k| err:
   83|  22.3k|    BN_CTX_end(ctx);
   84|  22.3k|    return ret;
   85|  22.3k|}
BN_from_montgomery:
  164|  11.6k|{
  165|  11.6k|    int retn;
  166|       |
  167|  11.6k|    retn = bn_from_mont_fixed_top(ret, a, mont, ctx);
  168|  11.6k|    bn_correct_top(ret);
  169|  11.6k|    bn_check_top(ret);
  170|       |
  171|  11.6k|    return retn;
  172|  11.6k|}
bn_from_mont_fixed_top:
  176|  11.7k|{
  177|  11.7k|    int retn = 0;
  178|  11.7k|#ifdef MONT_WORD
  179|  11.7k|    BIGNUM *t;
  180|       |
  181|  11.7k|    BN_CTX_start(ctx);
  182|  11.7k|    if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) {
  ------------------
  |  Branch (182:9): [True: 11.7k, False: 0]
  |  Branch (182:34): [True: 11.7k, False: 0]
  ------------------
  183|  11.7k|        retn = bn_from_montgomery_word(ret, t, mont);
  184|  11.7k|    }
  185|  11.7k|    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|  11.7k|    return retn;
  220|  11.7k|}
bn_to_mont_fixed_top:
  224|  7.44k|{
  225|  7.44k|    return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
  226|  7.44k|}
BN_MONT_CTX_new:
  229|  79.1k|{
  230|  79.1k|    BN_MONT_CTX *ret;
  231|       |
  232|  79.1k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  79.1k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  79.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  79.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (232:9): [True: 0, False: 79.1k]
  ------------------
  233|      0|        return NULL;
  234|       |
  235|  79.1k|    BN_MONT_CTX_init(ret);
  236|  79.1k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|  79.1k|# define BN_FLG_MALLOCED         0x01
  ------------------
  237|  79.1k|    return ret;
  238|  79.1k|}
BN_MONT_CTX_init:
  241|  79.1k|{
  242|  79.1k|    ctx->ri = 0;
  243|  79.1k|    bn_init(&ctx->RR);
  244|  79.1k|    bn_init(&ctx->N);
  245|  79.1k|    bn_init(&ctx->Ni);
  246|  79.1k|    ctx->n0[0] = ctx->n0[1] = 0;
  247|  79.1k|    ctx->flags = 0;
  248|  79.1k|}
BN_MONT_CTX_free:
  251|   163k|{
  252|   163k|    if (mont == NULL)
  ------------------
  |  Branch (252:9): [True: 84.6k, False: 79.1k]
  ------------------
  253|  84.6k|        return;
  254|  79.1k|    BN_clear_free(&mont->RR);
  255|  79.1k|    BN_clear_free(&mont->N);
  256|  79.1k|    BN_clear_free(&mont->Ni);
  257|  79.1k|    if (mont->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|  79.1k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (257:9): [True: 79.1k, False: 0]
  ------------------
  258|  79.1k|        OPENSSL_free(mont);
  ------------------
  |  |  115|  79.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  79.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  79.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|  79.1k|}
BN_MONT_CTX_set:
  262|  40.7k|{
  263|  40.7k|    int i, ret = 0;
  264|  40.7k|    BIGNUM *Ri, *R;
  265|       |
  266|  40.7k|    if (BN_is_zero(mod))
  ------------------
  |  Branch (266:9): [True: 0, False: 40.7k]
  ------------------
  267|      0|        return 0;
  268|       |
  269|  40.7k|    BN_CTX_start(ctx);
  270|  40.7k|    if ((Ri = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (270:9): [True: 0, False: 40.7k]
  ------------------
  271|      0|        goto err;
  272|  40.7k|    R = &(mont->RR);            /* grab RR as a temp */
  273|  40.7k|    if (!BN_copy(&(mont->N), mod))
  ------------------
  |  Branch (273:9): [True: 0, False: 40.7k]
  ------------------
  274|      0|        goto err;               /* Set N */
  275|  40.7k|    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  40.7k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (275:9): [True: 0, False: 40.7k]
  ------------------
  276|      0|        BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  277|  40.7k|    mont->N.neg = 0;
  278|       |
  279|  40.7k|#ifdef MONT_WORD
  280|  40.7k|    {
  281|  40.7k|        BIGNUM tmod;
  282|  40.7k|        BN_ULONG buf[2];
  ------------------
  |  |   37|  40.7k|#  define BN_ULONG        unsigned long
  ------------------
  283|       |
  284|  40.7k|        bn_init(&tmod);
  285|  40.7k|        tmod.d = buf;
  286|  40.7k|        tmod.dmax = 2;
  287|  40.7k|        tmod.neg = 0;
  288|       |
  289|  40.7k|        if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  40.7k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (289:13): [True: 0, False: 40.7k]
  ------------------
  290|      0|            BN_set_flags(&tmod, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  291|       |
  292|  40.7k|        mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  40.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  40.7k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  40.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  40.7k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  40.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  40.7k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  293|       |
  294|       |# if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2<=32)
  295|       |        /*
  296|       |         * Only certain BN_BITS2<=32 platforms actually make use of n0[1],
  297|       |         * and we could use the #else case (with a shorter R value) for the
  298|       |         * others.  However, currently only the assembler files do know which
  299|       |         * is which.
  300|       |         */
  301|       |
  302|       |        BN_zero(R);
  303|       |        if (!(BN_set_bit(R, 2 * BN_BITS2)))
  304|       |            goto err;
  305|       |
  306|       |        tmod.top = 0;
  307|       |        if ((buf[0] = mod->d[0]))
  308|       |            tmod.top = 1;
  309|       |        if ((buf[1] = mod->top > 1 ? mod->d[1] : 0))
  310|       |            tmod.top = 2;
  311|       |
  312|       |        if (BN_is_one(&tmod))
  313|       |            BN_zero(Ri);
  314|       |        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  315|       |            goto err;
  316|       |        if (!BN_lshift(Ri, Ri, 2 * BN_BITS2))
  317|       |            goto err;           /* R*Ri */
  318|       |        if (!BN_is_zero(Ri)) {
  319|       |            if (!BN_sub_word(Ri, 1))
  320|       |                goto err;
  321|       |        } else {                /* if N mod word size == 1 */
  322|       |
  323|       |            if (bn_expand(Ri, (int)sizeof(BN_ULONG) * 2) == NULL)
  324|       |                goto err;
  325|       |            /* Ri-- (mod double word size) */
  326|       |            Ri->neg = 0;
  327|       |            Ri->d[0] = BN_MASK2;
  328|       |            Ri->d[1] = BN_MASK2;
  329|       |            Ri->top = 2;
  330|       |        }
  331|       |        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  332|       |            goto err;
  333|       |        /*
  334|       |         * Ni = (R*Ri-1)/N, keep only couple of least significant words:
  335|       |         */
  336|       |        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  337|       |        mont->n0[1] = (Ri->top > 1) ? Ri->d[1] : 0;
  338|       |# else
  339|  40.7k|        BN_zero(R);
  ------------------
  |  |  202|  40.7k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  340|  40.7k|        if (!(BN_set_bit(R, BN_BITS2)))
  ------------------
  |  |   54|  40.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  40.7k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (340:13): [True: 0, False: 40.7k]
  ------------------
  341|      0|            goto err;           /* R */
  342|       |
  343|  40.7k|        buf[0] = mod->d[0];     /* tmod = N mod word size */
  344|  40.7k|        buf[1] = 0;
  345|  40.7k|        tmod.top = buf[0] != 0 ? 1 : 0;
  ------------------
  |  Branch (345:20): [True: 40.7k, False: 3]
  ------------------
  346|       |        /* Ri = R^-1 mod N */
  347|  40.7k|        if (BN_is_one(&tmod))
  ------------------
  |  Branch (347:13): [True: 223, False: 40.5k]
  ------------------
  348|    223|            BN_zero(Ri);
  ------------------
  |  |  202|    223|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  349|  40.5k|        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  ------------------
  |  Branch (349:18): [True: 119, False: 40.4k]
  ------------------
  350|    119|            goto err;
  351|  40.6k|        if (!BN_lshift(Ri, Ri, BN_BITS2))
  ------------------
  |  |   54|  40.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  40.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (351:13): [True: 0, False: 40.6k]
  ------------------
  352|      0|            goto err;           /* R*Ri */
  353|  40.6k|        if (!BN_is_zero(Ri)) {
  ------------------
  |  Branch (353:13): [True: 40.4k, False: 223]
  ------------------
  354|  40.4k|            if (!BN_sub_word(Ri, 1))
  ------------------
  |  Branch (354:17): [True: 0, False: 40.4k]
  ------------------
  355|      0|                goto err;
  356|  40.4k|        } else {                /* if N mod word size == 1 */
  357|       |
  358|    223|            if (!BN_set_word(Ri, BN_MASK2))
  ------------------
  |  |   94|    223|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  |  Branch (358:17): [True: 0, False: 223]
  ------------------
  359|      0|                goto err;       /* Ri-- (mod word size) */
  360|    223|        }
  361|  40.6k|        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  ------------------
  |  Branch (361:13): [True: 0, False: 40.6k]
  ------------------
  362|      0|            goto err;
  363|       |        /*
  364|       |         * Ni = (R*Ri-1)/N, keep only least significant word:
  365|       |         */
  366|  40.6k|        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  ------------------
  |  Branch (366:23): [True: 40.6k, False: 0]
  ------------------
  367|  40.6k|        mont->n0[1] = 0;
  368|  40.6k|# endif
  369|  40.6k|    }
  370|       |#else                           /* !MONT_WORD */
  371|       |    {                           /* bignum version */
  372|       |        mont->ri = BN_num_bits(&mont->N);
  373|       |        BN_zero(R);
  374|       |        if (!BN_set_bit(R, mont->ri))
  375|       |            goto err;           /* R = 2^ri */
  376|       |        /* Ri = R^-1 mod N */
  377|       |        if ((BN_mod_inverse(Ri, R, &mont->N, ctx)) == NULL)
  378|       |            goto err;
  379|       |        if (!BN_lshift(Ri, Ri, mont->ri))
  380|       |            goto err;           /* R*Ri */
  381|       |        if (!BN_sub_word(Ri, 1))
  382|       |            goto err;
  383|       |        /*
  384|       |         * Ni = (R*Ri-1) / N
  385|       |         */
  386|       |        if (!BN_div(&(mont->Ni), NULL, Ri, &mont->N, ctx))
  387|       |            goto err;
  388|       |    }
  389|       |#endif
  390|       |
  391|       |    /* setup RR for conversions */
  392|  40.6k|    BN_zero(&(mont->RR));
  ------------------
  |  |  202|  40.6k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  393|  40.6k|    if (!BN_set_bit(&(mont->RR), mont->ri * 2))
  ------------------
  |  Branch (393:9): [True: 0, False: 40.6k]
  ------------------
  394|      0|        goto err;
  395|  40.6k|    if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))
  ------------------
  |  |  277|  40.6k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (395:9): [True: 0, False: 40.6k]
  ------------------
  396|      0|        goto err;
  397|       |
  398|  48.1k|    for (i = mont->RR.top, ret = mont->N.top; i < ret; i++)
  ------------------
  |  Branch (398:47): [True: 7.45k, False: 40.6k]
  ------------------
  399|  7.45k|        mont->RR.d[i] = 0;
  400|  40.6k|    mont->RR.top = ret;
  401|  40.6k|    mont->RR.flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  40.6k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  402|       |
  403|  40.6k|    ret = 1;
  404|  40.7k| err:
  405|  40.7k|    BN_CTX_end(ctx);
  406|  40.7k|    return ret;
  407|  40.6k|}
BN_MONT_CTX_copy:
  410|  36.4k|{
  411|  36.4k|    if (to == from)
  ------------------
  |  Branch (411:9): [True: 0, False: 36.4k]
  ------------------
  412|      0|        return to;
  413|       |
  414|  36.4k|    if (!BN_copy(&(to->RR), &(from->RR)))
  ------------------
  |  Branch (414:9): [True: 0, False: 36.4k]
  ------------------
  415|      0|        return NULL;
  416|  36.4k|    if (!BN_copy(&(to->N), &(from->N)))
  ------------------
  |  Branch (416:9): [True: 0, False: 36.4k]
  ------------------
  417|      0|        return NULL;
  418|  36.4k|    if (!BN_copy(&(to->Ni), &(from->Ni)))
  ------------------
  |  Branch (418:9): [True: 0, False: 36.4k]
  ------------------
  419|      0|        return NULL;
  420|  36.4k|    to->ri = from->ri;
  421|  36.4k|    to->n0[0] = from->n0[0];
  422|  36.4k|    to->n0[1] = from->n0[1];
  423|  36.4k|    return to;
  424|  36.4k|}
BN_MONT_CTX_set_locked:
  428|    750|{
  429|    750|    BN_MONT_CTX *ret;
  430|       |
  431|    750|    if (!CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (431:9): [True: 0, False: 750]
  ------------------
  432|      0|        return NULL;
  433|    750|    ret = *pmont;
  434|    750|    CRYPTO_THREAD_unlock(lock);
  435|    750|    if (ret)
  ------------------
  |  Branch (435:9): [True: 57, False: 693]
  ------------------
  436|     57|        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|    693|    ret = BN_MONT_CTX_new();
  447|    693|    if (ret == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 693]
  ------------------
  448|      0|        return NULL;
  449|    693|    if (!BN_MONT_CTX_set(ret, mod, ctx)) {
  ------------------
  |  Branch (449:9): [True: 119, False: 574]
  ------------------
  450|    119|        BN_MONT_CTX_free(ret);
  451|    119|        return NULL;
  452|    119|    }
  453|       |
  454|       |    /* The locked compare-and-set, after the local work is done. */
  455|    574|    if (!CRYPTO_THREAD_write_lock(lock)) {
  ------------------
  |  Branch (455:9): [True: 0, False: 574]
  ------------------
  456|      0|        BN_MONT_CTX_free(ret);
  457|      0|        return NULL;
  458|      0|    }
  459|       |
  460|    574|    if (*pmont) {
  ------------------
  |  Branch (460:9): [True: 0, False: 574]
  ------------------
  461|      0|        BN_MONT_CTX_free(ret);
  462|      0|        ret = *pmont;
  463|      0|    } else
  464|    574|        *pmont = ret;
  465|    574|    CRYPTO_THREAD_unlock(lock);
  466|    574|    return ret;
  467|    574|}
ossl_bn_mont_ctx_set:
  471|  1.86k|{
  472|  1.86k|    if (BN_copy(&ctx->N, modulus) == NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 1.86k]
  ------------------
  473|      0|        return 0;
  474|  1.86k|    if (BN_bin2bn(rr, rrlen, &ctx->RR) == NULL)
  ------------------
  |  Branch (474:9): [True: 0, False: 1.86k]
  ------------------
  475|      0|        return 0;
  476|  1.86k|    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|  1.86k|    ctx->n0[0] = ((BN_ULONG)nhi << 32)| nlo;
  485|  1.86k|    ctx->n0[1] = 0;
  486|  1.86k|#endif
  487|       |
  488|  1.86k|    return 1;
  489|  1.86k|}
bn_mont.c:bn_from_montgomery_word:
   89|  34.0k|{
   90|  34.0k|    BIGNUM *n;
   91|  34.0k|    BN_ULONG *ap, *np, *rp, n0, v, carry;
  ------------------
  |  |   37|  34.0k|#  define BN_ULONG        unsigned long
  ------------------
   92|  34.0k|    int nl, max, i;
   93|  34.0k|    unsigned int rtop;
   94|       |
   95|  34.0k|    n = &(mont->N);
   96|  34.0k|    nl = n->top;
   97|  34.0k|    if (nl == 0) {
  ------------------
  |  Branch (97:9): [True: 0, False: 34.0k]
  ------------------
   98|      0|        ret->top = 0;
   99|      0|        return 1;
  100|      0|    }
  101|       |
  102|  34.0k|    max = (2 * nl);             /* carry is stored separately */
  103|  34.0k|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 34.0k]
  ------------------
  104|      0|        return 0;
  105|       |
  106|  34.0k|    r->neg ^= n->neg;
  107|  34.0k|    np = n->d;
  108|  34.0k|    rp = r->d;
  109|       |
  110|       |    /* clear the top words of T */
  111|   331k|    for (rtop = r->top, i = 0; i < max; i++) {
  ------------------
  |  Branch (111:32): [True: 297k, False: 34.0k]
  ------------------
  112|   297k|        v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1));
  113|   297k|        rp[i] &= v;
  114|   297k|    }
  115|       |
  116|  34.0k|    r->top = max;
  117|  34.0k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  34.0k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  118|  34.0k|    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|   182k|    for (carry = 0, i = 0; i < nl; i++, rp++) {
  ------------------
  |  Branch (125:28): [True: 148k, False: 34.0k]
  ------------------
  126|   148k|        v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
  ------------------
  |  |   94|   148k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  127|   148k|        v = (v + carry + rp[nl]) & BN_MASK2;
  ------------------
  |  |   94|   148k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|   148k|        carry |= (v != rp[nl]);
  129|   148k|        carry &= (v <= rp[nl]);
  130|   148k|        rp[nl] = v;
  131|   148k|    }
  132|       |
  133|  34.0k|    if (bn_wexpand(ret, nl) == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 34.0k]
  ------------------
  134|      0|        return 0;
  135|  34.0k|    ret->top = nl;
  136|  34.0k|    ret->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  34.0k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  137|  34.0k|    ret->neg = r->neg;
  138|       |
  139|  34.0k|    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|  34.0k|    ap = &(r->d[nl]);
  146|       |
  147|  34.0k|    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|   182k|    for (i = 0; i < nl; i++) {
  ------------------
  |  Branch (153:17): [True: 148k, False: 34.0k]
  ------------------
  154|   148k|        rp[i] = (carry & ap[i]) | (~carry & rp[i]);
  155|   148k|        ap[i] = 0;
  156|   148k|    }
  157|       |
  158|  34.0k|    return 1;
  159|  34.0k|}

bn_sub_part_words:
   30|  6.24k|{
   31|  6.24k|    BN_ULONG c, t;
  ------------------
  |  |   37|  6.24k|#  define BN_ULONG        unsigned long
  ------------------
   32|       |
   33|  6.24k|    assert(cl >= 0);
   34|  6.24k|    c = bn_sub_words(r, a, b, cl);
   35|       |
   36|  6.24k|    if (dl == 0)
  ------------------
  |  Branch (36:9): [True: 5.40k, False: 841]
  ------------------
   37|  5.40k|        return c;
   38|       |
   39|    841|    r += cl;
   40|    841|    a += cl;
   41|    841|    b += cl;
   42|       |
   43|    841|    if (dl < 0) {
  ------------------
  |  Branch (43:9): [True: 40, False: 801]
  ------------------
   44|     40|        for (;;) {
   45|     40|            t = b[0];
   46|     40|            r[0] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|     40|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   47|     40|            if (t != 0)
  ------------------
  |  Branch (47:17): [True: 0, False: 40]
  ------------------
   48|      0|                c = 1;
   49|     40|            if (++dl >= 0)
  ------------------
  |  Branch (49:17): [True: 40, False: 0]
  ------------------
   50|     40|                break;
   51|       |
   52|      0|            t = b[1];
   53|      0|            r[1] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   54|      0|            if (t != 0)
  ------------------
  |  Branch (54:17): [True: 0, False: 0]
  ------------------
   55|      0|                c = 1;
   56|      0|            if (++dl >= 0)
  ------------------
  |  Branch (56:17): [True: 0, False: 0]
  ------------------
   57|      0|                break;
   58|       |
   59|      0|            t = b[2];
   60|      0|            r[2] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   61|      0|            if (t != 0)
  ------------------
  |  Branch (61:17): [True: 0, False: 0]
  ------------------
   62|      0|                c = 1;
   63|      0|            if (++dl >= 0)
  ------------------
  |  Branch (63:17): [True: 0, False: 0]
  ------------------
   64|      0|                break;
   65|       |
   66|      0|            t = b[3];
   67|      0|            r[3] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   68|      0|            if (t != 0)
  ------------------
  |  Branch (68:17): [True: 0, False: 0]
  ------------------
   69|      0|                c = 1;
   70|      0|            if (++dl >= 0)
  ------------------
  |  Branch (70:17): [True: 0, False: 0]
  ------------------
   71|      0|                break;
   72|       |
   73|      0|            b += 4;
   74|      0|            r += 4;
   75|      0|        }
   76|    801|    } else {
   77|    801|        int save_dl = dl;
   78|    973|        while (c) {
  ------------------
  |  Branch (78:16): [True: 291, False: 682]
  ------------------
   79|    291|            t = a[0];
   80|    291|            r[0] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|    291|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   81|    291|            if (t != 0)
  ------------------
  |  Branch (81:17): [True: 265, False: 26]
  ------------------
   82|    265|                c = 0;
   83|    291|            if (--dl <= 0)
  ------------------
  |  Branch (83:17): [True: 119, False: 172]
  ------------------
   84|    119|                break;
   85|       |
   86|    172|            t = a[1];
   87|    172|            r[1] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|    172|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   88|    172|            if (t != 0)
  ------------------
  |  Branch (88:17): [True: 146, False: 26]
  ------------------
   89|    146|                c = 0;
   90|    172|            if (--dl <= 0)
  ------------------
  |  Branch (90:17): [True: 0, False: 172]
  ------------------
   91|      0|                break;
   92|       |
   93|    172|            t = a[2];
   94|    172|            r[2] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|    172|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   95|    172|            if (t != 0)
  ------------------
  |  Branch (95:17): [True: 152, False: 20]
  ------------------
   96|    152|                c = 0;
   97|    172|            if (--dl <= 0)
  ------------------
  |  Branch (97:17): [True: 0, False: 172]
  ------------------
   98|      0|                break;
   99|       |
  100|    172|            t = a[3];
  101|    172|            r[3] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|    172|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  102|    172|            if (t != 0)
  ------------------
  |  Branch (102:17): [True: 152, False: 20]
  ------------------
  103|    152|                c = 0;
  104|    172|            if (--dl <= 0)
  ------------------
  |  Branch (104:17): [True: 0, False: 172]
  ------------------
  105|      0|                break;
  106|       |
  107|    172|            save_dl = dl;
  108|    172|            a += 4;
  109|    172|            r += 4;
  110|    172|        }
  111|    801|        if (dl > 0) {
  ------------------
  |  Branch (111:13): [True: 682, False: 119]
  ------------------
  112|    682|            if (save_dl > dl) {
  ------------------
  |  Branch (112:17): [True: 0, False: 682]
  ------------------
  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|    682|        }
  133|    801|        if (dl > 0) {
  ------------------
  |  Branch (133:13): [True: 682, False: 119]
  ------------------
  134|  4.66k|            for (;;) {
  135|  4.66k|                r[0] = a[0];
  136|  4.66k|                if (--dl <= 0)
  ------------------
  |  Branch (136:21): [True: 88, False: 4.58k]
  ------------------
  137|     88|                    break;
  138|  4.58k|                r[1] = a[1];
  139|  4.58k|                if (--dl <= 0)
  ------------------
  |  Branch (139:21): [True: 0, False: 4.58k]
  ------------------
  140|      0|                    break;
  141|  4.58k|                r[2] = a[2];
  142|  4.58k|                if (--dl <= 0)
  ------------------
  |  Branch (142:21): [True: 297, False: 4.28k]
  ------------------
  143|    297|                    break;
  144|  4.28k|                r[3] = a[3];
  145|  4.28k|                if (--dl <= 0)
  ------------------
  |  Branch (145:21): [True: 297, False: 3.98k]
  ------------------
  146|    297|                    break;
  147|       |
  148|  3.98k|                a += 4;
  149|  3.98k|                r += 4;
  150|  3.98k|            }
  151|    682|        }
  152|    801|    }
  153|    841|    return c;
  154|    841|}
bn_mul_recursive:
  177|  3.26k|{
  178|  3.26k|    int n = n2 / 2, c1, c2;
  179|  3.26k|    int tna = n + dna, tnb = n + dnb;
  180|  3.26k|    unsigned int neg, zero;
  181|  3.26k|    BN_ULONG ln, lo, *p;
  ------------------
  |  |   37|  3.26k|#  define BN_ULONG        unsigned long
  ------------------
  182|       |
  183|  3.26k|# 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|  3.26k|    if (n2 == 8 && dna == 0 && dnb == 0) {
  ------------------
  |  Branch (194:9): [True: 377, False: 2.88k]
  |  Branch (194:20): [True: 249, False: 128]
  |  Branch (194:32): [True: 249, False: 0]
  ------------------
  195|    249|        bn_mul_comba8(r, a, b);
  196|    249|        return;
  197|    249|    }
  198|  3.01k|# endif                         /* BN_MUL_COMBA */
  199|       |    /* Else do normal multiply */
  200|  3.01k|    if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  365|  3.01k|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (200:9): [True: 128, False: 2.88k]
  ------------------
  201|    128|        bn_mul_normal(r, a, n2 + dna, b, n2 + dnb);
  202|    128|        if ((dna + dnb) < 0)
  ------------------
  |  Branch (202:13): [True: 128, False: 0]
  ------------------
  203|    128|            memset(&r[2 * n2 + dna + dnb], 0,
  204|    128|                   sizeof(BN_ULONG) * -(dna + dnb));
  205|    128|        return;
  206|    128|    }
  207|       |    /* r=(a[0]-a[1])*(b[1]-b[0]) */
  208|  2.88k|    c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
  209|  2.88k|    c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
  210|  2.88k|    zero = neg = 0;
  211|  2.88k|    switch (c1 * 3 + c2) {
  ------------------
  |  Branch (211:13): [True: 0, False: 2.88k]
  ------------------
  212|    755|    case -4:
  ------------------
  |  Branch (212:5): [True: 755, False: 2.12k]
  ------------------
  213|    755|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  214|    755|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  215|    755|        break;
  216|      5|    case -3:
  ------------------
  |  Branch (216:5): [True: 5, False: 2.87k]
  ------------------
  217|      5|        zero = 1;
  218|      5|        break;
  219|    812|    case -2:
  ------------------
  |  Branch (219:5): [True: 812, False: 2.07k]
  ------------------
  220|    812|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  221|    812|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); /* + */
  222|    812|        neg = 1;
  223|    812|        break;
  224|     26|    case -1:
  ------------------
  |  Branch (224:5): [True: 26, False: 2.85k]
  ------------------
  225|     29|    case 0:
  ------------------
  |  Branch (225:5): [True: 3, False: 2.88k]
  ------------------
  226|     51|    case 1:
  ------------------
  |  Branch (226:5): [True: 22, False: 2.86k]
  ------------------
  227|     51|        zero = 1;
  228|     51|        break;
  229|    723|    case 2:
  ------------------
  |  Branch (229:5): [True: 723, False: 2.16k]
  ------------------
  230|    723|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna); /* + */
  231|    723|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  232|    723|        neg = 1;
  233|    723|        break;
  234|      4|    case 3:
  ------------------
  |  Branch (234:5): [True: 4, False: 2.88k]
  ------------------
  235|      4|        zero = 1;
  236|      4|        break;
  237|    534|    case 4:
  ------------------
  |  Branch (237:5): [True: 534, False: 2.35k]
  ------------------
  238|    534|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna);
  239|    534|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);
  240|    534|        break;
  241|  2.88k|    }
  242|       |
  243|  2.88k|# ifdef BN_MUL_COMBA
  244|  2.88k|    if (n == 4 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba4 could take
  ------------------
  |  Branch (244:9): [True: 0, False: 2.88k]
  |  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|  2.88k|    } else if (n == 8 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba8 could
  ------------------
  |  Branch (253:16): [True: 2.16k, False: 722]
  |  Branch (253:26): [True: 2.03k, False: 128]
  |  Branch (253:38): [True: 2.03k, False: 0]
  ------------------
  254|       |                                                  * take extra args to do
  255|       |                                                  * this well */
  256|  2.03k|        if (!zero)
  ------------------
  |  Branch (256:13): [True: 1.98k, False: 49]
  ------------------
  257|  1.98k|            bn_mul_comba8(&(t[n2]), t, &(t[n]));
  258|     49|        else
  259|     49|            memset(&t[n2], 0, sizeof(*t) * 16);
  260|       |
  261|  2.03k|        bn_mul_comba8(r, a, b);
  262|  2.03k|        bn_mul_comba8(&(r[n2]), &(a[n]), &(b[n]));
  263|  2.03k|    } else
  264|    850|# endif                         /* BN_MUL_COMBA */
  265|    850|    {
  266|    850|        p = &(t[n2 * 2]);
  267|    850|        if (!zero)
  ------------------
  |  Branch (267:13): [True: 839, False: 11]
  ------------------
  268|    839|            bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
  269|     11|        else
  270|     11|            memset(&t[n2], 0, sizeof(*t) * n2);
  271|    850|        bn_mul_recursive(r, a, b, n, 0, 0, p);
  272|    850|        bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]), n, dna, dnb, p);
  273|    850|    }
  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|  2.88k|    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  282|       |
  283|  2.88k|    if (neg) {                  /* if t[32] is negative */
  ------------------
  |  Branch (283:9): [True: 1.53k, False: 1.34k]
  ------------------
  284|  1.53k|        c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  285|  1.53k|    } else {
  286|       |        /* Might have a carry */
  287|  1.34k|        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
  288|  1.34k|    }
  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|  2.88k|    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  297|  2.88k|    if (c1) {
  ------------------
  |  Branch (297:9): [True: 1.34k, False: 1.54k]
  ------------------
  298|  1.34k|        p = &(r[n + n2]);
  299|  1.34k|        lo = *p;
  300|  1.34k|        ln = (lo + c1) & BN_MASK2;
  ------------------
  |  |   94|  1.34k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  301|  1.34k|        *p = ln;
  302|       |
  303|       |        /*
  304|       |         * The overflow will stop before we over write words we should not
  305|       |         * overwrite
  306|       |         */
  307|  1.34k|        if (ln < (BN_ULONG)c1) {
  ------------------
  |  Branch (307:13): [True: 52, False: 1.29k]
  ------------------
  308|    171|            do {
  309|    171|                p++;
  310|    171|                lo = *p;
  311|    171|                ln = (lo + 1) & BN_MASK2;
  ------------------
  |  |   94|    171|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  312|    171|                *p = ln;
  313|    171|            } while (ln == 0);
  ------------------
  |  Branch (313:22): [True: 119, False: 52]
  ------------------
  314|     52|        }
  315|  1.34k|    }
  316|  2.88k|}
bn_mul_part_recursive:
  324|    297|{
  325|    297|    int i, j, n2 = n * 2;
  326|    297|    int c1, c2, neg;
  327|    297|    BN_ULONG ln, lo, *p;
  ------------------
  |  |   37|    297|#  define BN_ULONG        unsigned long
  ------------------
  328|       |
  329|    297|    if (n < 8) {
  ------------------
  |  Branch (329:9): [True: 0, False: 297]
  ------------------
  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|    297|    c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
  336|    297|    c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
  337|    297|    neg = 0;
  338|    297|    switch (c1 * 3 + c2) {
  ------------------
  |  Branch (338:13): [True: 0, False: 297]
  ------------------
  339|      0|    case -4:
  ------------------
  |  Branch (339:5): [True: 0, False: 297]
  ------------------
  340|      0|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  341|      0|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  342|      0|        break;
  343|      0|    case -3:
  ------------------
  |  Branch (343:5): [True: 0, False: 297]
  ------------------
  344|      0|    case -2:
  ------------------
  |  Branch (344:5): [True: 0, False: 297]
  ------------------
  345|      0|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  346|      0|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); /* + */
  347|      0|        neg = 1;
  348|      0|        break;
  349|      0|    case -1:
  ------------------
  |  Branch (349:5): [True: 0, False: 297]
  ------------------
  350|      0|    case 0:
  ------------------
  |  Branch (350:5): [True: 0, False: 297]
  ------------------
  351|      0|    case 1:
  ------------------
  |  Branch (351:5): [True: 0, False: 297]
  ------------------
  352|    297|    case 2:
  ------------------
  |  Branch (352:5): [True: 297, False: 0]
  ------------------
  353|    297|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna); /* + */
  354|    297|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  355|    297|        neg = 1;
  356|    297|        break;
  357|      0|    case 3:
  ------------------
  |  Branch (357:5): [True: 0, False: 297]
  ------------------
  358|      0|    case 4:
  ------------------
  |  Branch (358:5): [True: 0, False: 297]
  ------------------
  359|      0|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna);
  360|      0|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);
  361|      0|        break;
  362|    297|    }
  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|    297|    if (n == 8) {
  ------------------
  |  Branch (375:9): [True: 0, False: 297]
  ------------------
  376|      0|        bn_mul_comba8(&(t[n2]), t, &(t[n]));
  377|      0|        bn_mul_comba8(r, a, b);
  378|      0|        bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);
  379|      0|        memset(&r[n2 + tna + tnb], 0, sizeof(*r) * (n2 - tna - tnb));
  380|    297|    } else {
  381|    297|        p = &(t[n2 * 2]);
  382|    297|        bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
  383|    297|        bn_mul_recursive(r, a, b, n, 0, 0, p);
  384|    297|        i = n / 2;
  385|       |        /*
  386|       |         * If there is only a bottom half to the number, just do it
  387|       |         */
  388|    297|        if (tna > tnb)
  ------------------
  |  Branch (388:13): [True: 0, False: 297]
  ------------------
  389|      0|            j = tna - i;
  390|    297|        else
  391|    297|            j = tnb - i;
  392|    297|        if (j == 0) {
  ------------------
  |  Branch (392:13): [True: 0, False: 297]
  ------------------
  393|      0|            bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]),
  394|      0|                             i, tna - i, tnb - i, p);
  395|      0|            memset(&r[n2 + i * 2], 0, sizeof(*r) * (n2 - i * 2));
  396|    297|        } else if (j > 0) {     /* eg, n == 16, i == 8 and tn == 11 */
  ------------------
  |  Branch (396:20): [True: 0, False: 297]
  ------------------
  397|      0|            bn_mul_part_recursive(&(r[n2]), &(a[n]), &(b[n]),
  398|      0|                                  i, tna - i, tnb - i, p);
  399|      0|            memset(&(r[n2 + tna + tnb]), 0,
  400|      0|                   sizeof(BN_ULONG) * (n2 - tna - tnb));
  401|    297|        } else {                /* (j < 0) eg, n == 16, i == 8 and tn == 5 */
  402|       |
  403|    297|            memset(&r[n2], 0, sizeof(*r) * n2);
  404|    297|            if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL
  ------------------
  |  |  365|    594|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (404:17): [True: 297, False: 0]
  ------------------
  405|    297|                && tnb < BN_MUL_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  365|    297|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (405:20): [True: 297, False: 0]
  ------------------
  406|    297|                bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);
  407|    297|            } 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|    297|        }
  428|    297|    }
  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|    297|    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  437|       |
  438|    297|    if (neg) {                  /* if t[32] is negative */
  ------------------
  |  Branch (438:9): [True: 297, False: 0]
  ------------------
  439|    297|        c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  440|    297|    } else {
  441|       |        /* Might have a carry */
  442|      0|        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
  443|      0|    }
  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|    297|    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  452|    297|    if (c1) {
  ------------------
  |  Branch (452:9): [True: 0, False: 297]
  ------------------
  453|      0|        p = &(r[n + n2]);
  454|      0|        lo = *p;
  455|      0|        ln = (lo + c1) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  456|      0|        *p = ln;
  457|       |
  458|       |        /*
  459|       |         * The overflow will stop before we over write words we should not
  460|       |         * overwrite
  461|       |         */
  462|      0|        if (ln < (BN_ULONG)c1) {
  ------------------
  |  Branch (462:13): [True: 0, False: 0]
  ------------------
  463|      0|            do {
  464|      0|                p++;
  465|      0|                lo = *p;
  466|      0|                ln = (lo + 1) & BN_MASK2;
  ------------------
  |  |   94|      0|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  467|      0|                *p = ln;
  468|      0|            } while (ln == 0);
  ------------------
  |  Branch (468:22): [True: 0, False: 0]
  ------------------
  469|      0|        }
  470|      0|    }
  471|    297|}
BN_mul:
  498|  11.3k|{
  499|  11.3k|    int ret = bn_mul_fixed_top(r, a, b, ctx);
  500|       |
  501|  11.3k|    bn_correct_top(r);
  502|  11.3k|    bn_check_top(r);
  503|       |
  504|  11.3k|    return ret;
  505|  11.3k|}
bn_mul_fixed_top:
  508|  30.2k|{
  509|  30.2k|    int ret = 0;
  510|  30.2k|    int top, al, bl;
  511|  30.2k|    BIGNUM *rr;
  512|  30.2k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  513|  30.2k|    int i;
  514|  30.2k|#endif
  515|  30.2k|#ifdef BN_RECURSION
  516|  30.2k|    BIGNUM *t = NULL;
  517|  30.2k|    int j = 0, k;
  518|  30.2k|#endif
  519|       |
  520|  30.2k|    bn_check_top(a);
  521|  30.2k|    bn_check_top(b);
  522|  30.2k|    bn_check_top(r);
  523|       |
  524|  30.2k|    al = a->top;
  525|  30.2k|    bl = b->top;
  526|       |
  527|  30.2k|    if ((al == 0) || (bl == 0)) {
  ------------------
  |  Branch (527:9): [True: 2.85k, False: 27.4k]
  |  Branch (527:22): [True: 953, False: 26.4k]
  ------------------
  528|  3.80k|        BN_zero(r);
  ------------------
  |  |  202|  3.80k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  529|  3.80k|        return 1;
  530|  3.80k|    }
  531|  26.4k|    top = al + bl;
  532|       |
  533|  26.4k|    BN_CTX_start(ctx);
  534|  26.4k|    if ((r == a) || (r == b)) {
  ------------------
  |  Branch (534:9): [True: 5.58k, False: 20.8k]
  |  Branch (534:21): [True: 0, False: 20.8k]
  ------------------
  535|  5.58k|        if ((rr = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 5.58k]
  ------------------
  536|      0|            goto err;
  537|  5.58k|    } else
  538|  20.8k|        rr = r;
  539|       |
  540|  26.4k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  541|  26.4k|    i = al - bl;
  542|  26.4k|#endif
  543|  26.4k|#ifdef BN_MUL_COMBA
  544|  26.4k|    if (i == 0) {
  ------------------
  |  Branch (544:9): [True: 9.83k, False: 16.6k]
  ------------------
  545|       |# if 0
  546|       |        if (al == 4) {
  547|       |            if (bn_wexpand(rr, 8) == NULL)
  548|       |                goto err;
  549|       |            rr->top = 8;
  550|       |            bn_mul_comba4(rr->d, a->d, b->d);
  551|       |            goto end;
  552|       |        }
  553|       |# endif
  554|  9.83k|        if (al == 8) {
  ------------------
  |  Branch (554:13): [True: 611, False: 9.22k]
  ------------------
  555|    611|            if (bn_wexpand(rr, 16) == NULL)
  ------------------
  |  Branch (555:17): [True: 0, False: 611]
  ------------------
  556|      0|                goto err;
  557|    611|            rr->top = 16;
  558|    611|            bn_mul_comba8(rr->d, a->d, b->d);
  559|    611|            goto end;
  560|    611|        }
  561|  9.83k|    }
  562|  25.8k|#endif                          /* BN_MUL_COMBA */
  563|  25.8k|#ifdef BN_RECURSION
  564|  25.8k|    if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|  25.8k|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
                  if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|    437|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
  |  Branch (564:9): [True: 437, False: 25.4k]
  |  Branch (564:40): [True: 437, False: 0]
  ------------------
  565|    437|        if (i >= -1 && i <= 1) {
  ------------------
  |  Branch (565:13): [True: 425, False: 12]
  |  Branch (565:24): [True: 425, False: 0]
  ------------------
  566|       |            /*
  567|       |             * Find out the power of two lower or equal to the longest of the
  568|       |             * two numbers
  569|       |             */
  570|    425|            if (i >= 0) {
  ------------------
  |  Branch (570:17): [True: 0, False: 425]
  ------------------
  571|      0|                j = BN_num_bits_word((BN_ULONG)al);
  572|      0|            }
  573|    425|            if (i == -1) {
  ------------------
  |  Branch (573:17): [True: 425, False: 0]
  ------------------
  574|    425|                j = BN_num_bits_word((BN_ULONG)bl);
  575|    425|            }
  576|    425|            j = 1 << (j - 1);
  577|    425|            assert(j <= al || j <= bl);
  578|    425|            k = j + j;
  579|    425|            t = BN_CTX_get(ctx);
  580|    425|            if (t == NULL)
  ------------------
  |  Branch (580:17): [True: 0, False: 425]
  ------------------
  581|      0|                goto err;
  582|    425|            if (al > j || bl > j) {
  ------------------
  |  Branch (582:17): [True: 0, False: 425]
  |  Branch (582:27): [True: 297, False: 128]
  ------------------
  583|    297|                if (bn_wexpand(t, k * 4) == NULL)
  ------------------
  |  Branch (583:21): [True: 0, False: 297]
  ------------------
  584|      0|                    goto err;
  585|    297|                if (bn_wexpand(rr, k * 4) == NULL)
  ------------------
  |  Branch (585:21): [True: 0, False: 297]
  ------------------
  586|      0|                    goto err;
  587|    297|                bn_mul_part_recursive(rr->d, a->d, b->d,
  588|    297|                                      j, al - j, bl - j, t->d);
  589|    297|            } else {            /* al <= j || bl <= j */
  590|       |
  591|    128|                if (bn_wexpand(t, k * 2) == NULL)
  ------------------
  |  Branch (591:21): [True: 0, False: 128]
  ------------------
  592|      0|                    goto err;
  593|    128|                if (bn_wexpand(rr, k * 2) == NULL)
  ------------------
  |  Branch (593:21): [True: 0, False: 128]
  ------------------
  594|      0|                    goto err;
  595|    128|                bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d);
  596|    128|            }
  597|    425|            rr->top = top;
  598|    425|            goto end;
  599|    425|        }
  600|    437|    }
  601|  25.4k|#endif                          /* BN_RECURSION */
  602|  25.4k|    if (bn_wexpand(rr, top) == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 25.4k]
  ------------------
  603|      0|        goto err;
  604|  25.4k|    rr->top = top;
  605|  25.4k|    bn_mul_normal(rr->d, a->d, al, b->d, bl);
  606|       |
  607|  25.4k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  608|  26.4k| end:
  609|  26.4k|#endif
  610|  26.4k|    rr->neg = a->neg ^ b->neg;
  611|  26.4k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  26.4k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  612|  26.4k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (612:9): [True: 5.58k, False: 20.8k]
  |  Branch (612:20): [True: 0, False: 5.58k]
  ------------------
  613|      0|        goto err;
  614|       |
  615|  26.4k|    ret = 1;
  616|  26.4k| err:
  617|  26.4k|    bn_check_top(r);
  618|  26.4k|    BN_CTX_end(ctx);
  619|  26.4k|    return ret;
  620|  26.4k|}
bn_mul_normal:
  623|  25.8k|{
  624|  25.8k|    BN_ULONG *rr;
  ------------------
  |  |   37|  25.8k|#  define BN_ULONG        unsigned long
  ------------------
  625|       |
  626|  25.8k|    if (na < nb) {
  ------------------
  |  Branch (626:9): [True: 14.4k, False: 11.3k]
  ------------------
  627|  14.4k|        int itmp;
  628|  14.4k|        BN_ULONG *ltmp;
  ------------------
  |  |   37|  14.4k|#  define BN_ULONG        unsigned long
  ------------------
  629|       |
  630|  14.4k|        itmp = na;
  631|  14.4k|        na = nb;
  632|  14.4k|        nb = itmp;
  633|  14.4k|        ltmp = a;
  634|  14.4k|        a = b;
  635|  14.4k|        b = ltmp;
  636|       |
  637|  14.4k|    }
  638|  25.8k|    rr = &(r[na]);
  639|  25.8k|    if (nb <= 0) {
  ------------------
  |  Branch (639:9): [True: 297, False: 25.5k]
  ------------------
  640|    297|        (void)bn_mul_words(r, a, na, 0);
  641|    297|        return;
  642|    297|    } else
  643|  25.5k|        rr[0] = bn_mul_words(r, a, na, b[0]);
  644|       |
  645|  31.9k|    for (;;) {
  646|  31.9k|        if (--nb <= 0)
  ------------------
  |  Branch (646:13): [True: 17.5k, False: 14.4k]
  ------------------
  647|  17.5k|            return;
  648|  14.4k|        rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);
  649|  14.4k|        if (--nb <= 0)
  ------------------
  |  Branch (649:13): [True: 2.65k, False: 11.7k]
  ------------------
  650|  2.65k|            return;
  651|  11.7k|        rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);
  652|  11.7k|        if (--nb <= 0)
  ------------------
  |  Branch (652:13): [True: 2.80k, False: 8.94k]
  ------------------
  653|  2.80k|            return;
  654|  8.94k|        rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);
  655|  8.94k|        if (--nb <= 0)
  ------------------
  |  Branch (655:13): [True: 2.62k, False: 6.32k]
  ------------------
  656|  2.62k|            return;
  657|  6.32k|        rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);
  658|  6.32k|        rr += 4;
  659|  6.32k|        r += 4;
  660|  6.32k|        b += 4;
  661|  6.32k|    }
  662|  25.5k|}

BN_nist_mod_224:
  489|  3.17k|{
  490|  3.17k|    int top = a->top, i;
  491|  3.17k|    int carry;
  492|  3.17k|    BN_ULONG *r_d, *a_d = a->d;
  ------------------
  |  |   37|  3.17k|#  define BN_ULONG        unsigned long
  ------------------
  493|  3.17k|    union {
  494|  3.17k|        BN_ULONG bn[BN_NIST_224_TOP];
  495|  3.17k|        unsigned int ui[BN_NIST_224_TOP * sizeof(BN_ULONG) /
  496|  3.17k|                        sizeof(unsigned int)];
  497|  3.17k|    } buf;
  498|  3.17k|    BN_ULONG c_d[BN_NIST_224_TOP], *res;
  ------------------
  |  |   37|  3.17k|#  define BN_ULONG        unsigned long
  ------------------
  499|  3.17k|    bn_addsub_f adjust;
  500|  3.17k|    static const BIGNUM ossl_bignum_nist_p_224_sqr = {
  501|  3.17k|        (BN_ULONG *)_nist_p_224_sqr,
  502|  3.17k|        OSSL_NELEM(_nist_p_224_sqr),
  ------------------
  |  |   14|  3.17k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  503|  3.17k|        OSSL_NELEM(_nist_p_224_sqr),
  ------------------
  |  |   14|  3.17k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  504|  3.17k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  3.17k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  505|  3.17k|    };
  506|       |
  507|  3.17k|    field = &ossl_bignum_nist_p_224; /* just to make sure */
  508|       |
  509|  3.17k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_224_sqr) >= 0)
  ------------------
  |  Branch (509:9): [True: 0, False: 3.17k]
  |  Branch (509:30): [True: 0, False: 3.17k]
  ------------------
  510|      0|        return BN_nnmod(r, a, field, ctx);
  511|       |
  512|  3.17k|    i = BN_ucmp(field, a);
  513|  3.17k|    if (i == 0) {
  ------------------
  |  Branch (513:9): [True: 0, False: 3.17k]
  ------------------
  514|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  515|      0|        return 1;
  516|  3.17k|    } else if (i > 0)
  ------------------
  |  Branch (516:16): [True: 0, False: 3.17k]
  ------------------
  517|      0|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (517:16): [True: 0, False: 0]
  ------------------
  518|       |
  519|  3.17k|    if (r != a) {
  ------------------
  |  Branch (519:9): [True: 0, False: 3.17k]
  ------------------
  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.17k|        r_d = a_d;
  526|       |
  527|  3.17k|#if BN_BITS2==64
  528|       |    /* copy upper 256 bits of 448 bit number ... */
  529|  3.17k|    nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),
  ------------------
  |  |  265|  3.17k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  3.17k|{                                           \
  |  |  267|  3.17k|    int ii;                                 \
  |  |  268|  3.17k|    const BN_ULONG *src = src_in;           \
  |  |  269|  3.17k|                                            \
  |  |  270|  15.8k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 12.7k, False: 3.17k]
  |  |  ------------------
  |  |  271|  12.7k|        (dst)[ii] = src[ii];                \
  |  |  272|  3.17k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 0, False: 3.17k]
  |  |  ------------------
  |  |  273|  3.17k|        (dst)[ii] = 0;                      \
  |  |  274|  3.17k|}
  ------------------
  530|  3.17k|                 top - (BN_NIST_224_TOP - 1), BN_NIST_224_TOP);
  531|       |    /* ... and right shift by 32 to obtain upper 224 bits */
  532|  3.17k|    nist_set_224(buf.bn, c_d, 14, 13, 12, 11, 10, 9, 8);
  ------------------
  |  |  477|  3.17k|        { \
  |  |  478|  3.17k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        }
  ------------------
  533|       |    /* truncate lower part to 224 bits too */
  534|  3.17k|    r_d[BN_NIST_224_TOP - 1] &= BN_MASK2l;
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r_d[BN_NIST_224_TOP - 1] &= BN_MASK2l;
  ------------------
  |  |   95|  3.17k|#  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.17k|    {
  597|  3.17k|        BN_ULONG t_d[BN_NIST_224_TOP];
  ------------------
  |  |   37|  3.17k|#  define BN_ULONG        unsigned long
  ------------------
  598|       |
  599|  3.17k|        nist_set_224(t_d, buf.bn, 10, 9, 8, 7, 0, 0, 0);
  ------------------
  |  |  477|  3.17k|        { \
  |  |  478|  3.17k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  3.17k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        }
  ------------------
  600|  3.17k|        carry = (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|  3.17k|        nist_set_224(t_d, buf.bn, 0, 13, 12, 11, 0, 0, 0);
  ------------------
  |  |  477|  3.17k|        { \
  |  |  478|  3.17k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  480|  3.17k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(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.17k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        }
  ------------------
  602|  3.17k|        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  3.17k|        nist_set_224(t_d, buf.bn, 13, 12, 11, 10, 9, 8, 7);
  ------------------
  |  |  477|  3.17k|        { \
  |  |  478|  3.17k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  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.17k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.17k|                                                :(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.17k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  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.17k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.17k|                                                :(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.17k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  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.17k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.17k|                                                :(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.17k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  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.17k|        }
  ------------------
  604|  3.17k|        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  3.17k|        nist_set_224(t_d, buf.bn, 0, 0, 0, 0, 13, 12, 11);
  ------------------
  |  |  477|  3.17k|        { \
  |  |  478|  3.17k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  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.17k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.17k|                                                :(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.17k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  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.17k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  482|  3.17k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  3.17k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  484|  3.17k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  3.17k|# 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.17k|# 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.17k|        }
  ------------------
  606|  3.17k|        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|       |
  608|  3.17k|# if BN_BITS2==64
  609|  3.17k|        carry = (int)(r_d[BN_NIST_224_TOP - 1] >> 32);
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|  3.17k|# endif
  611|  3.17k|    }
  612|  3.17k|#endif
  613|  3.17k|    adjust = bn_sub_words;
  614|  3.17k|    if (carry > 0) {
  ------------------
  |  Branch (614:9): [True: 2.11k, False: 1.05k]
  ------------------
  615|  2.11k|        carry =
  616|  2.11k|            (int)bn_sub_words(r_d, r_d, _nist_p_224[carry - 1],
  617|  2.11k|                              BN_NIST_224_TOP);
  ------------------
  |  |   14|  2.11k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.11k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.11k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.11k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.11k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|  2.11k|#if BN_BITS2==64
  619|  2.11k|        carry = (int)(~(r_d[BN_NIST_224_TOP - 1] >> 32)) & 1;
  ------------------
  |  |   14|  2.11k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.11k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.11k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  2.11k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  2.11k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|  2.11k|#endif
  621|  2.11k|    } else if (carry < 0) {
  ------------------
  |  Branch (621:16): [True: 0, False: 1.05k]
  ------------------
  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|      0|        carry =
  630|      0|            (int)bn_add_words(r_d, r_d, _nist_p_224[-carry - 1],
  631|      0|                              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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|      0|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (632:18): [True: 0, False: 0]
  ------------------
  633|      0|    } else
  634|  1.05k|        carry = 1;
  635|       |
  636|       |    /* otherwise it's effectively same as in BN_nist_mod_192... */
  637|  3.17k|    res = ((*adjust) (c_d, r_d, _nist_p_224[0], BN_NIST_224_TOP) && carry)
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (637:12): [True: 3.17k, False: 0]
  |  Branch (637:69): [True: 3.17k, False: 0]
  ------------------
  638|  3.17k|        ? r_d
  639|  3.17k|        : c_d;
  640|  3.17k|    nist_cp_bn(r_d, res, BN_NIST_224_TOP);
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  641|  3.17k|    r->top = BN_NIST_224_TOP;
  ------------------
  |  |   14|  3.17k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.17k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.17k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  642|  3.17k|    bn_correct_top(r);
  643|       |
  644|  3.17k|    return 1;
  645|  3.17k|}
BN_nist_mod_384:
  898|  4.85k|{
  899|  4.85k|    int i, top = a->top;
  900|  4.85k|    int carry = 0;
  901|  4.85k|    register BN_ULONG *r_d, *a_d = a->d;
  902|  4.85k|    union {
  903|  4.85k|        BN_ULONG bn[BN_NIST_384_TOP];
  904|  4.85k|        unsigned int ui[BN_NIST_384_TOP * sizeof(BN_ULONG) /
  905|  4.85k|                        sizeof(unsigned int)];
  906|  4.85k|    } buf;
  907|  4.85k|    BN_ULONG c_d[BN_NIST_384_TOP], *res;
  ------------------
  |  |   37|  4.85k|#  define BN_ULONG        unsigned long
  ------------------
  908|  4.85k|    bn_addsub_f adjust;
  909|  4.85k|    static const BIGNUM ossl_bignum_nist_p_384_sqr = {
  910|  4.85k|        (BN_ULONG *)_nist_p_384_sqr,
  911|  4.85k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|  4.85k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  912|  4.85k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|  4.85k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  913|  4.85k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  4.85k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  914|  4.85k|    };
  915|       |
  916|  4.85k|    field = &ossl_bignum_nist_p_384; /* just to make sure */
  917|       |
  918|  4.85k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_384_sqr) >= 0)
  ------------------
  |  Branch (918:9): [True: 0, False: 4.85k]
  |  Branch (918:30): [True: 0, False: 4.85k]
  ------------------
  919|      0|        return BN_nnmod(r, a, field, ctx);
  920|       |
  921|  4.85k|    i = BN_ucmp(field, a);
  922|  4.85k|    if (i == 0) {
  ------------------
  |  Branch (922:9): [True: 0, False: 4.85k]
  ------------------
  923|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  924|      0|        return 1;
  925|  4.85k|    } else if (i > 0)
  ------------------
  |  Branch (925:16): [True: 0, False: 4.85k]
  ------------------
  926|      0|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (926:16): [True: 0, False: 0]
  ------------------
  927|       |
  928|  4.85k|    if (r != a) {
  ------------------
  |  Branch (928:9): [True: 0, False: 4.85k]
  ------------------
  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|  4.85k|        r_d = a_d;
  935|       |
  936|  4.85k|    nist_cp_bn_0(buf.bn, a_d + BN_NIST_384_TOP, top - BN_NIST_384_TOP,
  ------------------
  |  |  265|  4.85k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  4.85k|{                                           \
  |  |  267|  4.85k|    int ii;                                 \
  |  |  268|  4.85k|    const BN_ULONG *src = src_in;           \
  |  |  269|  4.85k|                                            \
  |  |  270|  33.9k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 29.1k, False: 4.85k]
  |  |  ------------------
  |  |  271|  29.1k|        (dst)[ii] = src[ii];                \
  |  |  272|  4.85k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 0, False: 4.85k]
  |  |  ------------------
  |  |  273|  4.85k|        (dst)[ii] = 0;                      \
  |  |  274|  4.85k|}
  ------------------
  937|  4.85k|                 BN_NIST_384_TOP);
  938|       |
  939|  4.85k|#if defined(NIST_INT64)
  940|  4.85k|    {
  941|  4.85k|        NIST_INT64 acc;         /* accumulator */
  ------------------
  |  |  299|  4.85k|#   define NIST_INT64 long long
  ------------------
  942|  4.85k|        unsigned int *rp = (unsigned int *)r_d;
  943|  4.85k|        const unsigned int *bp = (const unsigned int *)buf.ui;
  944|       |
  945|  4.85k|        acc = load_u32(&rp[0]);
  946|  4.85k|        acc += bp[12 - 12];
  947|  4.85k|        acc += bp[21 - 12];
  948|  4.85k|        acc += bp[20 - 12];
  949|  4.85k|        acc -= bp[23 - 12];
  950|  4.85k|        store_lo32(&rp[0], acc);
  951|  4.85k|        acc >>= 32;
  952|       |
  953|  4.85k|        acc += load_u32(&rp[1]);
  954|  4.85k|        acc += bp[13 - 12];
  955|  4.85k|        acc += bp[22 - 12];
  956|  4.85k|        acc += bp[23 - 12];
  957|  4.85k|        acc -= bp[12 - 12];
  958|  4.85k|        acc -= bp[20 - 12];
  959|  4.85k|        store_lo32(&rp[1], acc);
  960|  4.85k|        acc >>= 32;
  961|       |
  962|  4.85k|        acc += load_u32(&rp[2]);
  963|  4.85k|        acc += bp[14 - 12];
  964|  4.85k|        acc += bp[23 - 12];
  965|  4.85k|        acc -= bp[13 - 12];
  966|  4.85k|        acc -= bp[21 - 12];
  967|  4.85k|        store_lo32(&rp[2], acc);
  968|  4.85k|        acc >>= 32;
  969|       |
  970|  4.85k|        acc += load_u32(&rp[3]);
  971|  4.85k|        acc += bp[15 - 12];
  972|  4.85k|        acc += bp[12 - 12];
  973|  4.85k|        acc += bp[20 - 12];
  974|  4.85k|        acc += bp[21 - 12];
  975|  4.85k|        acc -= bp[14 - 12];
  976|  4.85k|        acc -= bp[22 - 12];
  977|  4.85k|        acc -= bp[23 - 12];
  978|  4.85k|        store_lo32(&rp[3], acc);
  979|  4.85k|        acc >>= 32;
  980|       |
  981|  4.85k|        acc += load_u32(&rp[4]);
  982|  4.85k|        acc += bp[21 - 12];
  983|  4.85k|        acc += bp[21 - 12];
  984|  4.85k|        acc += bp[16 - 12];
  985|  4.85k|        acc += bp[13 - 12];
  986|  4.85k|        acc += bp[12 - 12];
  987|  4.85k|        acc += bp[20 - 12];
  988|  4.85k|        acc += bp[22 - 12];
  989|  4.85k|        acc -= bp[15 - 12];
  990|  4.85k|        acc -= bp[23 - 12];
  991|  4.85k|        acc -= bp[23 - 12];
  992|  4.85k|        store_lo32(&rp[4], acc);
  993|  4.85k|        acc >>= 32;
  994|       |
  995|  4.85k|        acc += load_u32(&rp[5]);
  996|  4.85k|        acc += bp[22 - 12];
  997|  4.85k|        acc += bp[22 - 12];
  998|  4.85k|        acc += bp[17 - 12];
  999|  4.85k|        acc += bp[14 - 12];
 1000|  4.85k|        acc += bp[13 - 12];
 1001|  4.85k|        acc += bp[21 - 12];
 1002|  4.85k|        acc += bp[23 - 12];
 1003|  4.85k|        acc -= bp[16 - 12];
 1004|  4.85k|        store_lo32(&rp[5], acc);
 1005|  4.85k|        acc >>= 32;
 1006|       |
 1007|  4.85k|        acc += load_u32(&rp[6]);
 1008|  4.85k|        acc += bp[23 - 12];
 1009|  4.85k|        acc += bp[23 - 12];
 1010|  4.85k|        acc += bp[18 - 12];
 1011|  4.85k|        acc += bp[15 - 12];
 1012|  4.85k|        acc += bp[14 - 12];
 1013|  4.85k|        acc += bp[22 - 12];
 1014|  4.85k|        acc -= bp[17 - 12];
 1015|  4.85k|        store_lo32(&rp[6], acc);
 1016|  4.85k|        acc >>= 32;
 1017|       |
 1018|  4.85k|        acc += load_u32(&rp[7]);
 1019|  4.85k|        acc += bp[19 - 12];
 1020|  4.85k|        acc += bp[16 - 12];
 1021|  4.85k|        acc += bp[15 - 12];
 1022|  4.85k|        acc += bp[23 - 12];
 1023|  4.85k|        acc -= bp[18 - 12];
 1024|  4.85k|        store_lo32(&rp[7], acc);
 1025|  4.85k|        acc >>= 32;
 1026|       |
 1027|  4.85k|        acc += load_u32(&rp[8]);
 1028|  4.85k|        acc += bp[20 - 12];
 1029|  4.85k|        acc += bp[17 - 12];
 1030|  4.85k|        acc += bp[16 - 12];
 1031|  4.85k|        acc -= bp[19 - 12];
 1032|  4.85k|        store_lo32(&rp[8], acc);
 1033|  4.85k|        acc >>= 32;
 1034|       |
 1035|  4.85k|        acc += load_u32(&rp[9]);
 1036|  4.85k|        acc += bp[21 - 12];
 1037|  4.85k|        acc += bp[18 - 12];
 1038|  4.85k|        acc += bp[17 - 12];
 1039|  4.85k|        acc -= bp[20 - 12];
 1040|  4.85k|        store_lo32(&rp[9], acc);
 1041|  4.85k|        acc >>= 32;
 1042|       |
 1043|  4.85k|        acc += load_u32(&rp[10]);
 1044|  4.85k|        acc += bp[22 - 12];
 1045|  4.85k|        acc += bp[19 - 12];
 1046|  4.85k|        acc += bp[18 - 12];
 1047|  4.85k|        acc -= bp[21 - 12];
 1048|  4.85k|        store_lo32(&rp[10], acc);
 1049|  4.85k|        acc >>= 32;
 1050|       |
 1051|  4.85k|        acc += load_u32(&rp[11]);
 1052|  4.85k|        acc += bp[23 - 12];
 1053|  4.85k|        acc += bp[20 - 12];
 1054|  4.85k|        acc += bp[19 - 12];
 1055|  4.85k|        acc -= bp[22 - 12];
 1056|  4.85k|        store_lo32(&rp[11], acc);
 1057|       |
 1058|  4.85k|        carry = (int)(acc >> 32);
 1059|  4.85k|    }
 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|  4.85k|    adjust = bn_sub_words;
 1130|  4.85k|    if (carry > 0)
  ------------------
  |  Branch (1130:9): [True: 3.23k, False: 1.61k]
  ------------------
 1131|  3.23k|        carry =
 1132|  3.23k|            (int)bn_sub_words(r_d, r_d, _nist_p_384[carry - 1],
 1133|  3.23k|                              BN_NIST_384_TOP);
  ------------------
  |  |   16|  3.23k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.23k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.23k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.23k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.23k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1134|  1.61k|    else if (carry < 0) {
  ------------------
  |  Branch (1134:14): [True: 0, False: 1.61k]
  ------------------
 1135|      0|        carry =
 1136|      0|            (int)bn_add_words(r_d, r_d, _nist_p_384[-carry - 1],
 1137|      0|                              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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1138|      0|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (1138:18): [True: 0, False: 0]
  ------------------
 1139|      0|    } else
 1140|  1.61k|        carry = 1;
 1141|       |
 1142|  4.85k|    res = ((*adjust) (c_d, r_d, _nist_p_384[0], BN_NIST_384_TOP) && carry)
  ------------------
  |  |   16|  4.85k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.85k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.85k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.85k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.85k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1142:12): [True: 4.85k, False: 0]
  |  Branch (1142:69): [True: 4.85k, False: 0]
  ------------------
 1143|  4.85k|        ? r_d
 1144|  4.85k|        : c_d;
 1145|  4.85k|    nist_cp_bn(r_d, res, BN_NIST_384_TOP);
  ------------------
  |  |   16|  4.85k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.85k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.85k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.85k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.85k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|  4.85k|    r->top = BN_NIST_384_TOP;
  ------------------
  |  |   16|  4.85k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.85k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.85k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.85k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.85k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1147|  4.85k|    bn_correct_top(r);
 1148|       |
 1149|  4.85k|    return 1;
 1150|  4.85k|}
BN_nist_mod_521:
 1158|  8.74k|{
 1159|  8.74k|    int top = a->top, i;
 1160|  8.74k|    BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val, tmp, *res;
  ------------------
  |  |   37|  8.74k|#  define BN_ULONG        unsigned long
  ------------------
 1161|  8.74k|    static const BIGNUM ossl_bignum_nist_p_521_sqr = {
 1162|  8.74k|        (BN_ULONG *)_nist_p_521_sqr,
 1163|  8.74k|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|  8.74k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1164|  8.74k|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|  8.74k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1165|  8.74k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  8.74k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
 1166|  8.74k|    };
 1167|       |
 1168|  8.74k|    field = &ossl_bignum_nist_p_521; /* just to make sure */
 1169|       |
 1170|  8.74k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_521_sqr) >= 0)
  ------------------
  |  Branch (1170:9): [True: 0, False: 8.74k]
  |  Branch (1170:30): [True: 0, False: 8.74k]
  ------------------
 1171|      0|        return BN_nnmod(r, a, field, ctx);
 1172|       |
 1173|  8.74k|    i = BN_ucmp(field, a);
 1174|  8.74k|    if (i == 0) {
  ------------------
  |  Branch (1174:9): [True: 0, False: 8.74k]
  ------------------
 1175|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1176|      0|        return 1;
 1177|  8.74k|    } else if (i > 0)
  ------------------
  |  Branch (1177:16): [True: 25, False: 8.71k]
  ------------------
 1178|     25|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (1178:16): [True: 25, False: 0]
  ------------------
 1179|       |
 1180|  8.71k|    if (r != a) {
  ------------------
  |  Branch (1180:9): [True: 0, False: 8.71k]
  ------------------
 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|  8.71k|        r_d = a_d;
 1187|       |
 1188|       |    /* upper 521 bits, copy ... */
 1189|  8.71k|    nist_cp_bn_0(t_d, a_d + (BN_NIST_521_TOP - 1),
  ------------------
  |  |  265|  8.71k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  8.71k|{                                           \
  |  |  267|  8.71k|    int ii;                                 \
  |  |  268|  8.71k|    const BN_ULONG *src = src_in;           \
  |  |  269|  8.71k|                                            \
  |  |  270|  83.8k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 75.1k, False: 8.71k]
  |  |  ------------------
  |  |  271|  75.1k|        (dst)[ii] = src[ii];                \
  |  |  272|  12.0k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 3.32k, False: 8.71k]
  |  |  ------------------
  |  |  273|  8.71k|        (dst)[ii] = 0;                      \
  |  |  274|  8.71k|}
  ------------------
 1190|  8.71k|                 top - (BN_NIST_521_TOP - 1), BN_NIST_521_TOP);
 1191|       |    /* ... and right shift */
 1192|  78.4k|    for (val = t_d[0], i = 0; i < BN_NIST_521_TOP - 1; i++) {
  ------------------
  |  |   17|  78.4k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  78.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  78.4k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  78.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  78.4k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1192:31): [True: 69.7k, False: 8.71k]
  ------------------
 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|  69.7k|        t_d[i] = (val >> BN_NIST_521_RSHIFT |
  ------------------
  |  | 1152|  69.7k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|  69.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  69.7k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1204|  69.7k|                  (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  | 1153|  69.7k|#define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  |   54|  69.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  69.7k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  | 1152|  69.7k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|  69.7k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|  69.7k|#  define BN_BYTES        8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  |   94|  69.7k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
 1205|  69.7k|        val = tmp;
 1206|  69.7k|#endif
 1207|  69.7k|    }
 1208|  8.71k|    t_d[i] = val >> BN_NIST_521_RSHIFT;
  ------------------
  |  | 1152|  8.71k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1209|       |    /* lower 521 bits */
 1210|  8.71k|    r_d[i] &= BN_NIST_521_TOP_MASK;
  ------------------
  |  | 1154|  8.71k|#define BN_NIST_521_TOP_MASK    ((BN_ULONG)BN_MASK2>>BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  |   94|  8.71k|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP_MASK    ((BN_ULONG)BN_MASK2>>BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  | 1153|  8.71k|#define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1152|  8.71k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1211|       |
 1212|  8.71k|    bn_add_words(r_d, r_d, t_d, BN_NIST_521_TOP);
  ------------------
  |  |   17|  8.71k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1213|  8.71k|    res = bn_sub_words(t_d, r_d, _nist_p_521,
  ------------------
  |  Branch (1213:11): [True: 8.62k, False: 94]
  ------------------
 1214|  8.71k|                       BN_NIST_521_TOP)
  ------------------
  |  |   17|  8.71k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1215|  8.71k|        ? r_d
 1216|  8.71k|        : t_d;
 1217|  8.71k|    nist_cp_bn(r_d, res, BN_NIST_521_TOP);
  ------------------
  |  |   17|  8.71k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  8.71k|    r->top = BN_NIST_521_TOP;
  ------------------
  |  |   17|  8.71k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  8.71k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  8.71k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1219|  8.71k|    bn_correct_top(r);
 1220|       |
 1221|  8.71k|    return 1;
 1222|  8.71k|}
bn_nist.c:nist_cp_bn:
  277|  16.7k|{
  278|  16.7k|    int i;
  279|       |
  280|   137k|    for (i = 0; i < top; i++)
  ------------------
  |  Branch (280:17): [True: 120k, False: 16.7k]
  ------------------
  281|   120k|        dst[i] = src[i];
  282|  16.7k|}
bn_nist.c:load_u32:
  326|  58.2k|{
  327|  58.2k|    uint32_t tmp;
  328|       |
  329|  58.2k|    memcpy(&tmp, ptr, sizeof(tmp));
  330|  58.2k|    return tmp;
  331|  58.2k|}
bn_nist.c:store_lo32:
  334|  58.2k|{
  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|  58.2k|    uint32_t tmp = (uint32_t)val;
  339|       |
  340|  58.2k|    memcpy(ptr, &tmp, sizeof(tmp));
  341|  58.2k|}

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

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

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

BN_mod_sqrt:
   20|  5.52k|{
   21|  5.52k|    BIGNUM *ret = in;
   22|  5.52k|    int err = 1;
   23|  5.52k|    int r;
   24|  5.52k|    BIGNUM *A, *b, *q, *t, *x, *y;
   25|  5.52k|    int e, i, j;
   26|  5.52k|    int used_ctx = 0;
   27|       |
   28|  5.52k|    if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 5.52k]
  |  Branch (28:26): [True: 0, False: 5.52k]
  ------------------
   29|      0|        if (BN_abs_is_word(p, 2)) {
  ------------------
  |  Branch (29:13): [True: 0, False: 0]
  ------------------
   30|      0|            if (ret == NULL)
  ------------------
  |  Branch (30:17): [True: 0, False: 0]
  ------------------
   31|      0|                ret = BN_new();
   32|      0|            if (ret == NULL)
  ------------------
  |  Branch (32:17): [True: 0, False: 0]
  ------------------
   33|      0|                goto end;
   34|      0|            if (!BN_set_word(ret, BN_is_bit_set(a, 0))) {
  ------------------
  |  Branch (34:17): [True: 0, False: 0]
  ------------------
   35|      0|                if (ret != in)
  ------------------
  |  Branch (35:21): [True: 0, False: 0]
  ------------------
   36|      0|                    BN_free(ret);
   37|      0|                return NULL;
   38|      0|            }
   39|      0|            bn_check_top(ret);
   40|      0|            return ret;
   41|      0|        }
   42|       |
   43|      0|        ERR_raise(ERR_LIB_BN, BN_R_P_IS_NOT_PRIME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|  5.52k|    if (BN_is_zero(a) || BN_is_one(a)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 5.52k]
  |  Branch (47:26): [True: 0, False: 5.52k]
  ------------------
   48|      0|        if (ret == NULL)
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|            ret = BN_new();
   50|      0|        if (ret == NULL)
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|            goto end;
   52|      0|        if (!BN_set_word(ret, BN_is_one(a))) {
  ------------------
  |  Branch (52:13): [True: 0, False: 0]
  ------------------
   53|      0|            if (ret != in)
  ------------------
  |  Branch (53:17): [True: 0, False: 0]
  ------------------
   54|      0|                BN_free(ret);
   55|      0|            return NULL;
   56|      0|        }
   57|      0|        bn_check_top(ret);
   58|      0|        return ret;
   59|      0|    }
   60|       |
   61|  5.52k|    BN_CTX_start(ctx);
   62|  5.52k|    used_ctx = 1;
   63|  5.52k|    A = BN_CTX_get(ctx);
   64|  5.52k|    b = BN_CTX_get(ctx);
   65|  5.52k|    q = BN_CTX_get(ctx);
   66|  5.52k|    t = BN_CTX_get(ctx);
   67|  5.52k|    x = BN_CTX_get(ctx);
   68|  5.52k|    y = BN_CTX_get(ctx);
   69|  5.52k|    if (y == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 5.52k]
  ------------------
   70|      0|        goto end;
   71|       |
   72|  5.52k|    if (ret == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 5.52k]
  ------------------
   73|      0|        ret = BN_new();
   74|  5.52k|    if (ret == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 5.52k]
  ------------------
   75|      0|        goto end;
   76|       |
   77|       |    /* A = a mod p */
   78|  5.52k|    if (!BN_nnmod(A, a, p, ctx))
  ------------------
  |  Branch (78:9): [True: 0, False: 5.52k]
  ------------------
   79|      0|        goto end;
   80|       |
   81|       |    /* now write  |p| - 1  as  2^e*q  where  q  is odd */
   82|  5.52k|    e = 1;
   83|  5.52k|    while (!BN_is_bit_set(p, e))
  ------------------
  |  Branch (83:12): [True: 0, False: 5.52k]
  ------------------
   84|      0|        e++;
   85|       |    /* we'll set  q  later (if needed) */
   86|       |
   87|  5.52k|    if (e == 1) {
  ------------------
  |  Branch (87:9): [True: 5.52k, False: 0]
  ------------------
   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|  5.52k|        if (!BN_rshift(q, p, 2))
  ------------------
  |  Branch (96:13): [True: 0, False: 5.52k]
  ------------------
   97|      0|            goto end;
   98|  5.52k|        q->neg = 0;
   99|  5.52k|        if (!BN_add_word(q, 1))
  ------------------
  |  Branch (99:13): [True: 0, False: 5.52k]
  ------------------
  100|      0|            goto end;
  101|  5.52k|        if (!BN_mod_exp(ret, A, q, p, ctx))
  ------------------
  |  Branch (101:13): [True: 0, False: 5.52k]
  ------------------
  102|      0|            goto end;
  103|  5.52k|        err = 0;
  104|  5.52k|        goto vrfy;
  105|  5.52k|    }
  106|       |
  107|      0|    if (e == 2) {
  ------------------
  |  Branch (107:9): [True: 0, False: 0]
  ------------------
  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|      0|        if (!BN_mod_lshift1_quick(t, A, p))
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  ------------------
  138|      0|            goto end;
  139|       |
  140|       |        /* b := (2*a)^((|p|-5)/8) */
  141|      0|        if (!BN_rshift(q, p, 3))
  ------------------
  |  Branch (141:13): [True: 0, False: 0]
  ------------------
  142|      0|            goto end;
  143|      0|        q->neg = 0;
  144|      0|        if (!BN_mod_exp(b, t, q, p, ctx))
  ------------------
  |  Branch (144:13): [True: 0, False: 0]
  ------------------
  145|      0|            goto end;
  146|       |
  147|       |        /* y := b^2 */
  148|      0|        if (!BN_mod_sqr(y, b, p, ctx))
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            goto end;
  150|       |
  151|       |        /* t := (2*a)*b^2 - 1 */
  152|      0|        if (!BN_mod_mul(t, t, y, p, ctx))
  ------------------
  |  Branch (152:13): [True: 0, False: 0]
  ------------------
  153|      0|            goto end;
  154|      0|        if (!BN_sub_word(t, 1))
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            goto end;
  156|       |
  157|       |        /* x = a*b*t */
  158|      0|        if (!BN_mod_mul(x, A, b, p, ctx))
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            goto end;
  160|      0|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (160:13): [True: 0, False: 0]
  ------------------
  161|      0|            goto end;
  162|       |
  163|      0|        if (!BN_copy(ret, x))
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|            goto end;
  165|      0|        err = 0;
  166|      0|        goto vrfy;
  167|      0|    }
  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|      0|    if (!BN_copy(q, p))
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  ------------------
  174|      0|        goto end;               /* use 'q' as temp */
  175|      0|    q->neg = 0;
  176|      0|    i = 2;
  177|      0|    do {
  178|       |        /*
  179|       |         * For efficiency, try small numbers first; if this fails, try random
  180|       |         * numbers.
  181|       |         */
  182|      0|        if (i < 22) {
  ------------------
  |  Branch (182:13): [True: 0, False: 0]
  ------------------
  183|      0|            if (!BN_set_word(y, i))
  ------------------
  |  Branch (183:17): [True: 0, False: 0]
  ------------------
  184|      0|                goto end;
  185|      0|        } else {
  186|      0|            if (!BN_priv_rand_ex(y, BN_num_bits(p), 0, 0, 0, ctx))
  ------------------
  |  Branch (186:17): [True: 0, False: 0]
  ------------------
  187|      0|                goto end;
  188|      0|            if (BN_ucmp(y, p) >= 0) {
  ------------------
  |  Branch (188:17): [True: 0, False: 0]
  ------------------
  189|      0|                if (!(p->neg ? BN_add : BN_sub) (y, y, p))
  ------------------
  |  Branch (189:21): [True: 0, False: 0]
  |  Branch (189:23): [True: 0, False: 0]
  ------------------
  190|      0|                    goto end;
  191|      0|            }
  192|       |            /* now 0 <= y < |p| */
  193|      0|            if (BN_is_zero(y))
  ------------------
  |  Branch (193:17): [True: 0, False: 0]
  ------------------
  194|      0|                if (!BN_set_word(y, i))
  ------------------
  |  Branch (194:21): [True: 0, False: 0]
  ------------------
  195|      0|                    goto end;
  196|      0|        }
  197|       |
  198|      0|        r = BN_kronecker(y, q, ctx); /* here 'q' is |p| */
  199|      0|        if (r < -1)
  ------------------
  |  Branch (199:13): [True: 0, False: 0]
  ------------------
  200|      0|            goto end;
  201|      0|        if (r == 0) {
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  ------------------
  202|       |            /* m divides p */
  203|      0|            ERR_raise(ERR_LIB_BN, BN_R_P_IS_NOT_PRIME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|            goto end;
  205|      0|        }
  206|      0|    }
  207|      0|    while (r == 1 && ++i < 82);
  ------------------
  |  Branch (207:12): [True: 0, False: 0]
  |  Branch (207:22): [True: 0, False: 0]
  ------------------
  208|       |
  209|      0|    if (r != -1) {
  ------------------
  |  Branch (209:9): [True: 0, False: 0]
  ------------------
  210|       |        /*
  211|       |         * Many rounds and still no non-square -- this is more likely a bug
  212|       |         * than just bad luck. Even if p is not prime, we should have found
  213|       |         * some y such that r == -1.
  214|       |         */
  215|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|        goto end;
  217|      0|    }
  218|       |
  219|       |    /* Here's our actual 'q': */
  220|      0|    if (!BN_rshift(q, q, e))
  ------------------
  |  Branch (220:9): [True: 0, False: 0]
  ------------------
  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|      0|    if (!BN_mod_exp(y, y, q, p, ctx))
  ------------------
  |  Branch (227:9): [True: 0, False: 0]
  ------------------
  228|      0|        goto end;
  229|      0|    if (BN_is_one(y)) {
  ------------------
  |  Branch (229:9): [True: 0, False: 0]
  ------------------
  230|      0|        ERR_raise(ERR_LIB_BN, BN_R_P_IS_NOT_PRIME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  231|      0|        goto end;
  232|      0|    }
  233|       |
  234|       |    /*-
  235|       |     * Now we know that (if  p  is indeed prime) there is an integer
  236|       |     * k,  0 <= k < 2^e,  such that
  237|       |     *
  238|       |     *      a^q * y^k == 1   (mod p).
  239|       |     *
  240|       |     * As  a^q  is a square and  y  is not,  k  must be even.
  241|       |     * q+1  is even, too, so there is an element
  242|       |     *
  243|       |     *     X := a^((q+1)/2) * y^(k/2),
  244|       |     *
  245|       |     * and it satisfies
  246|       |     *
  247|       |     *     X^2 = a^q * a     * y^k
  248|       |     *         = a,
  249|       |     *
  250|       |     * so it is the square root that we are looking for.
  251|       |     */
  252|       |
  253|       |    /* t := (q-1)/2  (note that  q  is odd) */
  254|      0|    if (!BN_rshift1(t, q))
  ------------------
  |  Branch (254:9): [True: 0, False: 0]
  ------------------
  255|      0|        goto end;
  256|       |
  257|       |    /* x := a^((q-1)/2) */
  258|      0|    if (BN_is_zero(t)) {        /* special case: p = 2^e + 1 */
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|      0|        if (!BN_nnmod(t, A, p, ctx))
  ------------------
  |  Branch (259:13): [True: 0, False: 0]
  ------------------
  260|      0|            goto end;
  261|      0|        if (BN_is_zero(t)) {
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|       |            /* special case: a == 0  (mod p) */
  263|      0|            BN_zero(ret);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  264|      0|            err = 0;
  265|      0|            goto end;
  266|      0|        } else if (!BN_one(x))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (266:20): [True: 0, False: 0]
  ------------------
  267|      0|            goto end;
  268|      0|    } else {
  269|      0|        if (!BN_mod_exp(x, A, t, p, ctx))
  ------------------
  |  Branch (269:13): [True: 0, False: 0]
  ------------------
  270|      0|            goto end;
  271|      0|        if (BN_is_zero(x)) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  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|      0|    }
  278|       |
  279|       |    /* b := a*x^2  (= a^q) */
  280|      0|    if (!BN_mod_sqr(b, x, p, ctx))
  ------------------
  |  Branch (280:9): [True: 0, False: 0]
  ------------------
  281|      0|        goto end;
  282|      0|    if (!BN_mod_mul(b, b, A, p, ctx))
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        goto end;
  284|       |
  285|       |    /* x := a*x    (= a^((q+1)/2)) */
  286|      0|    if (!BN_mod_mul(x, x, A, p, ctx))
  ------------------
  |  Branch (286:9): [True: 0, False: 0]
  ------------------
  287|      0|        goto end;
  288|       |
  289|      0|    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|      0|        if (BN_is_one(b)) {
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  ------------------
  301|      0|            if (!BN_copy(ret, x))
  ------------------
  |  Branch (301:17): [True: 0, False: 0]
  ------------------
  302|      0|                goto end;
  303|      0|            err = 0;
  304|      0|            goto vrfy;
  305|      0|        }
  306|       |
  307|       |        /* Find the smallest i, 0 < i < e, such that b^(2^i) = 1. */
  308|      0|        for (i = 1; i < e; i++) {
  ------------------
  |  Branch (308:21): [True: 0, False: 0]
  ------------------
  309|      0|            if (i == 1) {
  ------------------
  |  Branch (309:17): [True: 0, False: 0]
  ------------------
  310|      0|                if (!BN_mod_sqr(t, b, p, ctx))
  ------------------
  |  Branch (310:21): [True: 0, False: 0]
  ------------------
  311|      0|                    goto end;
  312|       |
  313|      0|            } else {
  314|      0|                if (!BN_mod_mul(t, t, t, p, ctx))
  ------------------
  |  Branch (314:21): [True: 0, False: 0]
  ------------------
  315|      0|                    goto end;
  316|      0|            }
  317|      0|            if (BN_is_one(t))
  ------------------
  |  Branch (317:17): [True: 0, False: 0]
  ------------------
  318|      0|                break;
  319|      0|        }
  320|       |        /* If not found, a is not a square or p is not prime. */
  321|      0|        if (i >= e) {
  ------------------
  |  Branch (321:13): [True: 0, False: 0]
  ------------------
  322|      0|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|      0|            goto end;
  324|      0|        }
  325|       |
  326|       |        /* t := y^2^(e - i - 1) */
  327|      0|        if (!BN_copy(t, y))
  ------------------
  |  Branch (327:13): [True: 0, False: 0]
  ------------------
  328|      0|            goto end;
  329|      0|        for (j = e - i - 1; j > 0; j--) {
  ------------------
  |  Branch (329:29): [True: 0, False: 0]
  ------------------
  330|      0|            if (!BN_mod_sqr(t, t, p, ctx))
  ------------------
  |  Branch (330:17): [True: 0, False: 0]
  ------------------
  331|      0|                goto end;
  332|      0|        }
  333|      0|        if (!BN_mod_mul(y, t, t, p, ctx))
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            goto end;
  335|      0|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            goto end;
  337|      0|        if (!BN_mod_mul(b, b, y, p, ctx))
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  ------------------
  338|      0|            goto end;
  339|      0|        e = i;
  340|      0|    }
  341|       |
  342|  5.52k| vrfy:
  343|  5.52k|    if (!err) {
  ------------------
  |  Branch (343:9): [True: 5.52k, 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|  5.52k|        if (!BN_mod_sqr(x, ret, p, ctx))
  ------------------
  |  Branch (349:13): [True: 0, False: 5.52k]
  ------------------
  350|      0|            err = 1;
  351|       |
  352|  5.52k|        if (!err && 0 != BN_cmp(x, A)) {
  ------------------
  |  Branch (352:13): [True: 5.52k, False: 0]
  |  Branch (352:21): [True: 1.72k, False: 3.79k]
  ------------------
  353|  1.72k|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|  1.72k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.72k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.72k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.72k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.72k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.72k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.72k|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|  1.72k|            err = 1;
  355|  1.72k|        }
  356|  5.52k|    }
  357|       |
  358|  5.52k| end:
  359|  5.52k|    if (err) {
  ------------------
  |  Branch (359:9): [True: 1.72k, False: 3.79k]
  ------------------
  360|  1.72k|        if (ret != in)
  ------------------
  |  Branch (360:13): [True: 0, False: 1.72k]
  ------------------
  361|      0|            BN_clear_free(ret);
  362|  1.72k|        ret = NULL;
  363|  1.72k|    }
  364|  5.52k|    if (used_ctx)
  ------------------
  |  Branch (364:9): [True: 5.52k, False: 0]
  ------------------
  365|  5.52k|        BN_CTX_end(ctx);
  366|  5.52k|    bn_check_top(ret);
  367|  5.52k|    return ret;
  368|  5.52k|}

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

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

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

cmp_asn.c:ossl_cmp_msg_cb:
  853|   216k|{
  854|   216k|    OSSL_CMP_MSG *msg = (OSSL_CMP_MSG *)*pval;
  855|       |
  856|   216k|    switch (operation) {
  857|  24.7k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  24.7k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (857:5): [True: 24.7k, False: 192k]
  ------------------
  858|  24.7k|        OPENSSL_free(msg->propq);
  ------------------
  |  |  115|  24.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  24.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  24.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  859|  24.7k|        break;
  860|       |
  861|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (861:5): [True: 0, False: 216k]
  ------------------
  862|      0|        {
  863|      0|            OSSL_CMP_MSG *old = exarg;
  864|       |
  865|      0|            if (!ossl_cmp_msg_set0_libctx(msg, old->libctx, old->propq))
  ------------------
  |  Branch (865:17): [True: 0, False: 0]
  ------------------
  866|      0|                return 0;
  867|      0|        }
  868|      0|        break;
  869|      0|    case ASN1_OP_GET0_LIBCTX:
  ------------------
  |  |  758|      0|# define ASN1_OP_GET0_LIBCTX     16
  ------------------
  |  Branch (869:5): [True: 0, False: 216k]
  ------------------
  870|      0|        {
  871|      0|            OSSL_LIB_CTX **libctx = exarg;
  872|       |
  873|      0|            *libctx = msg->libctx;
  874|      0|        }
  875|      0|        break;
  876|      0|    case ASN1_OP_GET0_PROPQ:
  ------------------
  |  |  759|      0|# define ASN1_OP_GET0_PROPQ      17
  ------------------
  |  Branch (876:5): [True: 0, False: 216k]
  ------------------
  877|      0|        {
  878|      0|            const char **propq = exarg;
  879|       |
  880|      0|            *propq = msg->propq;
  881|      0|        }
  882|      0|        break;
  883|   192k|    default:
  ------------------
  |  Branch (883:5): [True: 192k, False: 24.7k]
  ------------------
  884|   192k|        break;
  885|   216k|    }
  886|       |
  887|   216k|    return 1;
  888|   216k|}

OSSL_CMP_try_certreq:
  825|     70|{
  826|     70|    OSSL_CMP_MSG *rep = NULL;
  827|     70|    int is_p10 = req_type == OSSL_CMP_PKIBODY_P10CR;
  ------------------
  |  |  916|     70|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  828|     70|    int rid = is_p10 ? OSSL_CMP_CERTREQID_NONE : OSSL_CMP_CERTREQID;
  ------------------
  |  |  942|      0|# define OSSL_CMP_CERTREQID_NONE    -1
  ------------------
                  int rid = is_p10 ? OSSL_CMP_CERTREQID_NONE : OSSL_CMP_CERTREQID;
  ------------------
  |  |  941|     70|# define OSSL_CMP_CERTREQID         0
  ------------------
  |  Branch (828:15): [True: 0, False: 70]
  ------------------
  829|     70|    int rep_type = is_p10 ? OSSL_CMP_PKIBODY_CP : req_type + 1;
  ------------------
  |  |  915|      0|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (829:20): [True: 0, False: 70]
  ------------------
  830|     70|    int res = 0;
  831|       |
  832|     70|    if (ctx == NULL) {
  ------------------
  |  Branch (832:9): [True: 0, False: 70]
  ------------------
  833|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  834|      0|        return 0;
  835|      0|    }
  836|       |
  837|     70|    if (ctx->status != OSSL_CMP_PKISTATUS_waiting) { /* not polling already */
  ------------------
  |  |  203|     70|#  define OSSL_CMP_PKISTATUS_waiting                3
  ------------------
  |  Branch (837:9): [True: 0, False: 70]
  ------------------
  838|      0|        if (!initial_certreq(ctx, req_type, crm, &rep, rep_type))
  ------------------
  |  Branch (838:13): [True: 0, False: 0]
  ------------------
  839|      0|            goto err;
  840|       |
  841|      0|        if (!save_senderNonce_if_waiting(ctx, rep, rid))
  ------------------
  |  Branch (841:13): [True: 0, False: 0]
  ------------------
  842|      0|            return 0;
  843|     70|    } else {
  844|     70|        if (req_type < 0)
  ------------------
  |  Branch (844:13): [True: 0, False: 70]
  ------------------
  845|      0|            return ossl_cmp_exchange_error(ctx, OSSL_CMP_PKISTATUS_rejection,
  ------------------
  |  |  202|      0|#  define OSSL_CMP_PKISTATUS_rejection              2
  ------------------
  846|      0|                                           0, "polling aborted",
  847|      0|                                           0 /* errorCode */, "by application");
  848|     70|        res = poll_for_response(ctx, 0 /* no sleep */, rid, &rep, checkAfter);
  849|     70|        if (res <= 0) /* waiting or error */
  ------------------
  |  Branch (849:13): [True: 70, False: 0]
  ------------------
  850|     70|            return res;
  851|     70|    }
  852|      0|    res = cert_response(ctx, 0 /* no sleep */, rid, &rep, checkAfter,
  853|      0|                        req_type, rep_type);
  854|       |
  855|      0| err:
  856|      0|    OSSL_CMP_MSG_free(rep);
  857|      0|    return res;
  858|      0|}
OSSL_CMP_exec_certreq:
  869|    328|{
  870|    328|    OSSL_CMP_MSG *rep = NULL;
  871|    328|    int is_p10 = req_type == OSSL_CMP_PKIBODY_P10CR;
  ------------------
  |  |  916|    328|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  872|    328|    int rid = is_p10 ? OSSL_CMP_CERTREQID_NONE : OSSL_CMP_CERTREQID;
  ------------------
  |  |  942|     25|# define OSSL_CMP_CERTREQID_NONE    -1
  ------------------
                  int rid = is_p10 ? OSSL_CMP_CERTREQID_NONE : OSSL_CMP_CERTREQID;
  ------------------
  |  |  941|    303|# define OSSL_CMP_CERTREQID         0
  ------------------
  |  Branch (872:15): [True: 25, False: 303]
  ------------------
  873|    328|    int rep_type = is_p10 ? OSSL_CMP_PKIBODY_CP : req_type + 1;
  ------------------
  |  |  915|     25|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (873:20): [True: 25, False: 303]
  ------------------
  874|    328|    X509 *result = NULL;
  875|       |
  876|    328|    if (ctx == NULL) {
  ------------------
  |  Branch (876:9): [True: 0, False: 328]
  ------------------
  877|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  878|      0|        return NULL;
  879|      0|    }
  880|       |
  881|    328|    if (!initial_certreq(ctx, req_type, crm, &rep, rep_type))
  ------------------
  |  Branch (881:9): [True: 328, False: 0]
  ------------------
  882|    328|        goto err;
  883|       |
  884|      0|    if (!save_senderNonce_if_waiting(ctx, rep, rid))
  ------------------
  |  Branch (884:9): [True: 0, False: 0]
  ------------------
  885|      0|        return 0;
  886|       |
  887|      0|    if (cert_response(ctx, 1 /* sleep */, rid, &rep, NULL, req_type, rep_type)
  ------------------
  |  Branch (887:9): [True: 0, False: 0]
  ------------------
  888|      0|        <= 0)
  889|      0|        goto err;
  890|       |
  891|      0|    result = ctx->newCert;
  892|    328| err:
  893|    328|    OSSL_CMP_MSG_free(rep);
  894|    328|    return result;
  895|      0|}
OSSL_CMP_exec_RR_ses:
  898|    109|{
  899|    109|    OSSL_CMP_MSG *rr = NULL;
  900|    109|    OSSL_CMP_MSG *rp = NULL;
  901|    109|    const int num_RevDetails = 1;
  902|    109|    const int rsid = OSSL_CMP_REVREQSID;
  ------------------
  |  |  945|    109|# define OSSL_CMP_REVREQSID 0
  ------------------
  903|    109|    OSSL_CMP_REVREPCONTENT *rrep = NULL;
  904|    109|    OSSL_CMP_PKISI *si = NULL;
  905|    109|    char buf[OSSL_CMP_PKISI_BUFLEN];
  906|    109|    int ret = 0;
  907|       |
  908|    109|    if (ctx == NULL) {
  ------------------
  |  Branch (908:9): [True: 0, False: 109]
  ------------------
  909|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ARGS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  910|      0|        return 0;
  911|      0|    }
  912|    109|    ctx->status = OSSL_CMP_PKISTATUS_request;
  ------------------
  |  |  197|    109|#  define OSSL_CMP_PKISTATUS_request                -3
  ------------------
  913|    109|    if (ctx->oldCert == NULL && ctx->p10CSR == NULL
  ------------------
  |  Branch (913:9): [True: 0, False: 109]
  |  Branch (913:33): [True: 0, False: 0]
  ------------------
  914|    109|        && (ctx->serialNumber == NULL || ctx->issuer == NULL)) {
  ------------------
  |  Branch (914:13): [True: 0, False: 0]
  |  Branch (914:42): [True: 0, False: 0]
  ------------------
  915|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_REFERENCE_CERT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  916|      0|        return 0;
  917|      0|    }
  918|       |
  919|       |    /* OSSL_CMP_rr_new() also checks if all necessary options are set */
  920|    109|    if ((rr = ossl_cmp_rr_new(ctx)) == NULL)
  ------------------
  |  Branch (920:9): [True: 109, False: 0]
  ------------------
  921|    109|        goto end;
  922|       |
  923|      0|    ctx->status = OSSL_CMP_PKISTATUS_trans;
  ------------------
  |  |  198|      0|#  define OSSL_CMP_PKISTATUS_trans                  -2
  ------------------
  924|      0|    if (!send_receive_also_delayed(ctx, rr, &rp, OSSL_CMP_PKIBODY_RP))
  ------------------
  |  |  924|      0|# define OSSL_CMP_PKIBODY_RP       12
  ------------------
  |  Branch (924:9): [True: 0, False: 0]
  ------------------
  925|      0|        goto end;
  926|       |
  927|      0|    rrep = rp->body->value.rp;
  928|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  929|       |    if (sk_OSSL_CMP_PKISI_num(rrep->status) != num_RevDetails) {
  930|       |        ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT);
  931|       |        goto end;
  932|       |    }
  933|       |#else
  934|      0|    if (sk_OSSL_CMP_PKISI_num(rrep->status) < 1) {
  ------------------
  |  |  323|      0|#define sk_OSSL_CMP_PKISI_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk))
  ------------------
  |  Branch (934:9): [True: 0, False: 0]
  ------------------
  935|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  936|      0|        goto end;
  937|      0|    }
  938|      0|#endif
  939|       |
  940|       |    /* evaluate PKIStatus field */
  941|      0|    si = ossl_cmp_revrepcontent_get_pkisi(rrep, rsid);
  942|      0|    if (!save_statusInfo(ctx, si))
  ------------------
  |  Branch (942:9): [True: 0, False: 0]
  ------------------
  943|      0|        goto err;
  944|      0|    switch (ossl_cmp_pkisi_get_status(si)) {
  945|      0|    case OSSL_CMP_PKISTATUS_accepted:
  ------------------
  |  |  200|      0|#  define OSSL_CMP_PKISTATUS_accepted               0
  ------------------
  |  Branch (945:5): [True: 0, False: 0]
  ------------------
  946|      0|        ossl_cmp_info(ctx, "revocation accepted (PKIStatus=accepted)");
  ------------------
  |  |  860|      0|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  947|      0|        ret = 1;
  948|      0|        break;
  949|      0|    case OSSL_CMP_PKISTATUS_grantedWithMods:
  ------------------
  |  |  201|      0|#  define OSSL_CMP_PKISTATUS_grantedWithMods        1
  ------------------
  |  Branch (949:5): [True: 0, False: 0]
  ------------------
  950|      0|        ossl_cmp_info(ctx, "revocation accepted (PKIStatus=grantedWithMods)");
  ------------------
  |  |  860|      0|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  951|      0|        ret = 1;
  952|      0|        break;
  953|      0|    case OSSL_CMP_PKISTATUS_rejection:
  ------------------
  |  |  202|      0|#  define OSSL_CMP_PKISTATUS_rejection              2
  ------------------
  |  Branch (953:5): [True: 0, False: 0]
  ------------------
  954|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_REQUEST_REJECTED_BY_SERVER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  955|      0|        goto err;
  956|      0|    case OSSL_CMP_PKISTATUS_revocationWarning:
  ------------------
  |  |  204|      0|#  define OSSL_CMP_PKISTATUS_revocationWarning      4
  ------------------
  |  Branch (956:5): [True: 0, False: 0]
  ------------------
  957|      0|        ossl_cmp_info(ctx, "revocation accepted (PKIStatus=revocationWarning)");
  ------------------
  |  |  860|      0|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  958|      0|        ret = 1;
  959|      0|        break;
  960|      0|    case OSSL_CMP_PKISTATUS_revocationNotification:
  ------------------
  |  |  205|      0|#  define OSSL_CMP_PKISTATUS_revocationNotification 5
  ------------------
  |  Branch (960:5): [True: 0, False: 0]
  ------------------
  961|       |        /* interpretation as warning or error depends on CA */
  962|      0|        ossl_cmp_warn(ctx,
  ------------------
  |  |  859|      0|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  963|      0|                      "revocation accepted (PKIStatus=revocationNotification)");
  964|      0|        ret = 1;
  965|      0|        break;
  966|      0|    case OSSL_CMP_PKISTATUS_waiting:
  ------------------
  |  |  203|      0|#  define OSSL_CMP_PKISTATUS_waiting                3
  ------------------
  |  Branch (966:5): [True: 0, False: 0]
  ------------------
  967|      0|    case OSSL_CMP_PKISTATUS_keyUpdateWarning:
  ------------------
  |  |  206|      0|#  define OSSL_CMP_PKISTATUS_keyUpdateWarning       6
  ------------------
  |  Branch (967:5): [True: 0, False: 0]
  ------------------
  968|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKISTATUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  969|      0|        goto err;
  970|      0|    default:
  ------------------
  |  Branch (970:5): [True: 0, False: 0]
  ------------------
  971|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNKNOWN_PKISTATUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  972|      0|        goto err;
  973|      0|    }
  974|       |
  975|       |    /* check any present CertId in optional revCerts field */
  976|      0|    if (sk_OSSL_CRMF_CERTID_num(rrep->revCerts) >= 1) {
  ------------------
  |  |  122|      0|#define sk_OSSL_CRMF_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
  ------------------
  |  Branch (976:9): [True: 0, False: 0]
  ------------------
  977|      0|        OSSL_CRMF_CERTID *cid;
  978|      0|        OSSL_CRMF_CERTTEMPLATE *tmpl =
  979|      0|            sk_OSSL_CMP_REVDETAILS_value(rr->body->value.rr, rsid)->certDetails;
  980|      0|        const X509_NAME *issuer = OSSL_CRMF_CERTTEMPLATE_get0_issuer(tmpl);
  981|      0|        const ASN1_INTEGER *serial =
  982|      0|            OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(tmpl);
  983|       |
  984|      0|        if (sk_OSSL_CRMF_CERTID_num(rrep->revCerts) != num_RevDetails) {
  ------------------
  |  |  122|      0|#define sk_OSSL_CRMF_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
  ------------------
  |  Branch (984:13): [True: 0, False: 0]
  ------------------
  985|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  986|      0|            ret = 0;
  987|      0|            goto err;
  988|      0|        }
  989|      0|        if ((cid = ossl_cmp_revrepcontent_get_CertId(rrep, rsid)) == NULL) {
  ------------------
  |  Branch (989:13): [True: 0, False: 0]
  ------------------
  990|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_CERTID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  991|      0|            ret = 0;
  992|      0|            goto err;
  993|      0|        }
  994|      0|        if (X509_NAME_cmp(issuer, OSSL_CRMF_CERTID_get0_issuer(cid)) != 0) {
  ------------------
  |  Branch (994:13): [True: 0, False: 0]
  ------------------
  995|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  996|       |            ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_CERTID_IN_RP);
  997|       |            ret = 0;
  998|       |            goto err;
  999|       |#endif
 1000|      0|        }
 1001|      0|        if (ASN1_INTEGER_cmp(serial,
  ------------------
  |  Branch (1001:13): [True: 0, False: 0]
  ------------------
 1002|      0|                             OSSL_CRMF_CERTID_get0_serialNumber(cid)) != 0) {
 1003|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1004|       |            ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_SERIAL_IN_RP);
 1005|       |            ret = 0;
 1006|       |            goto err;
 1007|       |#endif
 1008|      0|        }
 1009|      0|    }
 1010|       |
 1011|       |    /* check number of any optionally present crls */
 1012|      0|    if (rrep->crls != NULL && sk_X509_CRL_num(rrep->crls) != num_RevDetails) {
  ------------------
  |  |  131|      0|#define sk_X509_CRL_num(sk) OPENSSL_sk_num(ossl_check_const_X509_CRL_sk_type(sk))
  ------------------
  |  Branch (1012:9): [True: 0, False: 0]
  |  Branch (1012:31): [True: 0, False: 0]
  ------------------
 1013|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1014|      0|        ret = 0;
 1015|      0|        goto err;
 1016|      0|    }
 1017|       |
 1018|      0| err:
 1019|      0|    if (ret == 0
  ------------------
  |  Branch (1019:9): [True: 0, False: 0]
  ------------------
 1020|      0|            && OSSL_CMP_CTX_snprint_PKIStatus(ctx, buf, sizeof(buf)) != NULL)
  ------------------
  |  Branch (1020:16): [True: 0, False: 0]
  ------------------
 1021|      0|        ERR_add_error_data(1, buf);
 1022|       |
 1023|    109| end:
 1024|    109|    OSSL_CMP_MSG_free(rr);
 1025|    109|    OSSL_CMP_MSG_free(rp);
 1026|    109|    return ret;
 1027|      0|}
OSSL_CMP_exec_GENM_ses:
 1030|    226|{
 1031|    226|    OSSL_CMP_MSG *genm;
 1032|    226|    OSSL_CMP_MSG *genp = NULL;
 1033|    226|    STACK_OF(OSSL_CMP_ITAV) *itavs = NULL;
  ------------------
  |  |   31|    226|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1034|       |
 1035|    226|    if (ctx == NULL) {
  ------------------
  |  Branch (1035:9): [True: 0, False: 226]
  ------------------
 1036|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ARGS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1037|      0|        return NULL;
 1038|      0|    }
 1039|    226|    ctx->status = OSSL_CMP_PKISTATUS_request;
  ------------------
  |  |  197|    226|#  define OSSL_CMP_PKISTATUS_request                -3
  ------------------
 1040|       |
 1041|    226|    if ((genm = ossl_cmp_genm_new(ctx)) == NULL)
  ------------------
  |  Branch (1041:9): [True: 226, False: 0]
  ------------------
 1042|    226|        goto err;
 1043|       |
 1044|      0|    ctx->status = OSSL_CMP_PKISTATUS_trans;
  ------------------
  |  |  198|      0|#  define OSSL_CMP_PKISTATUS_trans                  -2
  ------------------
 1045|      0|    if (!send_receive_also_delayed(ctx, genm, &genp, OSSL_CMP_PKIBODY_GENP))
  ------------------
  |  |  934|      0|# define OSSL_CMP_PKIBODY_GENP     22
  ------------------
  |  Branch (1045:9): [True: 0, False: 0]
  ------------------
 1046|      0|        goto err;
 1047|      0|    ctx->status = OSSL_CMP_PKISTATUS_accepted;
  ------------------
  |  |  200|      0|#  define OSSL_CMP_PKISTATUS_accepted               0
  ------------------
 1048|       |
 1049|      0|    itavs = genp->body->value.genp;
 1050|      0|    if (itavs == NULL)
  ------------------
  |  Branch (1050:9): [True: 0, False: 0]
  ------------------
 1051|      0|        itavs = sk_OSSL_CMP_ITAV_new_null();
  ------------------
  |  |  255|      0|#define sk_OSSL_CMP_ITAV_new_null() ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_null())
  ------------------
 1052|       |    /* received stack of itavs not to be freed with the genp */
 1053|      0|    genp->body->value.genp = NULL;
 1054|       |
 1055|    226| err:
 1056|    226|    OSSL_CMP_MSG_free(genm);
 1057|    226|    OSSL_CMP_MSG_free(genp);
 1058|       |
 1059|    226|    return itavs; /* NULL indicates error case */
 1060|      0|}
cmp_client.c:initial_certreq:
  805|    328|{
  806|    328|    OSSL_CMP_MSG *req;
  807|    328|    int res;
  808|       |
  809|    328|    ctx->status = OSSL_CMP_PKISTATUS_request;
  ------------------
  |  |  197|    328|#  define OSSL_CMP_PKISTATUS_request                -3
  ------------------
  810|    328|    if (!ossl_cmp_ctx_set0_newCert(ctx, NULL))
  ------------------
  |  Branch (810:9): [True: 0, False: 328]
  ------------------
  811|      0|        return 0;
  812|       |
  813|       |    /* also checks if all necessary options are set */
  814|    328|    if ((req = ossl_cmp_certreq_new(ctx, req_type, crm)) == NULL)
  ------------------
  |  Branch (814:9): [True: 328, False: 0]
  ------------------
  815|    328|        return 0;
  816|       |
  817|      0|    ctx->status = OSSL_CMP_PKISTATUS_trans;
  ------------------
  |  |  198|      0|#  define OSSL_CMP_PKISTATUS_trans                  -2
  ------------------
  818|      0|    res = send_receive_check(ctx, req, p_rep, rep_type);
  819|      0|    OSSL_CMP_MSG_free(req);
  820|      0|    return res;
  821|    328|}
cmp_client.c:poll_for_response:
  284|     70|{
  285|     70|    OSSL_CMP_MSG *preq = NULL;
  286|     70|    OSSL_CMP_MSG *prep = NULL;
  287|       |
  288|     70|    ossl_cmp_info(ctx,
  ------------------
  |  |  860|     70|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|     70|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     70|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     70|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|     70|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     70|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|     70|                  "received 'waiting' PKIStatus, starting to poll for response");
  290|     70|    *rep = NULL;
  291|     70|    for (;;) {
  292|     70|        if ((preq = ossl_cmp_pollReq_new(ctx, rid)) == NULL)
  ------------------
  |  Branch (292:13): [True: 70, False: 0]
  ------------------
  293|     70|            goto err;
  294|       |
  295|      0|        if (!send_receive_check(ctx, preq, &prep, OSSL_CMP_PKIBODY_POLLREP))
  ------------------
  |  |  938|      0|# define OSSL_CMP_PKIBODY_POLLREP  26
  ------------------
  |  Branch (295:13): [True: 0, False: 0]
  ------------------
  296|      0|            goto err;
  297|       |
  298|       |        /* handle potential pollRep */
  299|      0|        if (OSSL_CMP_MSG_get_bodytype(prep) == OSSL_CMP_PKIBODY_POLLREP) {
  ------------------
  |  |  938|      0|# define OSSL_CMP_PKIBODY_POLLREP  26
  ------------------
  |  Branch (299:13): [True: 0, False: 0]
  ------------------
  300|      0|            OSSL_CMP_POLLREPCONTENT *prc = prep->body->value.pollRep;
  301|      0|            OSSL_CMP_POLLREP *pollRep = NULL;
  302|      0|            int64_t check_after;
  303|      0|            char str[OSSL_CMP_PKISI_BUFLEN];
  304|      0|            int len;
  305|       |
  306|      0|            if (sk_OSSL_CMP_POLLREP_num(prc) > 1) {
  ------------------
  |  Branch (306:17): [True: 0, False: 0]
  ------------------
  307|      0|                ERR_raise(ERR_LIB_CMP, CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|                goto err;
  309|      0|            }
  310|      0|            pollRep = ossl_cmp_pollrepcontent_get0_pollrep(prc, rid);
  311|      0|            if (pollRep == NULL)
  ------------------
  |  Branch (311:17): [True: 0, False: 0]
  ------------------
  312|      0|                goto err;
  313|       |
  314|      0|            if (!ASN1_INTEGER_get_int64(&check_after, pollRep->checkAfter)) {
  ------------------
  |  Branch (314:17): [True: 0, False: 0]
  ------------------
  315|      0|                ERR_raise(ERR_LIB_CMP, CMP_R_BAD_CHECKAFTER_IN_POLLREP);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  316|      0|                goto err;
  317|      0|            }
  318|      0|            if (check_after < 0 || (uint64_t)check_after
  ------------------
  |  Branch (318:17): [True: 0, False: 0]
  |  Branch (318:36): [True: 0, False: 0]
  ------------------
  319|      0|                > (sleep ? ULONG_MAX / 1000 : INT_MAX)) {
  ------------------
  |  Branch (319:20): [True: 0, False: 0]
  ------------------
  320|      0|                ERR_raise(ERR_LIB_CMP, CMP_R_CHECKAFTER_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  321|      0|                if (BIO_snprintf(str, OSSL_CMP_PKISI_BUFLEN, "value = %jd",
  ------------------
  |  |  582|      0|#  define OSSL_CMP_PKISI_BUFLEN 1024
  ------------------
  |  Branch (321:21): [True: 0, False: 0]
  ------------------
  322|      0|                                 check_after) >= 0)
  323|      0|                    ERR_add_error_data(1, str);
  324|      0|                goto err;
  325|      0|            }
  326|       |
  327|      0|            if (pollRep->reason == NULL
  ------------------
  |  Branch (327:17): [True: 0, False: 0]
  ------------------
  328|      0|                    || (len = BIO_snprintf(str, OSSL_CMP_PKISI_BUFLEN,
  ------------------
  |  |  582|      0|#  define OSSL_CMP_PKISI_BUFLEN 1024
  ------------------
  |  Branch (328:24): [True: 0, False: 0]
  ------------------
  329|      0|                                           " with reason = '")) < 0) {
  330|      0|                *str = '\0';
  331|      0|            } else {
  332|      0|                char *text = ossl_sk_ASN1_UTF8STRING2text(pollRep->reason, ", ",
  333|      0|                                                          sizeof(str) - len - 2);
  334|       |
  335|      0|                if (text == NULL
  ------------------
  |  Branch (335:21): [True: 0, False: 0]
  ------------------
  336|      0|                        || BIO_snprintf(str + len, sizeof(str) - len,
  ------------------
  |  Branch (336:28): [True: 0, False: 0]
  ------------------
  337|      0|                                        "%s'", text) < 0)
  338|      0|                    *str = '\0';
  339|      0|                OPENSSL_free(text);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  340|      0|            }
  341|      0|            ossl_cmp_log2(INFO, ctx,
  ------------------
  |  |  847|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  848|      0|                       OPENSSL_LINE, #level, fmt, arg1, arg2)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|      0|                          "received polling response%s; checkAfter = %ld seconds",
  343|      0|                          str, check_after);
  344|       |
  345|      0|            if (ctx->total_timeout != 0) { /* timeout is not infinite */
  ------------------
  |  Branch (345:17): [True: 0, False: 0]
  ------------------
  346|      0|                const int exp = OSSL_CMP_EXPECTED_RESP_TIME;
  ------------------
  |  | 1017|      0|# define OSSL_CMP_EXPECTED_RESP_TIME 2
  ------------------
  347|      0|                int64_t time_left = (int64_t)(ctx->end_time - exp - time(NULL));
  348|       |
  349|      0|                if (time_left <= 0) {
  ------------------
  |  Branch (349:21): [True: 0, False: 0]
  ------------------
  350|      0|                    ERR_raise(ERR_LIB_CMP, CMP_R_TOTAL_TIMEOUT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|                    goto err;
  352|      0|                }
  353|      0|                if (time_left < check_after)
  ------------------
  |  Branch (353:21): [True: 0, False: 0]
  ------------------
  354|      0|                    check_after = time_left;
  355|       |                /* poll one last time just when timeout was reached */
  356|      0|            }
  357|       |
  358|      0|            OSSL_CMP_MSG_free(preq);
  359|      0|            preq = NULL;
  360|      0|            OSSL_CMP_MSG_free(prep);
  361|      0|            prep = NULL;
  362|      0|            if (sleep) {
  ------------------
  |  Branch (362:17): [True: 0, False: 0]
  ------------------
  363|      0|                OSSL_sleep((unsigned long)(1000 * check_after));
  364|      0|            } else {
  365|      0|                if (checkAfter != NULL)
  ------------------
  |  Branch (365:21): [True: 0, False: 0]
  ------------------
  366|      0|                    *checkAfter = (int)check_after;
  367|      0|                return -1; /* exits the loop */
  368|      0|            }
  369|      0|        } else if (is_crep_with_waiting(prep, rid)
  ------------------
  |  Branch (369:20): [True: 0, False: 0]
  ------------------
  370|      0|                   || ossl_cmp_is_error_with_waiting(prep)) {
  ------------------
  |  Branch (370:23): [True: 0, False: 0]
  ------------------
  371|       |            /* received status must not be 'waiting' */
  372|      0|            (void)ossl_cmp_exchange_error(ctx, OSSL_CMP_PKISTATUS_rejection,
  ------------------
  |  |  202|      0|#  define OSSL_CMP_PKISTATUS_rejection              2
  ------------------
  373|      0|                                          OSSL_CMP_CTX_FAILINFO_badRequest,
  ------------------
  |  |  146|      0|#  define OSSL_CMP_CTX_FAILINFO_badRequest (1 << 2)
  ------------------
  374|      0|                                          "polling already started",
  375|      0|                                          0 /* errorCode */, NULL);
  376|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKISTATUS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  377|      0|            goto err;
  378|      0|        } else {
  379|      0|            ossl_cmp_info(ctx, "received final response after polling");
  ------------------
  |  |  860|      0|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  380|      0|            if (!ossl_cmp_ctx_set1_first_senderNonce(ctx, NULL))
  ------------------
  |  Branch (380:17): [True: 0, False: 0]
  ------------------
  381|      0|                return 0;
  382|      0|            break;
  383|      0|        }
  384|      0|    }
  385|      0|    if (prep == NULL)
  ------------------
  |  Branch (385:9): [True: 0, False: 0]
  ------------------
  386|      0|        goto err;
  387|       |
  388|      0|    OSSL_CMP_MSG_free(preq);
  389|      0|    *rep = prep;
  390|       |
  391|      0|    return 1;
  392|     70| err:
  393|     70|    (void)ossl_cmp_ctx_set1_first_senderNonce(ctx, NULL);
  394|     70|    OSSL_CMP_MSG_free(preq);
  395|     70|    OSSL_CMP_MSG_free(prep);
  396|     70|    return 0;
  397|      0|}

OSSL_CMP_CTX_new:
  109|  13.8k|{
  110|  13.8k|    OSSL_CMP_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  13.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|       |
  112|  13.8k|    if (ctx == NULL)
  ------------------
  |  Branch (112:9): [True: 0, False: 13.8k]
  ------------------
  113|      0|        goto err;
  114|       |
  115|  13.8k|    ctx->libctx = libctx;
  116|  13.8k|    if (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == NULL)
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (116:9): [True: 0, False: 13.8k]
  |  Branch (116:26): [True: 0, False: 0]
  ------------------
  117|      0|        goto err;
  118|       |
  119|  13.8k|    ctx->log_verbosity = OSSL_CMP_LOG_INFO;
  ------------------
  |  |   40|  13.8k|#  define OSSL_CMP_LOG_INFO    6
  ------------------
  120|       |
  121|  13.8k|    ctx->status = OSSL_CMP_PKISTATUS_unspecified;
  ------------------
  |  |  199|  13.8k|#  define OSSL_CMP_PKISTATUS_unspecified            -1
  ------------------
  122|  13.8k|    ctx->failInfoCode = -1;
  123|       |
  124|  13.8k|    ctx->keep_alive = 1;
  125|  13.8k|    ctx->msg_timeout = -1;
  126|  13.8k|    ctx->tls_used = -1; /* default for backward compatibility */
  127|       |
  128|  13.8k|    if ((ctx->untrusted = sk_X509_new_null()) == NULL) {
  ------------------
  |  |   82|  13.8k|#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (128:9): [True: 0, False: 13.8k]
  ------------------
  129|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  130|      0|        goto err;
  131|      0|    }
  132|       |
  133|  13.8k|    ctx->pbm_slen = 16;
  134|  13.8k|    if (!cmp_ctx_set_md(ctx, &ctx->pbm_owf, NID_sha256))
  ------------------
  |  | 3264|  13.8k|#define NID_sha256              672
  ------------------
  |  Branch (134:9): [True: 0, False: 13.8k]
  ------------------
  135|      0|        goto err;
  136|  13.8k|    ctx->pbm_itercnt = 500;
  137|  13.8k|    ctx->pbm_mac = NID_hmac_sha1;
  ------------------
  |  |   63|  13.8k|#define NID_hmac_sha1           781
  ------------------
  138|       |
  139|  13.8k|    if (!cmp_ctx_set_md(ctx, &ctx->digest, NID_sha256))
  ------------------
  |  | 3264|  13.8k|#define NID_sha256              672
  ------------------
  |  Branch (139:9): [True: 0, False: 13.8k]
  ------------------
  140|      0|        goto err;
  141|  13.8k|    ctx->popoMethod = OSSL_CRMF_POPO_SIGNATURE;
  ------------------
  |  |  226|  13.8k|#  define OSSL_CRMF_POPO_SIGNATURE  1
  ------------------
  142|  13.8k|    ctx->revocationReason = CRL_REASON_NONE;
  ------------------
  |  |  311|  13.8k|# define CRL_REASON_NONE                         -1
  ------------------
  143|       |
  144|       |    /* all other elements are initialized to 0 or NULL, respectively */
  145|  13.8k|    return ctx;
  146|       |
  147|      0| err:
  148|      0|    OSSL_CMP_CTX_free(ctx);
  149|      0|    return NULL;
  150|  13.8k|}
OSSL_CMP_CTX_free:
  194|  13.8k|{
  195|  13.8k|    if (ctx == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 13.8k]
  ------------------
  196|      0|        return;
  197|       |
  198|  13.8k|#ifndef OPENSSL_NO_HTTP
  199|  13.8k|    if (ctx->http_ctx != NULL) {
  ------------------
  |  Branch (199:9): [True: 0, False: 13.8k]
  ------------------
  200|      0|        (void)OSSL_HTTP_close(ctx->http_ctx, 1);
  201|      0|        ossl_cmp_debug(ctx, "disconnected from CMP server");
  ------------------
  |  |  861|      0|# define ossl_cmp_debug(ctx, msg) ossl_cmp_log(DEBUG, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|      0|    }
  203|  13.8k|#endif
  204|  13.8k|    OPENSSL_free(ctx->propq);
  ------------------
  |  |  115|  13.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|  13.8k|    OPENSSL_free(ctx->serverPath);
  ------------------
  |  |  115|  13.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|  13.8k|    OPENSSL_free(ctx->server);
  ------------------
  |  |  115|  13.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|  13.8k|    OPENSSL_free(ctx->proxy);
  ------------------
  |  |  115|  13.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|  13.8k|    OPENSSL_free(ctx->no_proxy);
  ------------------
  |  |  115|  13.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  209|       |
  210|  13.8k|    X509_free(ctx->srvCert);
  211|  13.8k|    X509_free(ctx->validatedSrvCert);
  212|  13.8k|    X509_NAME_free(ctx->expected_sender);
  213|  13.8k|    X509_STORE_free(ctx->trusted);
  214|  13.8k|    OSSL_STACK_OF_X509_free(ctx->untrusted);
  215|       |
  216|  13.8k|    X509_free(ctx->cert);
  217|  13.8k|    OSSL_STACK_OF_X509_free(ctx->chain);
  218|  13.8k|    EVP_PKEY_free(ctx->pkey);
  219|  13.8k|    ASN1_OCTET_STRING_free(ctx->referenceValue);
  220|  13.8k|    if (ctx->secretValue != NULL)
  ------------------
  |  Branch (220:9): [True: 6.94k, False: 6.94k]
  ------------------
  221|  6.94k|        OPENSSL_cleanse(ctx->secretValue->data, ctx->secretValue->length);
  222|  13.8k|    ASN1_OCTET_STRING_free(ctx->secretValue);
  223|  13.8k|    EVP_MD_free(ctx->pbm_owf);
  224|       |
  225|  13.8k|    X509_NAME_free(ctx->recipient);
  226|  13.8k|    EVP_MD_free(ctx->digest);
  227|  13.8k|    ASN1_OCTET_STRING_free(ctx->transactionID);
  228|  13.8k|    ASN1_OCTET_STRING_free(ctx->senderNonce);
  229|  13.8k|    ASN1_OCTET_STRING_free(ctx->recipNonce);
  230|  13.8k|    ASN1_OCTET_STRING_free(ctx->first_senderNonce);
  231|  13.8k|    OSSL_CMP_ITAVs_free(ctx->geninfo_ITAVs);
  ------------------
  |  |  153|  13.8k|    sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free);
  |  |  ------------------
  |  |  |  |  266|  13.8k|#define sk_OSSL_CMP_ITAV_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc))
  |  |  ------------------
  ------------------
  232|  13.8k|    OSSL_STACK_OF_X509_free(ctx->extraCertsOut);
  233|       |
  234|  13.8k|    EVP_PKEY_free(ctx->newPkey);
  235|  13.8k|    X509_NAME_free(ctx->issuer);
  236|  13.8k|    ASN1_INTEGER_free(ctx->serialNumber);
  237|  13.8k|    X509_NAME_free(ctx->subjectName);
  238|  13.8k|    sk_GENERAL_NAME_pop_free(ctx->subjectAltNames, GENERAL_NAME_free);
  ------------------
  |  |  252|  13.8k|#define sk_GENERAL_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_freefunc_type(freefunc))
  ------------------
  239|  13.8k|    X509_EXTENSIONS_free(ctx->reqExtensions);
  ------------------
  |  |  155|  13.8k|    sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free)
  |  |  ------------------
  |  |  |  |  249|  13.8k|#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_freefunc_type(freefunc))
  |  |  ------------------
  ------------------
  240|  13.8k|    sk_POLICYINFO_pop_free(ctx->policies, POLICYINFO_free);
  ------------------
  |  |  482|  13.8k|#define sk_POLICYINFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_freefunc_type(freefunc))
  ------------------
  241|  13.8k|    X509_free(ctx->oldCert);
  242|  13.8k|    X509_REQ_free(ctx->p10CSR);
  243|       |
  244|  13.8k|    OSSL_CMP_ITAVs_free(ctx->genm_ITAVs);
  ------------------
  |  |  153|  13.8k|    sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free);
  |  |  ------------------
  |  |  |  |  266|  13.8k|#define sk_OSSL_CMP_ITAV_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc))
  |  |  ------------------
  ------------------
  245|       |
  246|  13.8k|    OSSL_CMP_PKIFREETEXT_free(ctx->statusString);
  ------------------
  |  |  157|  13.8k|    sk_ASN1_UTF8STRING_pop_free(text, ASN1_UTF8STRING_free)
  |  |  ------------------
  |  |  |  |  778|  13.8k|#define sk_ASN1_UTF8STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc))
  |  |  ------------------
  ------------------
  247|  13.8k|    X509_free(ctx->newCert);
  248|  13.8k|    OSSL_STACK_OF_X509_free(ctx->newChain);
  249|  13.8k|    OSSL_STACK_OF_X509_free(ctx->caPubs);
  250|  13.8k|    OSSL_STACK_OF_X509_free(ctx->extraCertsIn);
  251|       |
  252|  13.8k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  13.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  253|  13.8k|}
ossl_cmp_print_log:
  345|  50.3k|{
  346|  50.3k|    va_list args;
  347|  50.3k|    char hugebuf[1024 * 2];
  348|  50.3k|    int res = 0;
  349|       |
  350|  50.3k|    if (ctx == NULL || ctx->log_cb == NULL)
  ------------------
  |  Branch (350:9): [True: 0, False: 50.3k]
  |  Branch (350:24): [True: 13.5k, False: 36.8k]
  ------------------
  351|  13.5k|        return 1; /* silently drop message */
  352|       |
  353|  36.8k|    if (level > ctx->log_verbosity) /* excludes the case level is unknown */
  ------------------
  |  Branch (353:9): [True: 15.0k, False: 21.8k]
  ------------------
  354|  15.0k|        return 1; /* suppress output since severity is not sufficient */
  355|       |
  356|  21.8k|    if (format == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 21.8k]
  ------------------
  357|      0|        return 0;
  358|       |
  359|  21.8k|    va_start(args, format);
  360|       |
  361|  21.8k|    if (func == NULL)
  ------------------
  |  Branch (361:9): [True: 0, False: 21.8k]
  ------------------
  362|      0|        func = "(unset function name)";
  363|  21.8k|    if (file == NULL)
  ------------------
  |  Branch (363:9): [True: 0, False: 21.8k]
  ------------------
  364|      0|        file = "(unset file name)";
  365|  21.8k|    if (level_str == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 21.8k]
  ------------------
  366|      0|        level_str = "(unset level string)";
  367|       |
  368|       |#ifndef OPENSSL_NO_TRACE
  369|       |    if (OSSL_TRACE_ENABLED(CMP)) {
  370|       |        OSSL_TRACE_BEGIN(CMP) {
  371|       |            int printed =
  372|       |                BIO_snprintf(hugebuf, sizeof(hugebuf),
  373|       |                             "%s:%s:%d:" OSSL_CMP_LOG_PREFIX "%s: ",
  374|       |                             func, file, line, level_str);
  375|       |            if (printed > 0 && (size_t)printed < sizeof(hugebuf)) {
  376|       |                if (BIO_vsnprintf(hugebuf + printed,
  377|       |                                  sizeof(hugebuf) - printed, format, args) > 0)
  378|       |                    res = BIO_puts(trc_out, hugebuf) > 0;
  379|       |            }
  380|       |        } OSSL_TRACE_END(CMP);
  381|       |    }
  382|       |#else /* compensate for disabled trace API */
  383|  21.8k|    {
  384|  21.8k|        if (BIO_vsnprintf(hugebuf, sizeof(hugebuf), format, args) > 0)
  ------------------
  |  Branch (384:13): [True: 21.8k, False: 0]
  ------------------
  385|  21.8k|            res = ctx->log_cb(func, file, line, level, hugebuf);
  386|  21.8k|    }
  387|  21.8k|#endif
  388|  21.8k|    va_end(args);
  389|  21.8k|    return res;
  390|  21.8k|}
OSSL_CMP_CTX_set_log_cb:
  394|  13.8k|{
  395|  13.8k|    if (ctx == NULL) {
  ------------------
  |  Branch (395:9): [True: 0, False: 13.8k]
  ------------------
  396|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  397|      0|        return 0;
  398|      0|    }
  399|  13.8k|    ctx->log_cb = cb;
  400|       |
  401|       |#ifndef OPENSSL_NO_TRACE
  402|       |    /* do also in case cb == NULL, to switch off logging output: */
  403|       |    if (!OSSL_trace_set_callback(OSSL_TRACE_CATEGORY_CMP,
  404|       |                                 ossl_cmp_log_trace_cb, ctx))
  405|       |        return 0;
  406|       |#endif
  407|       |
  408|  13.8k|    return 1;
  409|  13.8k|}
OSSL_CMP_CTX_print_errors:
  413|  7.58k|{
  414|  7.58k|    if (ctx != NULL && OSSL_CMP_LOG_ERR > ctx->log_verbosity)
  ------------------
  |  |   37|  7.58k|#  define OSSL_CMP_LOG_ERR     3
  ------------------
  |  Branch (414:9): [True: 7.58k, False: 0]
  |  Branch (414:24): [True: 0, False: 7.58k]
  ------------------
  415|      0|        return; /* suppress output since severity is not sufficient */
  416|  7.58k|    OSSL_CMP_print_errors_cb(ctx == NULL ? NULL : ctx->log_cb);
  ------------------
  |  Branch (416:30): [True: 0, False: 7.58k]
  ------------------
  417|  7.58k|}
OSSL_CMP_CTX_set1_secretValue:
  437|  6.94k|{
  438|  6.94k|    ASN1_OCTET_STRING *secretValue = NULL;
  439|       |
  440|  6.94k|    if (ctx == NULL) {
  ------------------
  |  Branch (440:9): [True: 0, False: 6.94k]
  ------------------
  441|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  442|      0|        return 0;
  443|      0|    }
  444|  6.94k|    if (ossl_cmp_asn1_octet_string_set1_bytes(&secretValue, sec, len) != 1)
  ------------------
  |  Branch (444:9): [True: 0, False: 6.94k]
  ------------------
  445|      0|        return 0;
  446|  6.94k|    if (ctx->secretValue != NULL) {
  ------------------
  |  Branch (446:9): [True: 0, False: 6.94k]
  ------------------
  447|      0|        OPENSSL_cleanse(ctx->secretValue->data, ctx->secretValue->length);
  448|      0|        ASN1_OCTET_STRING_free(ctx->secretValue);
  449|      0|    }
  450|  6.94k|    ctx->secretValue = secretValue;
  451|  6.94k|    return 1;
  452|  6.94k|}
OSSL_CMP_CTX_set1_recipient:
  567|  2.36k|int OSSL_CMP_CTX_set1_##FIELD(OSSL_CMP_CTX *ctx, const TYPE *val) \
  568|  2.36k|{ \
  569|  2.36k|    TYPE *val_dup = NULL; \
  570|  2.36k|    \
  571|  2.36k|    if (ctx == NULL) { \
  ------------------
  |  Branch (571:9): [True: 0, False: 2.36k]
  ------------------
  572|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  573|      0|        return 0; \
  574|      0|    } \
  575|  2.36k|    \
  576|  2.36k|    if (val != NULL && (val_dup = TYPE##_dup(val)) == NULL) \
  ------------------
  |  Branch (576:9): [True: 2.36k, False: 0]
  |  Branch (576:24): [True: 1, False: 2.35k]
  ------------------
  577|  2.36k|        return 0; \
  578|  2.36k|    TYPE##_free(ctx->FIELD); \
  579|  2.35k|    ctx->FIELD = val_dup; \
  580|  2.35k|    return 1; \
  581|  2.36k|}
OSSL_CMP_CTX_reqExtensions_have_SAN:
  652|    583|{
  653|    583|    if (ctx == NULL) {
  ------------------
  |  Branch (653:9): [True: 0, False: 583]
  ------------------
  654|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|      0|        return -1;
  656|      0|    }
  657|       |    /* if one of the following conditions 'fail' this is not an error */
  658|    583|    return ctx->reqExtensions != NULL
  ------------------
  |  Branch (658:12): [True: 0, False: 583]
  ------------------
  659|    583|        && X509v3_get_ext_by_NID(ctx->reqExtensions,
  ------------------
  |  Branch (659:12): [True: 0, False: 0]
  ------------------
  660|      0|                                 NID_subject_alt_name, -1) >= 0;
  ------------------
  |  | 2672|      0|#define NID_subject_alt_name            85
  ------------------
  661|    583|}
ossl_cmp_ctx_set0_newCert:
   43|    328|int PREFIX##_set0##_##NAME(OSSL_CMP_CTX *ctx, TYPE *val) \
   44|    328|{ \
   45|    328|    if (ctx == NULL) { \
  ------------------
  |  Branch (45:9): [True: 0, False: 328]
  ------------------
   46|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   47|      0|        return 0; \
   48|      0|    } \
   49|    328|    TYPE##_free(ctx->FIELD); \
   50|    328|    ctx->FIELD = val; \
   51|    328|    return 1; \
   52|    328|}
OSSL_CMP_CTX_set0_newPkey:
  757|    899|{
  758|    899|    if (ctx == NULL) {
  ------------------
  |  Branch (758:9): [True: 0, False: 899]
  ------------------
  759|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  760|      0|        return 0;
  761|      0|    }
  762|       |
  763|    899|    EVP_PKEY_free(ctx->newPkey);
  764|    899|    ctx->newPkey = pkey;
  765|    899|    ctx->newPkey_priv = priv;
  766|    899|    return 1;
  767|    899|}
OSSL_CMP_CTX_get0_newPkey:
  772|    303|{
  773|    303|    if (ctx == NULL) {
  ------------------
  |  Branch (773:9): [True: 0, False: 303]
  ------------------
  774|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  775|      0|        return NULL;
  776|      0|    }
  777|       |
  778|    303|    if (ctx->newPkey != NULL)
  ------------------
  |  Branch (778:9): [True: 0, False: 303]
  ------------------
  779|      0|        return priv && !ctx->newPkey_priv ? NULL : ctx->newPkey;
  ------------------
  |  Branch (779:16): [True: 0, False: 0]
  |  Branch (779:24): [True: 0, False: 0]
  ------------------
  780|    303|    if (ctx->p10CSR != NULL)
  ------------------
  |  Branch (780:9): [True: 0, False: 303]
  ------------------
  781|      0|        return priv ? NULL : X509_REQ_get0_pubkey(ctx->p10CSR);
  ------------------
  |  Branch (781:16): [True: 0, False: 0]
  ------------------
  782|    303|    return ctx->pkey; /* may be NULL */
  783|    303|}
ossl_cmp_ctx_get0_newPubkey:
  786|    303|{
  787|    303|    if (!ossl_assert(ctx != NULL))
  ------------------
  |  |   52|    303|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    303|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (787:9): [True: 0, False: 303]
  ------------------
  788|      0|        return NULL;
  789|    303|    if (ctx->newPkey != NULL)
  ------------------
  |  Branch (789:9): [True: 0, False: 303]
  ------------------
  790|      0|        return ctx->newPkey;
  791|    303|    if (ctx->p10CSR != NULL)
  ------------------
  |  Branch (791:9): [True: 0, False: 303]
  ------------------
  792|      0|        return X509_REQ_get0_pubkey(ctx->p10CSR);
  793|    303|    if (ctx->oldCert != NULL)
  ------------------
  |  Branch (793:9): [True: 303, False: 0]
  ------------------
  794|    303|        return X509_get0_pubkey(ctx->oldCert);
  795|      0|    if (ctx->cert != NULL)
  ------------------
  |  Branch (795:9): [True: 0, False: 0]
  ------------------
  796|      0|        return X509_get0_pubkey(ctx->cert);
  797|      0|    return ctx->pkey;
  798|      0|}
OSSL_CMP_CTX_set1_transactionID:
  801|  21.4k|int PREFIX##_set1_##FIELD(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *id) \
  802|  21.4k|{ \
  803|  21.4k|    if (ctx == NULL) { \
  ------------------
  |  Branch (803:9): [True: 0, False: 21.4k]
  ------------------
  804|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  805|      0|        return 0; \
  806|      0|    } \
  807|  21.4k|    return ossl_cmp_asn1_octet_string_set1(&ctx->FIELD, id); \
  808|  21.4k|}
ossl_cmp_ctx_set1_recipNonce:
  801|  13.1k|int PREFIX##_set1_##FIELD(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *id) \
  802|  13.1k|{ \
  803|  13.1k|    if (ctx == NULL) { \
  ------------------
  |  Branch (803:9): [True: 0, False: 13.1k]
  ------------------
  804|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  805|      0|        return 0; \
  806|      0|    } \
  807|  13.1k|    return ossl_cmp_asn1_octet_string_set1(&ctx->FIELD, id); \
  808|  13.1k|}
OSSL_CMP_CTX_set1_senderNonce:
  801|  16.0k|int PREFIX##_set1_##FIELD(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *id) \
  802|  16.0k|{ \
  803|  16.0k|    if (ctx == NULL) { \
  ------------------
  |  Branch (803:9): [True: 0, False: 16.0k]
  ------------------
  804|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  805|      0|        return 0; \
  806|      0|    } \
  807|  16.0k|    return ossl_cmp_asn1_octet_string_set1(&ctx->FIELD, id); \
  808|  16.0k|}
ossl_cmp_ctx_set1_first_senderNonce:
  801|     70|int PREFIX##_set1_##FIELD(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *id) \
  802|     70|{ \
  803|     70|    if (ctx == NULL) { \
  ------------------
  |  Branch (803:9): [True: 0, False: 70]
  ------------------
  804|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  805|      0|        return 0; \
  806|      0|    } \
  807|     70|    return ossl_cmp_asn1_octet_string_set1(&ctx->FIELD, id); \
  808|     70|}
OSSL_CMP_CTX_set_transfer_cb:
  256|  6.94k|int PREFIX##_set_##FIELD(OSSL_CMP_CTX *ctx, TYPE val) \
  257|  6.94k|{ \
  258|  6.94k|    if (ctx == NULL) { \
  ------------------
  |  Branch (258:9): [True: 0, False: 6.94k]
  ------------------
  259|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|        return 0; \
  261|      0|    } \
  262|  6.94k|    ctx->FIELD = val; \
  263|  6.94k|    return 1; \
  264|  6.94k|}
OSSL_CMP_CTX_set_transfer_cb_arg:
  256|  6.94k|int PREFIX##_set_##FIELD(OSSL_CMP_CTX *ctx, TYPE val) \
  257|  6.94k|{ \
  258|  6.94k|    if (ctx == NULL) { \
  ------------------
  |  Branch (258:9): [True: 0, False: 6.94k]
  ------------------
  259|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|        return 0; \
  261|      0|    } \
  262|  6.94k|    ctx->FIELD = val; \
  263|  6.94k|    return 1; \
  264|  6.94k|}
OSSL_CMP_CTX_get_option:
  989|    579|{
  990|    579|    if (ctx == NULL) {
  ------------------
  |  Branch (990:9): [True: 0, False: 579]
  ------------------
  991|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  992|      0|        return -1;
  993|      0|    }
  994|       |
  995|    579|    switch (opt) {
  996|      0|    case OSSL_CMP_OPT_LOG_VERBOSITY:
  ------------------
  |  |  482|      0|#  define OSSL_CMP_OPT_LOG_VERBOSITY 0
  ------------------
  |  Branch (996:5): [True: 0, False: 579]
  ------------------
  997|      0|        return ctx->log_verbosity;
  998|    186|    case OSSL_CMP_OPT_IMPLICIT_CONFIRM:
  ------------------
  |  |  494|    186|#  define OSSL_CMP_OPT_IMPLICIT_CONFIRM 25
  ------------------
  |  Branch (998:5): [True: 186, False: 393]
  ------------------
  999|    186|        return ctx->implicitConfirm;
 1000|      0|    case OSSL_CMP_OPT_DISABLE_CONFIRM:
  ------------------
  |  |  495|      0|#  define OSSL_CMP_OPT_DISABLE_CONFIRM 26
  ------------------
  |  Branch (1000:5): [True: 0, False: 579]
  ------------------
 1001|      0|        return ctx->disableConfirm;
 1002|      0|    case OSSL_CMP_OPT_UNPROTECTED_SEND:
  ------------------
  |  |  498|      0|#  define OSSL_CMP_OPT_UNPROTECTED_SEND 30
  ------------------
  |  Branch (1002:5): [True: 0, False: 579]
  ------------------
 1003|      0|        return ctx->unprotectedSend;
 1004|     90|    case OSSL_CMP_OPT_UNPROTECTED_ERRORS:
  ------------------
  |  |  499|     90|#  define OSSL_CMP_OPT_UNPROTECTED_ERRORS 31
  ------------------
  |  Branch (1004:5): [True: 90, False: 489]
  ------------------
 1005|     90|        return ctx->unprotectedErrors;
 1006|      0|    case OSSL_CMP_OPT_NO_CACHE_EXTRACERTS:
  ------------------
  |  |  505|      0|#  define OSSL_CMP_OPT_NO_CACHE_EXTRACERTS 37
  ------------------
  |  Branch (1006:5): [True: 0, False: 579]
  ------------------
 1007|      0|        return ctx->noCacheExtraCerts;
 1008|      0|    case OSSL_CMP_OPT_VALIDITY_DAYS:
  ------------------
  |  |  489|      0|#  define OSSL_CMP_OPT_VALIDITY_DAYS 20
  ------------------
  |  Branch (1008:5): [True: 0, False: 579]
  ------------------
 1009|      0|        return ctx->days;
 1010|      0|    case OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT:
  ------------------
  |  |  490|      0|#  define OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT 21
  ------------------
  |  Branch (1010:5): [True: 0, False: 579]
  ------------------
 1011|      0|        return ctx->SubjectAltName_nodefault;
 1012|      0|    case OSSL_CMP_OPT_SUBJECTALTNAME_CRITICAL:
  ------------------
  |  |  491|      0|#  define OSSL_CMP_OPT_SUBJECTALTNAME_CRITICAL 22
  ------------------
  |  Branch (1012:5): [True: 0, False: 579]
  ------------------
 1013|      0|        return ctx->setSubjectAltNameCritical;
 1014|      0|    case OSSL_CMP_OPT_POLICIES_CRITICAL:
  ------------------
  |  |  492|      0|#  define OSSL_CMP_OPT_POLICIES_CRITICAL 23
  ------------------
  |  Branch (1014:5): [True: 0, False: 579]
  ------------------
 1015|      0|        return ctx->setPoliciesCritical;
 1016|      0|    case OSSL_CMP_OPT_IGNORE_KEYUSAGE:
  ------------------
  |  |  503|      0|#  define OSSL_CMP_OPT_IGNORE_KEYUSAGE 35
  ------------------
  |  Branch (1016:5): [True: 0, False: 579]
  ------------------
 1017|      0|        return ctx->ignore_keyusage;
 1018|    303|    case OSSL_CMP_OPT_POPO_METHOD:
  ------------------
  |  |  493|    303|#  define OSSL_CMP_OPT_POPO_METHOD 24
  ------------------
  |  Branch (1018:5): [True: 303, False: 276]
  ------------------
 1019|    303|        return ctx->popoMethod;
 1020|      0|    case OSSL_CMP_OPT_DIGEST_ALGNID:
  ------------------
  |  |  502|      0|#  define OSSL_CMP_OPT_DIGEST_ALGNID 34
  ------------------
  |  Branch (1020:5): [True: 0, False: 579]
  ------------------
 1021|      0|        return EVP_MD_get_type(ctx->digest);
 1022|      0|    case OSSL_CMP_OPT_OWF_ALGNID:
  ------------------
  |  |  500|      0|#  define OSSL_CMP_OPT_OWF_ALGNID 32
  ------------------
  |  Branch (1022:5): [True: 0, False: 579]
  ------------------
 1023|      0|        return EVP_MD_get_type(ctx->pbm_owf);
 1024|      0|    case OSSL_CMP_OPT_MAC_ALGNID:
  ------------------
  |  |  501|      0|#  define OSSL_CMP_OPT_MAC_ALGNID 33
  ------------------
  |  Branch (1024:5): [True: 0, False: 579]
  ------------------
 1025|      0|        return ctx->pbm_mac;
 1026|      0|    case OSSL_CMP_OPT_KEEP_ALIVE:
  ------------------
  |  |  484|      0|#  define OSSL_CMP_OPT_KEEP_ALIVE    10
  ------------------
  |  Branch (1026:5): [True: 0, False: 579]
  ------------------
 1027|      0|        return ctx->keep_alive;
 1028|      0|    case OSSL_CMP_OPT_MSG_TIMEOUT:
  ------------------
  |  |  485|      0|#  define OSSL_CMP_OPT_MSG_TIMEOUT   11
  ------------------
  |  Branch (1028:5): [True: 0, False: 579]
  ------------------
 1029|      0|        return ctx->msg_timeout;
 1030|      0|    case OSSL_CMP_OPT_TOTAL_TIMEOUT:
  ------------------
  |  |  486|      0|#  define OSSL_CMP_OPT_TOTAL_TIMEOUT 12
  ------------------
  |  Branch (1030:5): [True: 0, False: 579]
  ------------------
 1031|      0|        return ctx->total_timeout;
 1032|      0|    case OSSL_CMP_OPT_USE_TLS:
  ------------------
  |  |  487|      0|#  define OSSL_CMP_OPT_USE_TLS       13
  ------------------
  |  Branch (1032:5): [True: 0, False: 579]
  ------------------
 1033|      0|        return ctx->tls_used;
 1034|      0|    case OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR:
  ------------------
  |  |  504|      0|#  define OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR 36
  ------------------
  |  Branch (1034:5): [True: 0, False: 579]
  ------------------
 1035|      0|        return ctx->permitTAInExtraCertsForIR;
 1036|      0|    case OSSL_CMP_OPT_REVOCATION_REASON:
  ------------------
  |  |  496|      0|#  define OSSL_CMP_OPT_REVOCATION_REASON 27
  ------------------
  |  Branch (1036:5): [True: 0, False: 579]
  ------------------
 1037|      0|        return ctx->revocationReason;
 1038|      0|    default:
  ------------------
  |  Branch (1038:5): [True: 0, False: 579]
  ------------------
 1039|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_OPTION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1040|      0|        return -1;
 1041|    579|    }
 1042|    579|}
cmp_ctx.c:cmp_ctx_set_md:
   91|  27.7k|{
   92|  27.7k|    EVP_MD *md = EVP_MD_fetch(ctx->libctx, OBJ_nid2sn(nid), ctx->propq);
   93|       |    /* fetching in advance to be able to throw error early if unsupported */
   94|       |
   95|  27.7k|    if (md == NULL) {
  ------------------
  |  Branch (95:9): [True: 0, False: 27.7k]
  ------------------
   96|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   97|      0|        return 0;
   98|      0|    }
   99|  27.7k|    EVP_MD_free(*pmd);
  100|  27.7k|    *pmd = md;
  101|  27.7k|    return 1;
  102|  27.7k|}

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

ossl_cmp_hdr_set_pvno:
   24|  7.77k|{
   25|  7.77k|    if (!ossl_assert(hdr != NULL))
  ------------------
  |  |   52|  7.77k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (25:9): [True: 0, False: 7.77k]
  ------------------
   26|      0|        return 0;
   27|  7.77k|    return ASN1_INTEGER_set(hdr->pvno, pvno);
   28|  7.77k|}
ossl_cmp_hdr_get_pvno:
   31|  16.1k|{
   32|  16.1k|    int64_t pvno;
   33|       |
   34|  16.1k|    if (!ossl_assert(hdr != NULL))
  ------------------
  |  |   52|  16.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  16.1k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (34:9): [True: 0, False: 16.1k]
  ------------------
   35|      0|        return -1;
   36|  16.1k|    if (!ASN1_INTEGER_get_int64(&pvno, hdr->pvno) || pvno < 0 || pvno > INT_MAX)
  ------------------
  |  Branch (36:9): [True: 334, False: 15.7k]
  |  Branch (36:54): [True: 6.73k, False: 9.05k]
  |  Branch (36:66): [True: 128, False: 8.92k]
  ------------------
   37|  7.19k|        return -1;
   38|  8.92k|    return (int)pvno;
   39|  16.1k|}
ossl_cmp_hdr_get_protection_nid:
   42|  9.81k|{
   43|  9.81k|    if (!ossl_assert(hdr != NULL)
  ------------------
  |  |   52|  19.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  19.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (43:9): [True: 0, False: 9.81k]
  ------------------
   44|  9.81k|            || hdr->protectionAlg == NULL)
  ------------------
  |  Branch (44:16): [True: 7.36k, False: 2.44k]
  ------------------
   45|  7.36k|        return NID_undef;
  ------------------
  |  |   18|  7.36k|#define NID_undef                       0
  ------------------
   46|  2.44k|    return OBJ_obj2nid(hdr->protectionAlg->algorithm);
   47|  9.81k|}
ossl_cmp_general_name_is_NULL_DN:
   87|    708|{
   88|    708|    return name == NULL
  ------------------
  |  Branch (88:12): [True: 0, False: 708]
  ------------------
   89|    708|        || (name->type == GEN_DIRNAME && IS_NULL_DN(name->d.directoryName));
  ------------------
  |  |  177|  1.41k|# define GEN_DIRNAME     4
  ------------------
                      || (name->type == GEN_DIRNAME && IS_NULL_DN(name->d.directoryName));
  ------------------
  |  |   28|    708|# define IS_NULL_DN(name) (X509_NAME_get_entry(name, 0) == NULL)
  |  |  ------------------
  |  |  |  Branch (28:27): [True: 708, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (89:13): [True: 708, False: 0]
  ------------------
   90|    708|}
ossl_cmp_hdr_set1_sender:
   98|  7.77k|{
   99|  7.77k|    if (!ossl_assert(hdr != NULL))
  ------------------
  |  |   52|  7.77k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (99:9): [True: 0, False: 7.77k]
  ------------------
  100|      0|        return 0;
  101|  7.77k|    return GENERAL_NAME_set1_X509_NAME(&hdr->sender, nm);
  102|  7.77k|}
ossl_cmp_hdr_set1_recipient:
  105|  7.77k|{
  106|  7.77k|    if (!ossl_assert(hdr != NULL))
  ------------------
  |  |   52|  7.77k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (106:9): [True: 0, False: 7.77k]
  ------------------
  107|      0|        return 0;
  108|  7.77k|    return GENERAL_NAME_set1_X509_NAME(&hdr->recipient, nm);
  109|  7.77k|}
ossl_cmp_hdr_update_messageTime:
  112|  7.77k|{
  113|  7.77k|    if (!ossl_assert(hdr != NULL))
  ------------------
  |  |   52|  7.77k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (113:9): [True: 0, False: 7.77k]
  ------------------
  114|      0|        return 0;
  115|  7.77k|    if (hdr->messageTime == NULL
  ------------------
  |  Branch (115:9): [True: 7.77k, False: 0]
  ------------------
  116|  7.77k|            && (hdr->messageTime = ASN1_GENERALIZEDTIME_new()) == NULL)
  ------------------
  |  Branch (116:16): [True: 0, False: 7.77k]
  ------------------
  117|      0|        return 0;
  118|  7.77k|    return ASN1_GENERALIZEDTIME_set(hdr->messageTime, time(NULL)) != NULL;
  119|  7.77k|}
ossl_cmp_hdr_set_transactionID:
  254|  7.77k|{
  255|  7.77k|    if (ctx->transactionID == NULL) {
  ------------------
  |  Branch (255:9): [True: 6.85k, False: 914]
  ------------------
  256|  6.85k|        char *tid;
  257|       |
  258|  6.85k|        if (!set_random(&ctx->transactionID, ctx,
  ------------------
  |  Branch (258:13): [True: 0, False: 6.85k]
  ------------------
  259|  6.85k|                        OSSL_CMP_TRANSACTIONID_LENGTH))
  ------------------
  |  |  905|  6.85k|# define OSSL_CMP_TRANSACTIONID_LENGTH 16
  ------------------
  260|      0|            return 0;
  261|  6.85k|        tid = i2s_ASN1_OCTET_STRING(NULL, ctx->transactionID);
  262|  6.85k|        if (tid != NULL)
  ------------------
  |  Branch (262:13): [True: 6.85k, False: 0]
  ------------------
  263|  6.85k|            ossl_cmp_log1(DEBUG, ctx,
  ------------------
  |  |  844|  6.85k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  6.85k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  6.85k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|  6.85k|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|  6.85k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  264|  6.85k|                          "Starting new transaction with ID=%s", tid);
  265|  6.85k|        OPENSSL_free(tid);
  ------------------
  |  |  115|  6.85k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.85k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.85k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|  6.85k|    }
  267|       |
  268|  7.77k|    return ossl_cmp_asn1_octet_string_set1(&hdr->transactionID,
  269|  7.77k|                                           ctx->transactionID);
  270|  7.77k|}
ossl_cmp_hdr_init:
  274|  7.77k|{
  275|  7.77k|    const X509_NAME *sender;
  276|  7.77k|    const X509_NAME *rcp = NULL;
  277|       |
  278|  7.77k|    if (!ossl_assert(ctx != NULL && hdr != NULL))
  ------------------
  |  |   52|  15.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 7.77k, False: 0]
  |  |  |  Branch (52:43): [True: 7.77k, False: 0]
  |  |  ------------------
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (278:9): [True: 0, False: 7.77k]
  ------------------
  279|      0|        return 0;
  280|       |
  281|       |    /* set the CMP version */
  282|  7.77k|    if (!ossl_cmp_hdr_set_pvno(hdr, OSSL_CMP_PVNO))
  ------------------
  |  |   40|  7.77k|#  define OSSL_CMP_PVNO OSSL_CMP_PVNO_2 /* v2 is the default */
  |  |  ------------------
  |  |  |  |   38|  7.77k|#  define OSSL_CMP_PVNO_2 2
  |  |  ------------------
  ------------------
  |  Branch (282:9): [True: 0, False: 7.77k]
  ------------------
  283|      0|        return 0;
  284|       |
  285|       |    /*
  286|       |     * If no protection cert nor oldCert nor CSR nor subject is given,
  287|       |     * sender name is not known to the client and thus set to NULL-DN
  288|       |     */
  289|  7.77k|    sender = ctx->cert != NULL ? X509_get_subject_name(ctx->cert) :
  ------------------
  |  Branch (289:14): [True: 0, False: 7.77k]
  ------------------
  290|  7.77k|        ctx->oldCert != NULL ? X509_get_subject_name(ctx->oldCert) :
  ------------------
  |  Branch (290:9): [True: 733, False: 7.03k]
  ------------------
  291|  7.77k|        ctx->p10CSR != NULL ? X509_REQ_get_subject_name(ctx->p10CSR) :
  ------------------
  |  Branch (291:9): [True: 0, False: 7.03k]
  ------------------
  292|  7.03k|        ctx->subjectName;
  293|  7.77k|    if (!ossl_cmp_hdr_set1_sender(hdr, sender))
  ------------------
  |  Branch (293:9): [True: 0, False: 7.77k]
  ------------------
  294|      0|        return 0;
  295|       |
  296|       |    /* determine recipient entry in PKIHeader */
  297|  7.77k|    if (ctx->recipient != NULL)
  ------------------
  |  Branch (297:9): [True: 2.44k, False: 5.32k]
  ------------------
  298|  2.44k|        rcp = ctx->recipient;
  299|  5.32k|    else if (ctx->srvCert != NULL)
  ------------------
  |  Branch (299:14): [True: 0, False: 5.32k]
  ------------------
  300|      0|        rcp = X509_get_subject_name(ctx->srvCert);
  301|  5.32k|    else if (ctx->issuer != NULL)
  ------------------
  |  Branch (301:14): [True: 0, False: 5.32k]
  ------------------
  302|      0|        rcp = ctx->issuer;
  303|  5.32k|    else if (ctx->oldCert != NULL)
  ------------------
  |  Branch (303:14): [True: 733, False: 4.58k]
  ------------------
  304|    733|        rcp = X509_get_issuer_name(ctx->oldCert);
  305|  4.58k|    else if (ctx->cert != NULL)
  ------------------
  |  Branch (305:14): [True: 0, False: 4.58k]
  ------------------
  306|      0|        rcp = X509_get_issuer_name(ctx->cert);
  307|  7.77k|    if (!ossl_cmp_hdr_set1_recipient(hdr, rcp))
  ------------------
  |  Branch (307:9): [True: 0, False: 7.77k]
  ------------------
  308|      0|        return 0;
  309|       |
  310|       |    /* set current time as message time */
  311|  7.77k|    if (!ossl_cmp_hdr_update_messageTime(hdr))
  ------------------
  |  Branch (311:9): [True: 0, False: 7.77k]
  ------------------
  312|      0|        return 0;
  313|       |
  314|  7.77k|    if (ctx->recipNonce != NULL
  ------------------
  |  Branch (314:9): [True: 920, False: 6.85k]
  ------------------
  315|  7.77k|            && !ossl_cmp_asn1_octet_string_set1(&hdr->recipNonce,
  ------------------
  |  Branch (315:16): [True: 0, False: 920]
  ------------------
  316|    920|                                                ctx->recipNonce))
  317|      0|        return 0;
  318|       |
  319|  7.77k|    if (!ossl_cmp_hdr_set_transactionID(ctx, hdr))
  ------------------
  |  Branch (319:9): [True: 0, False: 7.77k]
  ------------------
  320|      0|        return 0;
  321|       |
  322|       |    /*-
  323|       |     * set random senderNonce
  324|       |     * according to section 5.1.1:
  325|       |     *
  326|       |     * senderNonce                  present
  327|       |     *         -- 128 (pseudo-)random bits
  328|       |     * The senderNonce and recipNonce fields protect the PKIMessage against
  329|       |     * replay attacks. The senderNonce will typically be 128 bits of
  330|       |     * (pseudo-) random data generated by the sender, whereas the recipNonce
  331|       |     * is copied from the senderNonce of the previous message in the
  332|       |     * transaction.
  333|       |     */
  334|  7.77k|    if (!set_random(&hdr->senderNonce, ctx, OSSL_CMP_SENDERNONCE_LENGTH))
  ------------------
  |  |  906|  7.77k|# define OSSL_CMP_SENDERNONCE_LENGTH 16
  ------------------
  |  Branch (334:9): [True: 0, False: 7.77k]
  ------------------
  335|      0|        return 0;
  336|       |
  337|       |    /* store senderNonce - for cmp with recipNonce in next outgoing msg */
  338|  7.77k|    if (!OSSL_CMP_CTX_set1_senderNonce(ctx, hdr->senderNonce))
  ------------------
  |  Branch (338:9): [True: 0, False: 7.77k]
  ------------------
  339|      0|        return 0;
  340|       |
  341|       |    /*-
  342|       |     * freeText                [7] PKIFreeText OPTIONAL,
  343|       |     * -- this may be used to indicate context-specific instructions
  344|       |     * -- (this field is intended for human consumption)
  345|       |     */
  346|  7.77k|    if (ctx->freeText != NULL
  ------------------
  |  Branch (346:9): [True: 0, False: 7.77k]
  ------------------
  347|  7.77k|            && !ossl_cmp_hdr_push1_freeText(hdr, ctx->freeText))
  ------------------
  |  Branch (347:16): [True: 0, False: 0]
  ------------------
  348|      0|        return 0;
  349|       |
  350|  7.77k|    return 1;
  351|  7.77k|}
cmp_hdr.c:set_random:
  123|  14.6k|{
  124|  14.6k|    unsigned char *bytes = OPENSSL_malloc(len);
  ------------------
  |  |  102|  14.6k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  14.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  14.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  125|  14.6k|    int res = 0;
  126|       |
  127|  14.6k|    if (bytes == NULL || RAND_bytes_ex(ctx->libctx, bytes, len, 0) <= 0)
  ------------------
  |  Branch (127:9): [True: 0, False: 14.6k]
  |  Branch (127:26): [True: 0, False: 14.6k]
  ------------------
  128|  14.6k|        ERR_raise(ERR_LIB_CMP, CMP_R_FAILURE_OBTAINING_RANDOM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  129|  14.6k|    else
  130|  14.6k|        res = ossl_cmp_asn1_octet_string_set1_bytes(tgt, bytes, len);
  131|  14.6k|    OPENSSL_free(bytes);
  ------------------
  |  |  115|  14.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  14.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  14.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  14.6k|    return res;
  133|  14.6k|}

OSSL_CMP_MSG_new:
   27|  7.77k|{
   28|  7.77k|    OSSL_CMP_MSG *msg = NULL;
   29|       |
   30|  7.77k|    msg = (OSSL_CMP_MSG *)ASN1_item_new_ex(ASN1_ITEM_rptr(OSSL_CMP_MSG),
  ------------------
  |  |  427|  7.77k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   31|  7.77k|                                           libctx, propq);
   32|  7.77k|    if (!ossl_cmp_msg_set0_libctx(msg, libctx, propq)) {
  ------------------
  |  Branch (32:9): [True: 0, False: 7.77k]
  ------------------
   33|      0|        OSSL_CMP_MSG_free(msg);
   34|      0|        msg = NULL;
   35|      0|    }
   36|  7.77k|    return msg;
   37|  7.77k|}
OSSL_CMP_MSG_free:
   40|  22.8k|{
   41|  22.8k|    ASN1_item_free((ASN1_VALUE *)msg, ASN1_ITEM_rptr(OSSL_CMP_MSG));
  ------------------
  |  |  427|  22.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   42|  22.8k|}
ossl_cmp_msg_set0_libctx:
   51|  7.77k|{
   52|  7.77k|    if (msg != NULL) {
  ------------------
  |  Branch (52:9): [True: 7.77k, False: 0]
  ------------------
   53|  7.77k|        msg->libctx = libctx;
   54|  7.77k|        OPENSSL_free(msg->propq);
  ------------------
  |  |  115|  7.77k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  7.77k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  7.77k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|  7.77k|        msg->propq = NULL;
   56|  7.77k|        if (propq != NULL) {
  ------------------
  |  Branch (56:13): [True: 0, False: 7.77k]
  ------------------
   57|      0|            msg->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|      0|            if (msg->propq == NULL)
  ------------------
  |  Branch (58:17): [True: 0, False: 0]
  ------------------
   59|      0|                return 0;
   60|      0|        }
   61|  7.77k|    }
   62|  7.77k|    return 1;
   63|  7.77k|}
OSSL_CMP_MSG_get0_header:
   66|  16.4k|{
   67|  16.4k|    if (msg == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 16.4k]
  ------------------
   68|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   69|      0|        return NULL;
   70|      0|    }
   71|  16.4k|    return msg->header;
   72|  16.4k|}
ossl_cmp_bodytype_to_string:
   75|  6.94k|{
   76|  6.94k|    static const char *type_names[] = {
   77|  6.94k|        "IR", "IP", "CR", "CP", "P10CR",
   78|  6.94k|        "POPDECC", "POPDECR", "KUR", "KUP",
   79|  6.94k|        "KRR", "KRP", "RR", "RP", "CCR", "CCP",
   80|  6.94k|        "CKUANN", "CANN", "RANN", "CRLANN", "PKICONF", "NESTED",
   81|  6.94k|        "GENM", "GENP", "ERROR", "CERTCONF", "POLLREQ", "POLLREP",
   82|  6.94k|    };
   83|       |
   84|  6.94k|    if (type < 0 || type > OSSL_CMP_PKIBODY_TYPE_MAX)
  ------------------
  |  |  939|  6.94k|# define OSSL_CMP_PKIBODY_TYPE_MAX OSSL_CMP_PKIBODY_POLLREP
  |  |  ------------------
  |  |  |  |  938|  6.94k|# define OSSL_CMP_PKIBODY_POLLREP  26
  |  |  ------------------
  ------------------
  |  Branch (84:9): [True: 0, False: 6.94k]
  |  Branch (84:21): [True: 0, False: 6.94k]
  ------------------
   85|      0|        return "illegal body type";
   86|  6.94k|    return type_names[type];
   87|  6.94k|}
ossl_cmp_msg_set_bodytype:
   90|  7.77k|{
   91|  7.77k|    if (!ossl_assert(msg != NULL && msg->body != NULL))
  ------------------
  |  |   52|  15.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 7.77k, False: 0]
  |  |  |  Branch (52:43): [True: 7.77k, False: 0]
  |  |  ------------------
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (91:9): [True: 0, False: 7.77k]
  ------------------
   92|      0|        return 0;
   93|       |
   94|  7.77k|    msg->body->type = type;
   95|  7.77k|    return 1;
   96|  7.77k|}
OSSL_CMP_MSG_get_bodytype:
   99|  22.6k|{
  100|  22.6k|    if (!ossl_assert(msg != NULL && msg->body != NULL))
  ------------------
  |  |   52|  45.3k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 22.6k, False: 0]
  |  |  |  Branch (52:43): [True: 22.6k, False: 0]
  |  |  ------------------
  |  |   53|  22.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (100:9): [True: 0, False: 22.6k]
  ------------------
  101|      0|        return -1;
  102|       |
  103|  22.6k|    return msg->body->type;
  104|  22.6k|}
ossl_cmp_msg_create:
  164|  7.77k|{
  165|  7.77k|    OSSL_CMP_MSG *msg = NULL;
  166|       |
  167|  7.77k|    if (!ossl_assert(ctx != NULL))
  ------------------
  |  |   52|  7.77k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  7.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (167:9): [True: 0, False: 7.77k]
  ------------------
  168|      0|        return NULL;
  169|       |
  170|  7.77k|    if ((msg = OSSL_CMP_MSG_new(ctx->libctx, ctx->propq)) == NULL)
  ------------------
  |  Branch (170:9): [True: 0, False: 7.77k]
  ------------------
  171|      0|        return NULL;
  172|  7.77k|    if (!ossl_cmp_hdr_init(ctx, msg->header)
  ------------------
  |  Branch (172:9): [True: 0, False: 7.77k]
  ------------------
  173|  7.77k|            || !ossl_cmp_msg_set_bodytype(msg, bodytype))
  ------------------
  |  Branch (173:16): [True: 0, False: 7.77k]
  ------------------
  174|      0|        goto err;
  175|  7.77k|    if (ctx->geninfo_ITAVs != NULL
  ------------------
  |  Branch (175:9): [True: 0, False: 7.77k]
  ------------------
  176|  7.77k|            && !ossl_cmp_hdr_generalInfo_push1_items(msg->header,
  ------------------
  |  Branch (176:16): [True: 0, False: 0]
  ------------------
  177|      0|                                                     ctx->geninfo_ITAVs))
  178|      0|        goto err;
  179|       |
  180|  7.77k|    switch (bodytype) {
  181|    255|    case OSSL_CMP_PKIBODY_IR:
  ------------------
  |  |  912|    255|# define OSSL_CMP_PKIBODY_IR        0
  ------------------
  |  Branch (181:5): [True: 255, False: 7.51k]
  ------------------
  182|    280|    case OSSL_CMP_PKIBODY_CR:
  ------------------
  |  |  914|    280|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
  |  Branch (182:5): [True: 25, False: 7.74k]
  ------------------
  183|    303|    case OSSL_CMP_PKIBODY_KUR:
  ------------------
  |  |  919|    303|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
  |  Branch (183:5): [True: 23, False: 7.74k]
  ------------------
  184|    303|        if ((msg->body->value.ir = OSSL_CRMF_MSGS_new()) == NULL)
  ------------------
  |  Branch (184:13): [True: 0, False: 303]
  ------------------
  185|      0|            goto err;
  186|    303|        return msg;
  187|       |
  188|     25|    case OSSL_CMP_PKIBODY_P10CR:
  ------------------
  |  |  916|     25|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (188:5): [True: 25, False: 7.74k]
  ------------------
  189|     25|        if (ctx->p10CSR == NULL) {
  ------------------
  |  Branch (189:13): [True: 25, False: 0]
  ------------------
  190|     25|            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_P10CSR);
  ------------------
  |  |  401|     25|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     25|    (ERR_new(),                                                 \
  |  |  |  |  404|     25|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     25|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     25|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     25|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     25|     ERR_set_error)
  |  |  ------------------
  ------------------
  191|     25|            goto err;
  192|     25|        }
  193|      0|        if ((msg->body->value.p10cr = X509_REQ_dup(ctx->p10CSR)) == NULL)
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  ------------------
  194|      0|            goto err;
  195|      0|        return msg;
  196|       |
  197|      0|    case OSSL_CMP_PKIBODY_IP:
  ------------------
  |  |  913|      0|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  |  Branch (197:5): [True: 0, False: 7.77k]
  ------------------
  198|      0|    case OSSL_CMP_PKIBODY_CP:
  ------------------
  |  |  915|      0|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (198:5): [True: 0, False: 7.77k]
  ------------------
  199|      0|    case OSSL_CMP_PKIBODY_KUP:
  ------------------
  |  |  920|      0|# define OSSL_CMP_PKIBODY_KUP       8
  ------------------
  |  Branch (199:5): [True: 0, False: 7.77k]
  ------------------
  200|      0|        if ((msg->body->value.ip = OSSL_CMP_CERTREPMESSAGE_new()) == NULL)
  ------------------
  |  Branch (200:13): [True: 0, False: 0]
  ------------------
  201|      0|            goto err;
  202|      0|        return msg;
  203|       |
  204|    109|    case OSSL_CMP_PKIBODY_RR:
  ------------------
  |  |  923|    109|# define OSSL_CMP_PKIBODY_RR       11
  ------------------
  |  Branch (204:5): [True: 109, False: 7.66k]
  ------------------
  205|    109|        if ((msg->body->value.rr = sk_OSSL_CMP_REVDETAILS_new_null()) == NULL)
  ------------------
  |  Branch (205:13): [True: 0, False: 109]
  ------------------
  206|      0|            goto err;
  207|    109|        return msg;
  208|      0|    case OSSL_CMP_PKIBODY_RP:
  ------------------
  |  |  924|      0|# define OSSL_CMP_PKIBODY_RP       12
  ------------------
  |  Branch (208:5): [True: 0, False: 7.77k]
  ------------------
  209|      0|        if ((msg->body->value.rp = OSSL_CMP_REVREPCONTENT_new()) == NULL)
  ------------------
  |  Branch (209:13): [True: 0, False: 0]
  ------------------
  210|      0|            goto err;
  211|      0|        return msg;
  212|       |
  213|      0|    case OSSL_CMP_PKIBODY_CERTCONF:
  ------------------
  |  |  936|      0|# define OSSL_CMP_PKIBODY_CERTCONF 24
  ------------------
  |  Branch (213:5): [True: 0, False: 7.77k]
  ------------------
  214|      0|        if ((msg->body->value.certConf =
  ------------------
  |  Branch (214:13): [True: 0, False: 0]
  ------------------
  215|      0|             sk_OSSL_CMP_CERTSTATUS_new_null()) == NULL)
  ------------------
  |  |  226|      0|#define sk_OSSL_CMP_CERTSTATUS_new_null() ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_null())
  ------------------
  216|      0|            goto err;
  217|      0|        return msg;
  218|     90|    case OSSL_CMP_PKIBODY_PKICONF:
  ------------------
  |  |  931|     90|# define OSSL_CMP_PKIBODY_PKICONF  19
  ------------------
  |  Branch (218:5): [True: 90, False: 7.68k]
  ------------------
  219|     90|        if ((msg->body->value.pkiconf = ASN1_TYPE_new()) == NULL)
  ------------------
  |  Branch (219:13): [True: 0, False: 90]
  ------------------
  220|      0|            goto err;
  221|     90|        ASN1_TYPE_set(msg->body->value.pkiconf, V_ASN1_NULL, NULL);
  ------------------
  |  |   67|     90|# define V_ASN1_NULL                     5
  ------------------
  222|     90|        return msg;
  223|       |
  224|     70|    case OSSL_CMP_PKIBODY_POLLREQ:
  ------------------
  |  |  937|     70|# define OSSL_CMP_PKIBODY_POLLREQ  25
  ------------------
  |  Branch (224:5): [True: 70, False: 7.70k]
  ------------------
  225|     70|        if ((msg->body->value.pollReq = sk_OSSL_CMP_POLLREQ_new_null()) == NULL)
  ------------------
  |  Branch (225:13): [True: 0, False: 70]
  ------------------
  226|      0|            goto err;
  227|     70|        return msg;
  228|      0|    case OSSL_CMP_PKIBODY_POLLREP:
  ------------------
  |  |  938|      0|# define OSSL_CMP_PKIBODY_POLLREP  26
  ------------------
  |  Branch (228:5): [True: 0, False: 7.77k]
  ------------------
  229|      0|        if ((msg->body->value.pollRep = sk_OSSL_CMP_POLLREP_new_null()) == NULL)
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            goto err;
  231|      0|        return msg;
  232|       |
  233|    226|    case OSSL_CMP_PKIBODY_GENM:
  ------------------
  |  |  933|    226|# define OSSL_CMP_PKIBODY_GENM     21
  ------------------
  |  Branch (233:5): [True: 226, False: 7.54k]
  ------------------
  234|    226|    case OSSL_CMP_PKIBODY_GENP:
  ------------------
  |  |  934|    226|# define OSSL_CMP_PKIBODY_GENP     22
  ------------------
  |  Branch (234:5): [True: 0, False: 7.77k]
  ------------------
  235|    226|        if ((msg->body->value.genm = sk_OSSL_CMP_ITAV_new_null()) == NULL)
  ------------------
  |  |  255|    226|#define sk_OSSL_CMP_ITAV_new_null() ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (235:13): [True: 0, False: 226]
  ------------------
  236|      0|            goto err;
  237|    226|        return msg;
  238|       |
  239|  6.94k|    case OSSL_CMP_PKIBODY_ERROR:
  ------------------
  |  |  935|  6.94k|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (239:5): [True: 6.94k, False: 823]
  ------------------
  240|  6.94k|        if ((msg->body->value.error = OSSL_CMP_ERRORMSGCONTENT_new()) == NULL)
  ------------------
  |  Branch (240:13): [True: 0, False: 6.94k]
  ------------------
  241|      0|            goto err;
  242|  6.94k|        return msg;
  243|       |
  244|      0|    default:
  ------------------
  |  Branch (244:5): [True: 0, False: 7.77k]
  ------------------
  245|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  246|      0|        goto err;
  247|  7.77k|    }
  248|       |
  249|     25| err:
  250|     25|    OSSL_CMP_MSG_free(msg);
  251|     25|    return NULL;
  252|  7.77k|}
OSSL_CMP_CTX_setup_CRM:
  275|    303|{
  276|    303|    OSSL_CRMF_MSG *crm = NULL;
  277|    303|    int central_keygen = OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_POPO_METHOD)
  ------------------
  |  |  493|    303|#  define OSSL_CMP_OPT_POPO_METHOD 24
  ------------------
  278|    303|        == OSSL_CRMF_POPO_NONE;
  ------------------
  |  |  224|    303|#  define OSSL_CRMF_POPO_NONE       -1
  ------------------
  279|    303|    X509 *refcert = ctx->oldCert != NULL ? ctx->oldCert : ctx->cert;
  ------------------
  |  Branch (279:21): [True: 303, False: 0]
  ------------------
  280|       |    /* refcert defaults to current client cert */
  281|    303|    EVP_PKEY *rkey = ossl_cmp_ctx_get0_newPubkey(ctx);
  282|    303|    STACK_OF(GENERAL_NAME) *default_sans = NULL;
  ------------------
  |  |   31|    303|# define STACK_OF(type) struct stack_st_##type
  ------------------
  283|    303|    const X509_NAME *ref_subj =
  284|    303|        refcert != NULL ? X509_get_subject_name(refcert) : NULL;
  ------------------
  |  Branch (284:9): [True: 303, False: 0]
  ------------------
  285|    303|    const X509_NAME *subject = determine_subj(ctx, for_KUR, ref_subj);
  286|    303|    const X509_NAME *issuer = ctx->issuer != NULL || refcert == NULL
  ------------------
  |  Branch (286:31): [True: 0, False: 303]
  |  Branch (286:54): [True: 0, False: 303]
  ------------------
  287|    303|        ? (IS_NULL_DN(ctx->issuer) ? NULL : ctx->issuer)
  ------------------
  |  |   28|      0|# define IS_NULL_DN(name) (X509_NAME_get_entry(name, 0) == NULL)
  |  |  ------------------
  |  |  |  Branch (28:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  288|    303|        : X509_get_issuer_name(refcert);
  289|    303|    int crit = ctx->setSubjectAltNameCritical || subject == NULL;
  ------------------
  |  Branch (289:16): [True: 0, False: 303]
  |  Branch (289:50): [True: 0, False: 303]
  ------------------
  290|       |    /* RFC5280: subjectAltName MUST be critical if subject is null */
  291|    303|    OSSL_CRMF_CERTTEMPLATE *tmpl;
  292|    303|    X509_EXTENSIONS *exts = NULL;
  293|       |
  294|    303|    if (rkey == NULL && !central_keygen) {
  ------------------
  |  Branch (294:9): [True: 303, False: 0]
  |  Branch (294:25): [True: 0, False: 303]
  ------------------
  295|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  296|       |        ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_PUBLIC_KEY);
  297|       |        return NULL;
  298|       |#endif
  299|      0|    }
  300|    303|    if (for_KUR && refcert == NULL && ctx->p10CSR == NULL) {
  ------------------
  |  Branch (300:9): [True: 23, False: 280]
  |  Branch (300:20): [True: 0, False: 23]
  |  Branch (300:39): [True: 0, False: 0]
  ------------------
  301|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_REFERENCE_CERT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  302|      0|        return NULL;
  303|      0|    }
  304|    303|    if ((crm = OSSL_CRMF_MSG_new()) == NULL)
  ------------------
  |  Branch (304:9): [True: 0, False: 303]
  ------------------
  305|      0|        return NULL;
  306|    303|    tmpl = OSSL_CRMF_MSG_get0_tmpl(crm);
  307|    303|    if (!OSSL_CRMF_MSG_set_certReqId(crm, rid)
  ------------------
  |  Branch (307:9): [True: 0, False: 303]
  ------------------
  308|       |            /*
  309|       |             * fill certTemplate, corresponding to CertificationRequestInfo
  310|       |             * of PKCS#10. The rkey param cannot be NULL so far -
  311|       |             * it could be NULL if centralized key creation was supported
  312|       |             */
  313|    303|            || !OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_MSG_get0_tmpl(crm), rkey,
  ------------------
  |  Branch (313:16): [True: 0, False: 303]
  ------------------
  314|    303|                                            subject, issuer, NULL /* serial */))
  315|      0|        goto err;
  316|    303|    if (rkey != NULL && central_keygen)
  ------------------
  |  Branch (316:9): [True: 0, False: 303]
  |  Branch (316:25): [True: 0, False: 0]
  ------------------
  317|      0|        X509_PUBKEY_set0_public_key(OSSL_CRMF_CERTTEMPLATE_get0_publicKey(tmpl),
  318|      0|                                    NULL, 0);
  319|       |
  320|    303|    if (ctx->days != 0) {
  ------------------
  |  Branch (320:9): [True: 0, False: 303]
  ------------------
  321|      0|        time_t now = time(NULL);
  322|      0|        ASN1_TIME *notBefore = ASN1_TIME_adj(NULL, now, 0, 0);
  323|      0|        ASN1_TIME *notAfter = ASN1_TIME_adj(NULL, now, ctx->days, 0);
  324|       |
  325|      0|        if (notBefore == NULL
  ------------------
  |  Branch (325:13): [True: 0, False: 0]
  ------------------
  326|      0|                || notAfter == NULL
  ------------------
  |  Branch (326:20): [True: 0, False: 0]
  ------------------
  327|      0|                || !OSSL_CRMF_MSG_set0_validity(crm, notBefore, notAfter)) {
  ------------------
  |  Branch (327:20): [True: 0, False: 0]
  ------------------
  328|      0|            ASN1_TIME_free(notBefore);
  329|      0|            ASN1_TIME_free(notAfter);
  330|      0|            goto err;
  331|      0|        }
  332|      0|    }
  333|       |
  334|       |    /* extensions */
  335|    303|    if (ctx->p10CSR != NULL
  ------------------
  |  Branch (335:9): [True: 0, False: 303]
  ------------------
  336|    303|            && (exts = X509_REQ_get_extensions(ctx->p10CSR)) == NULL)
  ------------------
  |  Branch (336:16): [True: 0, False: 0]
  ------------------
  337|      0|        goto err;
  338|    303|    if (!ctx->SubjectAltName_nodefault && !HAS_SAN(ctx) && refcert != NULL
  ------------------
  |  |  255|    606|    (sk_GENERAL_NAME_num((ctx)->subjectAltNames) > 0 \
  |  |  ------------------
  |  |  |  |  238|    303|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  |  |  ------------------
  |  |  |  Branch (255:6): [True: 0, False: 303]
  |  |  ------------------
  |  |  256|    606|         || OSSL_CMP_CTX_reqExtensions_have_SAN(ctx) == 1)
  |  |  ------------------
  |  |  |  Branch (256:13): [True: 0, False: 303]
  |  |  ------------------
  ------------------
  |  Branch (338:9): [True: 303, False: 0]
  |  Branch (338:60): [True: 303, False: 0]
  ------------------
  339|    303|        && (default_sans = X509V3_get_d2i(X509_get0_extensions(refcert),
  ------------------
  |  Branch (339:12): [True: 0, False: 303]
  ------------------
  340|    303|                                          NID_subject_alt_name, NULL, NULL))
  ------------------
  |  | 2672|    303|#define NID_subject_alt_name            85
  ------------------
  341|    303|        != NULL
  342|    303|            && !add1_extension(&exts, NID_subject_alt_name, crit, default_sans))
  ------------------
  |  | 2672|      0|#define NID_subject_alt_name            85
  ------------------
  |  Branch (342:16): [True: 0, False: 0]
  ------------------
  343|      0|        goto err;
  344|    303|    if (sk_X509_EXTENSION_num(ctx->reqExtensions) > 0 /* augment/override existing ones */
  ------------------
  |  |  235|    303|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (344:9): [True: 0, False: 303]
  ------------------
  345|    303|            && X509v3_add_extensions(&exts, ctx->reqExtensions) == NULL)
  ------------------
  |  Branch (345:16): [True: 0, False: 0]
  ------------------
  346|      0|        goto err;
  347|    303|    if (sk_GENERAL_NAME_num(ctx->subjectAltNames) > 0
  ------------------
  |  |  238|    303|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (347:9): [True: 0, False: 303]
  ------------------
  348|    303|            && !add1_extension(&exts, NID_subject_alt_name,
  ------------------
  |  | 2672|      0|#define NID_subject_alt_name            85
  ------------------
  |  Branch (348:16): [True: 0, False: 0]
  ------------------
  349|      0|                               crit, ctx->subjectAltNames))
  350|      0|        goto err;
  351|    303|    if (ctx->policies != NULL
  ------------------
  |  Branch (351:9): [True: 0, False: 303]
  ------------------
  352|    303|            && !add1_extension(&exts, NID_certificate_policies,
  ------------------
  |  | 2727|      0|#define NID_certificate_policies                89
  ------------------
  |  Branch (352:16): [True: 0, False: 0]
  ------------------
  353|      0|                               ctx->setPoliciesCritical, ctx->policies))
  354|      0|        goto err;
  355|    303|    if (!OSSL_CRMF_MSG_set0_extensions(crm, exts))
  ------------------
  |  Branch (355:9): [True: 0, False: 303]
  ------------------
  356|      0|        goto err;
  357|    303|    exts = NULL;
  358|       |    /* end fill certTemplate, now set any controls */
  359|       |
  360|       |    /* for KUR, set OldCertId according to D.6 */
  361|    303|    if (for_KUR && refcert != NULL) {
  ------------------
  |  Branch (361:9): [True: 23, False: 280]
  |  Branch (361:20): [True: 23, False: 0]
  ------------------
  362|     23|        OSSL_CRMF_CERTID *cid =
  363|     23|            OSSL_CRMF_CERTID_gen(X509_get_issuer_name(refcert),
  364|     23|                                 X509_get0_serialNumber(refcert));
  365|     23|        int ret;
  366|       |
  367|     23|        if (cid == NULL)
  ------------------
  |  Branch (367:13): [True: 0, False: 23]
  ------------------
  368|      0|            goto err;
  369|     23|        ret = OSSL_CRMF_MSG_set1_regCtrl_oldCertID(crm, cid);
  370|     23|        OSSL_CRMF_CERTID_free(cid);
  371|     23|        if (ret == 0)
  ------------------
  |  Branch (371:13): [True: 0, False: 23]
  ------------------
  372|      0|            goto err;
  373|     23|    }
  374|       |
  375|    303|    goto end;
  376|       |
  377|    303| err:
  378|      0|    OSSL_CRMF_MSG_free(crm);
  379|      0|    crm = NULL;
  380|       |
  381|    303| end:
  382|    303|    sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
  ------------------
  |  |  249|    303|#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_freefunc_type(freefunc))
  ------------------
  383|    303|    sk_GENERAL_NAME_pop_free(default_sans, GENERAL_NAME_free);
  ------------------
  |  |  252|    303|#define sk_GENERAL_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_freefunc_type(freefunc))
  ------------------
  384|    303|    return crm;
  385|      0|}
ossl_cmp_certreq_new:
  389|    328|{
  390|    328|    OSSL_CMP_MSG *msg;
  391|    328|    OSSL_CRMF_MSG *local_crm = NULL;
  392|       |
  393|    328|    if (!ossl_assert(ctx != NULL))
  ------------------
  |  |   52|    328|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    328|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (393:9): [True: 0, False: 328]
  ------------------
  394|      0|        return NULL;
  395|       |
  396|    328|    if (type != OSSL_CMP_PKIBODY_IR && type != OSSL_CMP_PKIBODY_CR
  ------------------
  |  |  912|    656|# define OSSL_CMP_PKIBODY_IR        0
  ------------------
                  if (type != OSSL_CMP_PKIBODY_IR && type != OSSL_CMP_PKIBODY_CR
  ------------------
  |  |  914|    401|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
  |  Branch (396:9): [True: 73, False: 255]
  |  Branch (396:40): [True: 48, False: 25]
  ------------------
  397|    328|            && type != OSSL_CMP_PKIBODY_KUR && type != OSSL_CMP_PKIBODY_P10CR) {
  ------------------
  |  |  919|    376|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
                          && type != OSSL_CMP_PKIBODY_KUR && type != OSSL_CMP_PKIBODY_P10CR) {
  ------------------
  |  |  916|     25|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (397:16): [True: 25, False: 23]
  |  Branch (397:48): [True: 0, False: 25]
  ------------------
  398|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ARGS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return NULL;
  400|      0|    }
  401|    328|    if (type == OSSL_CMP_PKIBODY_P10CR && crm != NULL) {
  ------------------
  |  |  916|    656|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (401:9): [True: 25, False: 303]
  |  Branch (401:43): [True: 0, False: 25]
  ------------------
  402|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ARGS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  403|      0|        return NULL;
  404|      0|    }
  405|       |
  406|    328|    if ((msg = ossl_cmp_msg_create(ctx, type)) == NULL)
  ------------------
  |  Branch (406:9): [True: 25, False: 303]
  ------------------
  407|     25|        goto err;
  408|       |
  409|       |    /* header */
  410|    303|    if (ctx->implicitConfirm && !ossl_cmp_hdr_set_implicitConfirm(msg->header))
  ------------------
  |  Branch (410:9): [True: 0, False: 303]
  |  Branch (410:33): [True: 0, False: 0]
  ------------------
  411|      0|        goto err;
  412|       |
  413|       |    /* body */
  414|       |    /* For P10CR the content has already been set in OSSL_CMP_MSG_create */
  415|    303|    if (type != OSSL_CMP_PKIBODY_P10CR) {
  ------------------
  |  |  916|    303|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (415:9): [True: 303, False: 0]
  ------------------
  416|    303|        EVP_PKEY *privkey = OSSL_CMP_CTX_get0_newPkey(ctx, 1);
  417|       |
  418|       |        /* privkey is ctx->newPkey (if private, else NULL) or ctx->pkey */
  419|    303|        if (ctx->popoMethod >= OSSL_CRMF_POPO_SIGNATURE && privkey == NULL) {
  ------------------
  |  |  226|    606|#  define OSSL_CRMF_POPO_SIGNATURE  1
  ------------------
  |  Branch (419:13): [True: 0, False: 303]
  |  Branch (419:60): [True: 0, False: 0]
  ------------------
  420|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_PRIVATE_KEY_FOR_POPO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  421|      0|            goto err;
  422|      0|        }
  423|    303|        if (crm == NULL) {
  ------------------
  |  Branch (423:13): [True: 303, False: 0]
  ------------------
  424|    303|            local_crm = OSSL_CMP_CTX_setup_CRM(ctx,
  425|    303|                                               type == OSSL_CMP_PKIBODY_KUR,
  ------------------
  |  |  919|    303|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
  426|    303|                                               OSSL_CMP_CERTREQID);
  ------------------
  |  |  941|    303|# define OSSL_CMP_CERTREQID         0
  ------------------
  427|    303|            if (local_crm == NULL
  ------------------
  |  Branch (427:17): [True: 0, False: 303]
  ------------------
  428|    303|                || !OSSL_CRMF_MSG_create_popo(ctx->popoMethod, local_crm,
  ------------------
  |  Branch (428:20): [True: 0, False: 303]
  ------------------
  429|    303|                                              privkey, ctx->digest,
  430|    303|                                              ctx->libctx, ctx->propq))
  431|      0|                goto err;
  432|    303|        } else {
  433|      0|            if ((local_crm = OSSL_CRMF_MSG_dup(crm)) == NULL)
  ------------------
  |  Branch (433:17): [True: 0, False: 0]
  ------------------
  434|      0|                goto err;
  435|      0|        }
  436|       |
  437|       |        /* value.ir is same for cr and kur */
  438|    303|        if (!sk_OSSL_CRMF_MSG_push(msg->body->value.ir, local_crm))
  ------------------
  |  |   67|    303|#define sk_OSSL_CRMF_MSG_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
  ------------------
  |  Branch (438:13): [True: 0, False: 303]
  ------------------
  439|      0|            goto err;
  440|    303|        local_crm = NULL;
  441|    303|    }
  442|       |
  443|    303|    if (!ossl_cmp_msg_protect(ctx, msg))
  ------------------
  |  Branch (443:9): [True: 303, False: 0]
  ------------------
  444|    303|        goto err;
  445|       |
  446|      0|    return msg;
  447|       |
  448|    328| err:
  449|    328|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREQ);
  ------------------
  |  |  401|    328|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    328|    (ERR_new(),                                                 \
  |  |  |  |  404|    328|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    328|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    328|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    328|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    328|     ERR_set_error)
  |  |  ------------------
  ------------------
  450|    328|    OSSL_CRMF_MSG_free(local_crm);
  451|    328|    OSSL_CMP_MSG_free(msg);
  452|    328|    return NULL;
  453|    303|}
ossl_cmp_rr_new:
  578|    109|{
  579|    109|    OSSL_CMP_MSG *msg = NULL;
  580|    109|    const X509_NAME *issuer = NULL;
  581|    109|    const X509_NAME *subject = NULL;
  582|    109|    const ASN1_INTEGER *serialNumber = NULL;
  583|    109|    EVP_PKEY *pubkey = NULL;
  584|    109|    OSSL_CMP_REVDETAILS *rd;
  585|    109|    int ret;
  586|       |
  587|    109|    if (!ossl_assert(ctx != NULL
  ------------------
  |  |   52|    436|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 109, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 109, False: 0]
  |  |  ------------------
  |  |   53|    109|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (587:9): [True: 0, False: 109]
  ------------------
  588|    109|                     && (ctx->oldCert != NULL || ctx->p10CSR != NULL
  589|    109|                         || (ctx->serialNumber != NULL && ctx->issuer != NULL))))
  590|      0|        return NULL;
  591|       |
  592|    109|    if ((rd = OSSL_CMP_REVDETAILS_new()) == NULL)
  ------------------
  |  Branch (592:9): [True: 0, False: 109]
  ------------------
  593|      0|        goto err;
  594|       |
  595|    109|    if (ctx->serialNumber != NULL && ctx->issuer != NULL) {
  ------------------
  |  Branch (595:9): [True: 0, False: 109]
  |  Branch (595:38): [True: 0, False: 0]
  ------------------
  596|      0|        issuer = ctx->issuer;
  597|      0|        serialNumber = ctx->serialNumber;
  598|    109|    } else if (ctx->oldCert != NULL) {
  ------------------
  |  Branch (598:16): [True: 109, False: 0]
  ------------------
  599|    109|        issuer = X509_get_issuer_name(ctx->oldCert);
  600|    109|        serialNumber = X509_get0_serialNumber(ctx->oldCert);
  601|    109|    } else if (ctx->p10CSR != NULL) {
  ------------------
  |  Branch (601:16): [True: 0, False: 0]
  ------------------
  602|      0|        pubkey = X509_REQ_get0_pubkey(ctx->p10CSR);
  603|      0|        subject = X509_REQ_get_subject_name(ctx->p10CSR);
  604|      0|    } else {
  605|      0|        goto err;
  606|      0|    }
  607|       |
  608|       |    /* Fill the template from the contents of the certificate to be revoked */
  609|    109|    ret = OSSL_CRMF_CERTTEMPLATE_fill(rd->certDetails, pubkey, subject,
  610|    109|                                      issuer, serialNumber);
  611|    109|    if (!ret)
  ------------------
  |  Branch (611:9): [True: 0, False: 109]
  ------------------
  612|      0|        goto err;
  613|       |
  614|       |    /* revocation reason code is optional */
  615|    109|    if (ctx->revocationReason != CRL_REASON_NONE
  ------------------
  |  |  311|    218|# define CRL_REASON_NONE                         -1
  ------------------
  |  Branch (615:9): [True: 0, False: 109]
  ------------------
  616|    109|            && !add_crl_reason_extension(&rd->crlEntryDetails,
  ------------------
  |  Branch (616:16): [True: 0, False: 0]
  ------------------
  617|      0|                                         ctx->revocationReason))
  618|      0|        goto err;
  619|       |
  620|    109|    if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_RR)) == NULL)
  ------------------
  |  |  923|    109|# define OSSL_CMP_PKIBODY_RR       11
  ------------------
  |  Branch (620:9): [True: 0, False: 109]
  ------------------
  621|      0|        goto err;
  622|       |
  623|    109|    if (!sk_OSSL_CMP_REVDETAILS_push(msg->body->value.rr, rd))
  ------------------
  |  Branch (623:9): [True: 0, False: 109]
  ------------------
  624|      0|        goto err;
  625|    109|    rd = NULL;
  626|       |    /* Revocation Passphrase according to section 5.3.19.9 could be set here */
  627|       |
  628|    109|    if (!ossl_cmp_msg_protect(ctx, msg))
  ------------------
  |  Branch (628:9): [True: 109, False: 0]
  ------------------
  629|    109|        goto err;
  630|       |
  631|      0|    return msg;
  632|       |
  633|    109| err:
  634|    109|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_RR);
  ------------------
  |  |  401|    109|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    109|    (ERR_new(),                                                 \
  |  |  |  |  404|    109|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    109|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    109|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    109|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    109|     ERR_set_error)
  |  |  ------------------
  ------------------
  635|    109|    OSSL_CMP_MSG_free(msg);
  636|    109|    OSSL_CMP_REVDETAILS_free(rd);
  637|    109|    return NULL;
  638|    109|}
ossl_cmp_pkiconf_new:
  687|     90|{
  688|     90|    OSSL_CMP_MSG *msg;
  689|       |
  690|     90|    if (!ossl_assert(ctx != NULL))
  ------------------
  |  |   52|     90|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     90|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (690:9): [True: 0, False: 90]
  ------------------
  691|      0|        return NULL;
  692|       |
  693|     90|    if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_PKICONF)) == NULL)
  ------------------
  |  |  931|     90|# define OSSL_CMP_PKIBODY_PKICONF  19
  ------------------
  |  Branch (693:9): [True: 0, False: 90]
  ------------------
  694|      0|        goto err;
  695|     90|    if (ossl_cmp_msg_protect(ctx, msg))
  ------------------
  |  Branch (695:9): [True: 0, False: 90]
  ------------------
  696|      0|        return msg;
  697|       |
  698|     90| err:
  699|     90|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_PKICONF);
  ------------------
  |  |  401|     90|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     90|    (ERR_new(),                                                 \
  |  |  |  |  404|     90|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     90|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     90|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     90|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     90|     ERR_set_error)
  |  |  ------------------
  ------------------
  700|     90|    OSSL_CMP_MSG_free(msg);
  701|     90|    return NULL;
  702|     90|}
ossl_cmp_genm_new:
  773|    226|{
  774|    226|    return gen_new(ctx, ctx->genm_ITAVs,
  775|    226|                   OSSL_CMP_PKIBODY_GENM, CMP_R_ERROR_CREATING_GENM);
  ------------------
  |  |  933|    226|# define OSSL_CMP_PKIBODY_GENM     21
  ------------------
                                 OSSL_CMP_PKIBODY_GENM, CMP_R_ERROR_CREATING_GENM);
  ------------------
  |  |   44|    226|#  define CMP_R_ERROR_CREATING_GENM                        119
  ------------------
  776|    226|}
ossl_cmp_error_new:
  788|  6.94k|{
  789|  6.94k|    OSSL_CMP_MSG *msg = NULL;
  790|  6.94k|    const char *lib = NULL, *reason = NULL;
  791|  6.94k|    OSSL_CMP_PKIFREETEXT *ft;
  792|       |
  793|  6.94k|    if (!ossl_assert(ctx != NULL && si != NULL))
  ------------------
  |  |   52|  13.8k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 6.94k, False: 0]
  |  |  |  Branch (52:43): [True: 6.94k, False: 0]
  |  |  ------------------
  |  |   53|  6.94k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (793:9): [True: 0, False: 6.94k]
  ------------------
  794|      0|        return NULL;
  795|       |
  796|  6.94k|    if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_ERROR)) == NULL)
  ------------------
  |  |  935|  6.94k|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (796:9): [True: 0, False: 6.94k]
  ------------------
  797|      0|        goto err;
  798|       |
  799|  6.94k|    OSSL_CMP_PKISI_free(msg->body->value.error->pKIStatusInfo);
  800|  6.94k|    if ((msg->body->value.error->pKIStatusInfo = OSSL_CMP_PKISI_dup(si))
  ------------------
  |  Branch (800:9): [True: 0, False: 6.94k]
  ------------------
  801|  6.94k|        == NULL)
  802|      0|        goto err;
  803|  6.94k|    if ((msg->body->value.error->errorCode = ASN1_INTEGER_new()) == NULL)
  ------------------
  |  Branch (803:9): [True: 0, False: 6.94k]
  ------------------
  804|      0|        goto err;
  805|  6.94k|    if (!ASN1_INTEGER_set_int64(msg->body->value.error->errorCode, errorCode))
  ------------------
  |  Branch (805:9): [True: 0, False: 6.94k]
  ------------------
  806|      0|        goto err;
  807|  6.94k|    if (errorCode > 0
  ------------------
  |  Branch (807:9): [True: 6.94k, False: 0]
  ------------------
  808|  6.94k|            && (uint64_t)errorCode < ((uint64_t)ERR_SYSTEM_FLAG << 1)) {
  ------------------
  |  |  218|  6.94k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
  |  Branch (808:16): [True: 6.94k, False: 0]
  ------------------
  809|  6.94k|        lib = ERR_lib_error_string((unsigned long)errorCode);
  810|  6.94k|        reason = ERR_reason_error_string((unsigned long)errorCode);
  811|  6.94k|    }
  812|  6.94k|    if (lib != NULL || reason != NULL || details != NULL) {
  ------------------
  |  Branch (812:9): [True: 6.94k, False: 0]
  |  Branch (812:24): [True: 0, False: 0]
  |  Branch (812:42): [True: 0, False: 0]
  ------------------
  813|  6.94k|        if ((ft = sk_ASN1_UTF8STRING_new_null()) == NULL)
  ------------------
  |  |  767|  6.94k|#define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (813:13): [True: 0, False: 6.94k]
  ------------------
  814|      0|            goto err;
  815|  6.94k|        msg->body->value.error->errorDetails = ft;
  816|  6.94k|        if (lib != NULL && *lib != '\0'
  ------------------
  |  Branch (816:13): [True: 6.94k, False: 0]
  |  Branch (816:28): [True: 6.94k, False: 0]
  ------------------
  817|  6.94k|                && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, lib, -1))
  ------------------
  |  Branch (817:20): [True: 0, False: 6.94k]
  ------------------
  818|      0|            goto err;
  819|  6.94k|        if (reason != NULL && *reason != '\0'
  ------------------
  |  Branch (819:13): [True: 6.89k, False: 49]
  |  Branch (819:31): [True: 6.89k, False: 0]
  ------------------
  820|  6.94k|                && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, reason, -1))
  ------------------
  |  Branch (820:20): [True: 0, False: 6.89k]
  ------------------
  821|      0|            goto err;
  822|  6.94k|        if (details != NULL
  ------------------
  |  Branch (822:13): [True: 392, False: 6.55k]
  ------------------
  823|  6.94k|                && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, details, -1))
  ------------------
  |  Branch (823:20): [True: 0, False: 392]
  ------------------
  824|      0|            goto err;
  825|  6.94k|    }
  826|       |
  827|  6.94k|    if (!unprotected && !ossl_cmp_msg_protect(ctx, msg))
  ------------------
  |  Branch (827:9): [True: 6.94k, False: 0]
  |  Branch (827:25): [True: 6.94k, False: 0]
  ------------------
  828|  6.94k|        goto err;
  829|      0|    return msg;
  830|       |
  831|  6.94k| err:
  832|  6.94k|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_ERROR);
  ------------------
  |  |  401|  6.94k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.94k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.94k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  6.94k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  6.94k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.94k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.94k|     ERR_set_error)
  |  |  ------------------
  ------------------
  833|  6.94k|    OSSL_CMP_MSG_free(msg);
  834|  6.94k|    return NULL;
  835|  6.94k|}
ossl_cmp_pollReq_new:
  934|     70|{
  935|     70|    OSSL_CMP_MSG *msg = NULL;
  936|     70|    OSSL_CMP_POLLREQ *preq = NULL;
  937|       |
  938|     70|    if (!ossl_assert(ctx != NULL))
  ------------------
  |  |   52|     70|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     70|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (938:9): [True: 0, False: 70]
  ------------------
  939|      0|        return NULL;
  940|       |
  941|     70|    if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_POLLREQ)) == NULL)
  ------------------
  |  |  937|     70|# define OSSL_CMP_PKIBODY_POLLREQ  25
  ------------------
  |  Branch (941:9): [True: 0, False: 70]
  ------------------
  942|      0|        goto err;
  943|       |
  944|     70|    if ((preq = OSSL_CMP_POLLREQ_new()) == NULL
  ------------------
  |  Branch (944:9): [True: 0, False: 70]
  ------------------
  945|     70|            || !ASN1_INTEGER_set(preq->certReqId, crid)
  ------------------
  |  Branch (945:16): [True: 0, False: 70]
  ------------------
  946|     70|            || !sk_OSSL_CMP_POLLREQ_push(msg->body->value.pollReq, preq))
  ------------------
  |  Branch (946:16): [True: 0, False: 70]
  ------------------
  947|      0|        goto err;
  948|       |
  949|     70|    preq = NULL;
  950|     70|    if (!ossl_cmp_msg_protect(ctx, msg))
  ------------------
  |  Branch (950:9): [True: 70, False: 0]
  ------------------
  951|     70|        goto err;
  952|       |
  953|      0|    return msg;
  954|       |
  955|     70| err:
  956|     70|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREQ);
  ------------------
  |  |  401|     70|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     70|    (ERR_new(),                                                 \
  |  |  |  |  404|     70|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     70|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     70|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     70|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     70|     ERR_set_error)
  |  |  ------------------
  ------------------
  957|     70|    OSSL_CMP_POLLREQ_free(preq);
  958|     70|    OSSL_CMP_MSG_free(msg);
  959|     70|    return NULL;
  960|     70|}
i2d_OSSL_CMP_MSG:
 1263|  13.8k|{
 1264|  13.8k|    return ASN1_item_i2d((const ASN1_VALUE *)msg, out,
 1265|  13.8k|                         ASN1_ITEM_rptr(OSSL_CMP_MSG));
  ------------------
  |  |  427|  13.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
 1266|  13.8k|}
d2i_OSSL_CMP_MSG_bio:
 1269|  10.4k|{
 1270|  10.4k|    OSSL_LIB_CTX *libctx = NULL;
 1271|  10.4k|    const char *propq = NULL;
 1272|       |
 1273|  10.4k|    if (msg != NULL && *msg != NULL) {
  ------------------
  |  Branch (1273:9): [True: 0, False: 10.4k]
  |  Branch (1273:24): [True: 0, False: 0]
  ------------------
 1274|      0|        libctx  = (*msg)->libctx;
 1275|      0|        propq = (*msg)->propq;
 1276|      0|    }
 1277|       |
 1278|  10.4k|    return ASN1_item_d2i_bio_ex(ASN1_ITEM_rptr(OSSL_CMP_MSG), bio, msg, libctx,
  ------------------
  |  |  427|  10.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
 1279|  10.4k|                                propq);
 1280|  10.4k|}
i2d_OSSL_CMP_MSG_bio:
 1283|  6.94k|{
 1284|  6.94k|    return ASN1_i2d_bio_of(OSSL_CMP_MSG, i2d_OSSL_CMP_MSG, bio, msg);
  ------------------
  |  |  971|  6.94k|    (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
  |  |  ------------------
  |  |  |  |  360|  6.94k|    ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  972|  6.94k|                  out, \
  |  |  973|  6.94k|                  CHECKED_PTR_OF(const type, x)))
  |  |  ------------------
  |  |  |  |  364|  6.94k|    ((void*) (1 ? p : (type*)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:15): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1285|  6.94k|}
cmp_msg.c:determine_subj:
  260|    303|{
  261|    303|    if (ctx->subjectName != NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 303]
  ------------------
  262|      0|        return IS_NULL_DN(ctx->subjectName) ? NULL : ctx->subjectName;
  ------------------
  |  |   28|      0|# define IS_NULL_DN(name) (X509_NAME_get_entry(name, 0) == NULL)
  |  |  ------------------
  |  |  |  Branch (28:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  263|    303|    if (ctx->p10CSR != NULL) /* first default is from any given CSR */
  ------------------
  |  Branch (263:9): [True: 0, False: 303]
  ------------------
  264|      0|        return X509_REQ_get_subject_name(ctx->p10CSR);
  265|    303|    if (for_KUR || !HAS_SAN(ctx))
  ------------------
  |  |  255|    280|    (sk_GENERAL_NAME_num((ctx)->subjectAltNames) > 0 \
  |  |  ------------------
  |  |  |  |  238|    280|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  |  |  ------------------
  |  |  |  Branch (255:6): [True: 0, False: 280]
  |  |  ------------------
  |  |  256|    280|         || OSSL_CMP_CTX_reqExtensions_have_SAN(ctx) == 1)
  |  |  ------------------
  |  |  |  Branch (256:13): [True: 0, False: 280]
  |  |  ------------------
  ------------------
  |  Branch (265:9): [True: 23, False: 280]
  ------------------
  266|       |        /*
  267|       |         * For KUR, copy subject from any reference cert as fallback.
  268|       |         * For IR or CR, do the same only if there is no subjectAltName.
  269|       |         */
  270|    303|        return ref_subj;
  271|      0|    return NULL;
  272|    303|}
cmp_msg.c:gen_new:
  749|    226|{
  750|    226|    OSSL_CMP_MSG *msg = NULL;
  751|       |
  752|    226|    if (!ossl_assert(ctx != NULL))
  ------------------
  |  |   52|    226|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    226|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (752:9): [True: 0, False: 226]
  ------------------
  753|      0|        return NULL;
  754|       |
  755|    226|    if ((msg = ossl_cmp_msg_create(ctx, body_type)) == NULL)
  ------------------
  |  Branch (755:9): [True: 0, False: 226]
  ------------------
  756|      0|        return NULL;
  757|       |
  758|    226|    if (itavs != NULL && !ossl_cmp_msg_gen_push1_ITAVs(msg, itavs))
  ------------------
  |  Branch (758:9): [True: 0, False: 226]
  |  Branch (758:26): [True: 0, False: 0]
  ------------------
  759|      0|        goto err;
  760|       |
  761|    226|    if (!ossl_cmp_msg_protect(ctx, msg))
  ------------------
  |  Branch (761:9): [True: 226, False: 0]
  ------------------
  762|    226|        goto err;
  763|       |
  764|      0|    return msg;
  765|       |
  766|    226| err:
  767|    226|    ERR_raise(ERR_LIB_CMP, err_code);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    226|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    226|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    226|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    226|     ERR_set_error)
  |  |  ------------------
  ------------------
  768|    226|    OSSL_CMP_MSG_free(msg);
  769|    226|    return NULL;
  770|    226|}

ossl_cmp_calc_protection:
   35|    172|{
   36|    172|    ASN1_BIT_STRING *prot = NULL;
   37|    172|    OSSL_CMP_PROTECTEDPART prot_part;
   38|    172|    const ASN1_OBJECT *algorOID = NULL;
   39|    172|    const void *ppval = NULL;
   40|    172|    int pptype = 0;
   41|       |
   42|    172|    if (!ossl_assert(ctx != NULL && msg != NULL))
  ------------------
  |  |   52|    344|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 172, False: 0]
  |  |  |  Branch (52:43): [True: 172, False: 0]
  |  |  ------------------
  |  |   53|    172|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (42:9): [True: 0, False: 172]
  ------------------
   43|      0|        return NULL;
   44|       |
   45|       |    /* construct data to be signed */
   46|    172|    prot_part.header = msg->header;
   47|    172|    prot_part.body = msg->body;
   48|       |
   49|    172|    if (msg->header->protectionAlg == NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 172]
  ------------------
   50|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNKNOWN_ALGORITHM_ID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   51|      0|        return NULL;
   52|      0|    }
   53|    172|    X509_ALGOR_get0(&algorOID, &pptype, &ppval, msg->header->protectionAlg);
   54|       |
   55|    172|    if (OBJ_obj2nid(algorOID) == NID_id_PasswordBasedMAC) {
  ------------------
  |  |  520|    172|#define NID_id_PasswordBasedMAC         782
  ------------------
  |  Branch (55:9): [True: 172, False: 0]
  ------------------
   56|    172|        int len;
   57|    172|        size_t prot_part_der_len;
   58|    172|        unsigned char *prot_part_der = NULL;
   59|    172|        size_t sig_len;
   60|    172|        unsigned char *protection = NULL;
   61|    172|        OSSL_CRMF_PBMPARAMETER *pbm = NULL;
   62|    172|        ASN1_STRING *pbm_str = NULL;
   63|    172|        const unsigned char *pbm_str_uc = NULL;
   64|       |
   65|    172|        if (ctx->secretValue == NULL) {
  ------------------
  |  Branch (65:13): [True: 0, False: 172]
  ------------------
   66|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_PBM_SECRET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|            return NULL;
   68|      0|        }
   69|    172|        if (ppval == NULL) {
  ------------------
  |  Branch (69:13): [True: 1, False: 171]
  ------------------
   70|      1|            ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CALCULATING_PROTECTION);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
   71|      1|            return NULL;
   72|      1|        }
   73|       |
   74|    171|        len = i2d_OSSL_CMP_PROTECTEDPART(&prot_part, &prot_part_der);
   75|    171|        if (len < 0 || prot_part_der == NULL) {
  ------------------
  |  Branch (75:13): [True: 0, False: 171]
  |  Branch (75:24): [True: 0, False: 171]
  ------------------
   76|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CALCULATING_PROTECTION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   77|      0|            goto end;
   78|      0|        }
   79|    171|        prot_part_der_len = (size_t)len;
   80|       |
   81|    171|        pbm_str = (ASN1_STRING *)ppval;
   82|    171|        pbm_str_uc = pbm_str->data;
   83|    171|        pbm = d2i_OSSL_CRMF_PBMPARAMETER(NULL, &pbm_str_uc, pbm_str->length);
   84|    171|        if (pbm == NULL) {
  ------------------
  |  Branch (84:13): [True: 4, False: 167]
  ------------------
   85|      4|            ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_ALGORITHM_OID);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|      4|            goto end;
   87|      4|        }
   88|       |
   89|    167|        if (!OSSL_CRMF_pbm_new(ctx->libctx, ctx->propq,
  ------------------
  |  Branch (89:13): [True: 107, False: 60]
  ------------------
   90|    167|                               pbm, prot_part_der, prot_part_der_len,
   91|    167|                               ctx->secretValue->data, ctx->secretValue->length,
   92|    167|                               &protection, &sig_len))
   93|    107|            goto end;
   94|       |
   95|     60|        if ((prot = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (95:13): [True: 0, False: 60]
  ------------------
   96|      0|            goto end;
   97|       |        /* OpenSSL by default encodes all bit strings as ASN.1 NamedBitList */
   98|     60|        ossl_asn1_string_set_bits_left(prot, 0);
   99|     60|        if (!ASN1_BIT_STRING_set(prot, protection, sig_len)) {
  ------------------
  |  Branch (99:13): [True: 0, False: 60]
  ------------------
  100|      0|            ASN1_BIT_STRING_free(prot);
  101|      0|            prot = NULL;
  102|      0|        }
  103|    171|    end:
  104|    171|        OSSL_CRMF_PBMPARAMETER_free(pbm);
  105|    171|        OPENSSL_free(protection);
  ------------------
  |  |  115|    171|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    171|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    171|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|    171|        OPENSSL_free(prot_part_der);
  ------------------
  |  |  115|    171|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    171|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    171|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  107|    171|        return prot;
  108|     60|    } else {
  109|      0|        const EVP_MD *md = ctx->digest;
  110|      0|        char name[80] = "";
  111|       |
  112|      0|        if (ctx->pkey == NULL) {
  ------------------
  |  Branch (112:13): [True: 0, False: 0]
  ------------------
  113|      0|            ERR_raise(ERR_LIB_CMP,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  114|      0|                      CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION);
  115|      0|            return NULL;
  116|      0|        }
  117|      0|        if (EVP_PKEY_get_default_digest_name(ctx->pkey, name, sizeof(name)) > 0
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  118|      0|            && strcmp(name, "UNDEF") == 0) /* at least for Ed25519, Ed448 */
  ------------------
  |  Branch (118:16): [True: 0, False: 0]
  ------------------
  119|      0|            md = NULL;
  120|       |
  121|      0|        if ((prot = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|            return NULL;
  123|      0|        if (ASN1_item_sign_ex(ASN1_ITEM_rptr(OSSL_CMP_PROTECTEDPART),
  ------------------
  |  |  427|      0|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  ------------------
  124|      0|                              msg->header->protectionAlg, /* sets X509_ALGOR */
  125|      0|                              NULL, prot, &prot_part, NULL, ctx->pkey, md,
  126|      0|                              ctx->libctx, ctx->propq))
  127|      0|            return prot;
  128|      0|        ASN1_BIT_STRING_free(prot);
  129|      0|        return NULL;
  130|      0|    }
  131|    172|}
ossl_cmp_msg_add_extraCerts:
  154|    708|{
  155|    708|    if (!ossl_assert(ctx != NULL && msg != NULL))
  ------------------
  |  |   52|  1.41k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 708, False: 0]
  |  |  |  Branch (52:43): [True: 708, False: 0]
  |  |  ------------------
  |  |   53|    708|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (155:9): [True: 0, False: 708]
  ------------------
  156|      0|        return 0;
  157|       |
  158|       |    /* Add first ctx->cert and its chain if using signature-based protection */
  159|    708|    if (!ctx->unprotectedSend && ctx->secretValue == NULL
  ------------------
  |  Branch (159:9): [True: 0, False: 708]
  |  Branch (159:34): [True: 0, False: 0]
  ------------------
  160|    708|            && ctx->cert != NULL && ctx->pkey != NULL) {
  ------------------
  |  Branch (160:16): [True: 0, False: 0]
  |  Branch (160:37): [True: 0, False: 0]
  ------------------
  161|      0|        int prepend = X509_ADD_FLAG_UP_REF | X509_ADD_FLAG_NO_DUP
  ------------------
  |  |  998|      0|# define X509_ADD_FLAG_UP_REF   0x1
  ------------------
                      int prepend = X509_ADD_FLAG_UP_REF | X509_ADD_FLAG_NO_DUP
  ------------------
  |  | 1000|      0|# define X509_ADD_FLAG_NO_DUP   0x4
  ------------------
  162|      0|            | X509_ADD_FLAG_PREPEND | X509_ADD_FLAG_NO_SS;
  ------------------
  |  |  999|      0|# define X509_ADD_FLAG_PREPEND  0x2
  ------------------
                          | X509_ADD_FLAG_PREPEND | X509_ADD_FLAG_NO_SS;
  ------------------
  |  | 1001|      0|# define X509_ADD_FLAG_NO_SS    0x8
  ------------------
  163|       |
  164|      0|        ossl_cmp_set_own_chain(ctx);
  165|      0|        if (ctx->chain != NULL) {
  ------------------
  |  Branch (165:13): [True: 0, False: 0]
  ------------------
  166|      0|            if (!ossl_x509_add_certs_new(&msg->extraCerts, ctx->chain, prepend))
  ------------------
  |  Branch (166:17): [True: 0, False: 0]
  ------------------
  167|      0|                return 0;
  168|      0|        } else {
  169|       |            /* make sure that at least our own signer cert is included first */
  170|      0|            if (!ossl_x509_add_cert_new(&msg->extraCerts, ctx->cert, prepend))
  ------------------
  |  Branch (170:17): [True: 0, False: 0]
  ------------------
  171|      0|                return 0;
  172|      0|            ossl_cmp_debug(ctx, "fallback: adding just own CMP signer cert");
  ------------------
  |  |  861|      0|# define ossl_cmp_debug(ctx, msg) ossl_cmp_log(DEBUG, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|      0|        }
  174|      0|    }
  175|       |
  176|       |    /* add any additional certificates from ctx->extraCertsOut */
  177|    708|    if (!ossl_x509_add_certs_new(&msg->extraCerts, ctx->extraCertsOut,
  ------------------
  |  Branch (177:9): [True: 0, False: 708]
  ------------------
  178|    708|                                 X509_ADD_FLAG_UP_REF | X509_ADD_FLAG_NO_DUP))
  ------------------
  |  |  998|    708|# define X509_ADD_FLAG_UP_REF   0x1
  ------------------
                                               X509_ADD_FLAG_UP_REF | X509_ADD_FLAG_NO_DUP))
  ------------------
  |  | 1000|    708|# define X509_ADD_FLAG_NO_DUP   0x4
  ------------------
  179|      0|        return 0;
  180|       |
  181|       |    /* in case extraCerts are empty list avoid empty ASN.1 sequence */
  182|    708|    if (sk_X509_num(msg->extraCerts) == 0) {
  ------------------
  |  |   79|    708|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (182:9): [True: 0, False: 708]
  ------------------
  183|      0|        sk_X509_free(msg->extraCerts);
  ------------------
  |  |   85|      0|#define sk_X509_free(sk) OPENSSL_sk_free(ossl_check_X509_sk_type(sk))
  ------------------
  184|      0|        msg->extraCerts = NULL;
  185|      0|    }
  186|    708|    return 1;
  187|    708|}
ossl_cmp_msg_protect:
  234|  7.74k|{
  235|  7.74k|    if (!ossl_assert(ctx != NULL && msg != NULL))
  ------------------
  |  |   52|  15.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 7.74k, False: 0]
  |  |  |  Branch (52:43): [True: 7.74k, False: 0]
  |  |  ------------------
  |  |   53|  7.74k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (235:9): [True: 0, False: 7.74k]
  ------------------
  236|      0|        return 0;
  237|       |
  238|       |    /*
  239|       |     * For the case of re-protection remove pre-existing protection.
  240|       |     * Does not remove any pre-existing extraCerts.
  241|       |     */
  242|  7.74k|    X509_ALGOR_free(msg->header->protectionAlg);
  243|  7.74k|    msg->header->protectionAlg = NULL;
  244|  7.74k|    ASN1_BIT_STRING_free(msg->protection);
  245|  7.74k|    msg->protection = NULL;
  246|       |
  247|  7.74k|    if (ctx->unprotectedSend) {
  ------------------
  |  Branch (247:9): [True: 708, False: 7.03k]
  ------------------
  248|    708|        if (!set_senderKID(ctx, msg, NULL))
  ------------------
  |  Branch (248:13): [True: 0, False: 708]
  ------------------
  249|      0|            goto err;
  250|  7.03k|    } else if (ctx->secretValue != NULL) {
  ------------------
  |  Branch (250:16): [True: 0, False: 7.03k]
  ------------------
  251|       |        /* use PasswordBasedMac according to 5.1.3.1 if secretValue is given */
  252|      0|        if ((msg->header->protectionAlg = pbmac_algor(ctx)) == NULL)
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|            goto err;
  254|      0|        if (!set_senderKID(ctx, msg, NULL))
  ------------------
  |  Branch (254:13): [True: 0, False: 0]
  ------------------
  255|      0|            goto err;
  256|       |
  257|       |        /*
  258|       |         * will add any additional certificates from ctx->extraCertsOut
  259|       |         * while not needed to validate the protection certificate,
  260|       |         * the option to do this might be handy for certain use cases
  261|       |         */
  262|  7.03k|    } else if (ctx->cert != NULL && ctx->pkey != NULL) {
  ------------------
  |  Branch (262:16): [True: 0, False: 7.03k]
  |  Branch (262:37): [True: 0, False: 0]
  ------------------
  263|       |        /* use MSG_SIG_ALG according to 5.1.3.3 if client cert and key given */
  264|       |
  265|       |        /* make sure that key and certificate match */
  266|      0|        if (!X509_check_private_key(ctx->cert, ctx->pkey)) {
  ------------------
  |  Branch (266:13): [True: 0, False: 0]
  ------------------
  267|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_CERT_AND_KEY_DO_NOT_MATCH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|            goto err;
  269|      0|        }
  270|       |
  271|      0|        if ((msg->header->protectionAlg = X509_ALGOR_new()) == NULL)
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      0|            goto err;
  273|       |        /* set senderKID to keyIdentifier of the cert according to 5.1.1 */
  274|      0|        if (!set_senderKID(ctx, msg, X509_get0_subject_key_id(ctx->cert)))
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|            goto err;
  276|       |
  277|       |        /*
  278|       |         * will add ctx->cert followed, if possible, by its chain built
  279|       |         * from ctx->untrusted, and then ctx->extraCertsOut
  280|       |         */
  281|  7.03k|    } else {
  282|  7.03k|        ERR_raise(ERR_LIB_CMP,
  ------------------
  |  |  401|  7.03k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  7.03k|    (ERR_new(),                                                 \
  |  |  |  |  404|  7.03k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  7.03k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  7.03k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  7.03k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  7.03k|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|  7.03k|                  CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION);
  284|  7.03k|        goto err;
  285|  7.03k|    }
  286|    708|    if (!ctx->unprotectedSend
  ------------------
  |  Branch (286:9): [True: 0, False: 708]
  ------------------
  287|       |        /* protect according to msg->header->protectionAlg partly set above */
  288|    708|            && ((msg->protection = ossl_cmp_calc_protection(ctx, msg)) == NULL))
  ------------------
  |  Branch (288:16): [True: 0, False: 0]
  ------------------
  289|      0|        goto err;
  290|       |
  291|       |    /*
  292|       |     * For signature-based protection add ctx->cert followed by its chain.
  293|       |     * Finally add any additional certificates from ctx->extraCertsOut;
  294|       |     * even if not needed to validate the protection
  295|       |     * the option to do this might be handy for certain use cases.
  296|       |     */
  297|    708|    if (!ossl_cmp_msg_add_extraCerts(ctx, msg))
  ------------------
  |  Branch (297:9): [True: 0, False: 708]
  ------------------
  298|      0|        goto err;
  299|       |
  300|       |    /*
  301|       |     * As required by RFC 4210 section 5.1.1., if the sender name is not known
  302|       |     * to the client it set to NULL-DN. In this case for identification at least
  303|       |     * the senderKID must be set, where we took the referenceValue as fallback.
  304|       |     */
  305|    708|    if (!(ossl_cmp_general_name_is_NULL_DN(msg->header->sender)
  ------------------
  |  Branch (305:11): [True: 708, False: 0]
  ------------------
  306|    708|          && msg->header->senderKID == NULL))
  ------------------
  |  Branch (306:14): [True: 708, False: 0]
  ------------------
  307|      0|        return 1;
  308|    708|    ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_SENDER_IDENTIFICATION);
  ------------------
  |  |  401|    708|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    708|    (ERR_new(),                                                 \
  |  |  |  |  404|    708|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    708|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    708|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    708|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    708|     ERR_set_error)
  |  |  ------------------
  ------------------
  309|       |
  310|  7.74k| err:
  311|  7.74k|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROTECTING_MESSAGE);
  ------------------
  |  |  401|  7.74k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  7.74k|    (ERR_new(),                                                 \
  |  |  |  |  404|  7.74k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  7.74k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  7.74k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  7.74k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  7.74k|     ERR_set_error)
  |  |  ------------------
  ------------------
  312|  7.74k|    return 0;
  313|    708|}
cmp_protect.c:set_senderKID:
  226|    708|{
  227|    708|    if (id == NULL)
  ------------------
  |  Branch (227:9): [True: 708, False: 0]
  ------------------
  228|    708|        id = ctx->referenceValue; /* standard for PBM, fallback for sig-based */
  229|    708|    return id == NULL || ossl_cmp_hdr_set1_senderKID(msg->header, id);
  ------------------
  |  Branch (229:12): [True: 708, False: 0]
  |  Branch (229:26): [True: 0, False: 0]
  ------------------
  230|    708|}

OSSL_CMP_SRV_CTX_free:
   46|  6.94k|{
   47|  6.94k|    if (srv_ctx == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 6.94k]
  ------------------
   48|      0|        return;
   49|       |
   50|  6.94k|    OSSL_CMP_CTX_free(srv_ctx->ctx);
   51|  6.94k|    OPENSSL_free(srv_ctx);
  ------------------
  |  |  115|  6.94k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.94k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.94k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  6.94k|}
OSSL_CMP_SRV_CTX_new:
   55|  6.94k|{
   56|  6.94k|    OSSL_CMP_SRV_CTX *ctx = OPENSSL_zalloc(sizeof(OSSL_CMP_SRV_CTX));
  ------------------
  |  |  104|  6.94k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  6.94k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  6.94k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   57|       |
   58|  6.94k|    if (ctx == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 6.94k]
  ------------------
   59|      0|        goto err;
   60|       |
   61|  6.94k|    if ((ctx->ctx = OSSL_CMP_CTX_new(libctx, propq)) == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 6.94k]
  ------------------
   62|      0|        goto err;
   63|  6.94k|    ctx->certReqId = OSSL_CMP_CERTREQID_INVALID;
  ------------------
  |  |  943|  6.94k|# define OSSL_CMP_CERTREQID_INVALID -2
  ------------------
   64|  6.94k|    ctx->polling = 0;
   65|       |
   66|       |    /* all other elements are initialized to 0 or NULL, respectively */
   67|  6.94k|    return ctx;
   68|      0| err:
   69|      0|    OSSL_CMP_SRV_CTX_free(ctx);
   70|      0|    return NULL;
   71|  6.94k|}
OSSL_CMP_SRV_CTX_init:
   80|  6.94k|{
   81|  6.94k|    if (srv_ctx == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 6.94k]
  ------------------
   82|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   83|      0|        return 0;
   84|      0|    }
   85|  6.94k|    srv_ctx->custom_ctx = custom_ctx;
   86|  6.94k|    srv_ctx->process_cert_request = process_cert_request;
   87|  6.94k|    srv_ctx->process_rr = process_rr;
   88|  6.94k|    srv_ctx->process_genm = process_genm;
   89|  6.94k|    srv_ctx->process_error = process_error;
   90|  6.94k|    srv_ctx->process_certConf = process_certConf;
   91|  6.94k|    srv_ctx->process_pollReq = process_pollReq;
   92|  6.94k|    return 1;
   93|  6.94k|}
OSSL_CMP_SRV_CTX_init_trans:
   98|  6.94k|{
   99|  6.94k|    if (srv_ctx == NULL) {
  ------------------
  |  Branch (99:9): [True: 0, False: 6.94k]
  ------------------
  100|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  101|      0|        return 0;
  102|      0|    }
  103|  6.94k|    srv_ctx->delayed_delivery = delay;
  104|  6.94k|    srv_ctx->clean_transaction = clean;
  105|  6.94k|    return 1;
  106|  6.94k|}
OSSL_CMP_SRV_CTX_get0_cmp_ctx:
  109|  6.94k|{
  110|  6.94k|    if (srv_ctx == NULL) {
  ------------------
  |  Branch (110:9): [True: 0, False: 6.94k]
  ------------------
  111|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|      0|        return NULL;
  113|      0|    }
  114|  6.94k|    return srv_ctx->ctx;
  115|  6.94k|}
OSSL_CMP_SRV_process_request:
  583|  6.94k|{
  584|  6.94k|    OSSL_CMP_CTX *ctx;
  585|  6.94k|    ASN1_OCTET_STRING *backup_secret;
  586|  6.94k|    OSSL_CMP_PKIHEADER *hdr;
  587|  6.94k|    int req_type, rsp_type;
  588|  6.94k|    int req_verified = 0;
  589|  6.94k|    OSSL_CMP_MSG *rsp = NULL;
  590|       |
  591|  6.94k|    if (srv_ctx == NULL || srv_ctx->ctx == NULL
  ------------------
  |  Branch (591:9): [True: 0, False: 6.94k]
  |  Branch (591:28): [True: 0, False: 6.94k]
  ------------------
  592|  6.94k|            || req == NULL || req->body == NULL
  ------------------
  |  Branch (592:16): [True: 0, False: 6.94k]
  |  Branch (592:31): [True: 0, False: 6.94k]
  ------------------
  593|  6.94k|            || (hdr = OSSL_CMP_MSG_get0_header(req)) == NULL) {
  ------------------
  |  Branch (593:16): [True: 0, False: 6.94k]
  ------------------
  594|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  595|      0|        return 0;
  596|      0|    }
  597|  6.94k|    ctx = srv_ctx->ctx;
  598|  6.94k|    backup_secret = ctx->secretValue;
  599|  6.94k|    req_type = OSSL_CMP_MSG_get_bodytype(req);
  600|  6.94k|    ossl_cmp_log1(DEBUG, ctx,
  ------------------
  |  |  844|  6.94k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  6.94k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  6.94k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|  6.94k|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|  6.94k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|  6.94k|                  "received %s", ossl_cmp_bodytype_to_string(req_type));
  602|       |
  603|       |    /*
  604|       |     * Some things need to be done already before validating the message in
  605|       |     * order to be able to send an error message as far as needed and possible.
  606|       |     */
  607|  6.94k|    if (hdr->sender->type != GEN_DIRNAME) {
  ------------------
  |  |  177|  6.94k|# define GEN_DIRNAME     4
  ------------------
  |  Branch (607:9): [True: 4.58k, False: 2.36k]
  ------------------
  608|  4.58k|        ERR_raise(ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED);
  ------------------
  |  |  401|  4.58k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.58k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.58k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  4.58k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  4.58k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.58k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.58k|     ERR_set_error)
  |  |  ------------------
  ------------------
  609|  4.58k|        goto err;
  610|  4.58k|    }
  611|  2.36k|    if (!OSSL_CMP_CTX_set1_recipient(ctx, hdr->sender->d.directoryName))
  ------------------
  |  Branch (611:9): [True: 1, False: 2.35k]
  ------------------
  612|      1|        goto err;
  613|       |
  614|  2.35k|    if (srv_ctx->polling && req_type != OSSL_CMP_PKIBODY_POLLREQ
  ------------------
  |  |  937|  2.35k|# define OSSL_CMP_PKIBODY_POLLREQ  25
  ------------------
  |  Branch (614:9): [True: 0, False: 2.35k]
  |  Branch (614:29): [True: 0, False: 0]
  ------------------
  615|  2.35k|            && req_type != OSSL_CMP_PKIBODY_ERROR) {
  ------------------
  |  |  935|      0|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (615:16): [True: 0, False: 0]
  ------------------
  616|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_EXPECTED_POLLREQ);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  617|      0|        goto err;
  618|      0|    }
  619|       |
  620|  2.35k|    switch (req_type) {
  621|    166|    case OSSL_CMP_PKIBODY_IR:
  ------------------
  |  |  912|    166|# define OSSL_CMP_PKIBODY_IR        0
  ------------------
  |  Branch (621:5): [True: 166, False: 2.19k]
  ------------------
  622|    253|    case OSSL_CMP_PKIBODY_CR:
  ------------------
  |  |  914|    253|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
  |  Branch (622:5): [True: 87, False: 2.27k]
  ------------------
  623|    857|    case OSSL_CMP_PKIBODY_P10CR:
  ------------------
  |  |  916|    857|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (623:5): [True: 604, False: 1.75k]
  ------------------
  624|  1.08k|    case OSSL_CMP_PKIBODY_KUR:
  ------------------
  |  |  919|  1.08k|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
  |  Branch (624:5): [True: 229, False: 2.13k]
  ------------------
  625|  1.10k|    case OSSL_CMP_PKIBODY_RR:
  ------------------
  |  |  923|  1.10k|# define OSSL_CMP_PKIBODY_RR       11
  ------------------
  |  Branch (625:5): [True: 22, False: 2.33k]
  ------------------
  626|  1.26k|    case OSSL_CMP_PKIBODY_GENM:
  ------------------
  |  |  933|  1.26k|# define OSSL_CMP_PKIBODY_GENM     21
  ------------------
  |  Branch (626:5): [True: 161, False: 2.19k]
  ------------------
  627|  1.35k|    case OSSL_CMP_PKIBODY_ERROR:
  ------------------
  |  |  935|  1.35k|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (627:5): [True: 90, False: 2.26k]
  ------------------
  628|  1.35k|        if (ctx->transactionID != NULL) {
  ------------------
  |  Branch (628:13): [True: 0, False: 1.35k]
  ------------------
  629|      0|            char *tid = i2s_ASN1_OCTET_STRING(NULL, ctx->transactionID);
  630|       |
  631|      0|            if (tid != NULL)
  ------------------
  |  Branch (631:17): [True: 0, False: 0]
  ------------------
  632|      0|                ossl_cmp_log1(WARN, ctx,
  ------------------
  |  |  844|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|      0|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  633|      0|                              "Assuming that last transaction with ID=%s got aborted",
  634|      0|                              tid);
  635|      0|            OPENSSL_free(tid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  636|      0|        }
  637|       |        /* start of a new transaction, reset transactionID and senderNonce */
  638|  1.35k|        if (!OSSL_CMP_CTX_set1_transactionID(ctx, NULL)
  ------------------
  |  Branch (638:13): [True: 0, False: 1.35k]
  ------------------
  639|  1.35k|                || !OSSL_CMP_CTX_set1_senderNonce(ctx, NULL))
  ------------------
  |  Branch (639:20): [True: 0, False: 1.35k]
  ------------------
  640|      0|            goto err;
  641|       |
  642|  1.35k|        if (srv_ctx->clean_transaction != NULL
  ------------------
  |  Branch (642:13): [True: 1.35k, False: 0]
  ------------------
  643|  1.35k|                && !srv_ctx->clean_transaction(srv_ctx, NULL)) {
  ------------------
  |  Branch (643:20): [True: 0, False: 1.35k]
  ------------------
  644|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  645|      0|            goto err;
  646|      0|        }
  647|       |
  648|  1.35k|        break;
  649|  1.35k|    default:
  ------------------
  |  Branch (649:5): [True: 1.00k, False: 1.35k]
  ------------------
  650|       |        /* transactionID should be already initialized */
  651|  1.00k|        if (ctx->transactionID == NULL) {
  ------------------
  |  Branch (651:13): [True: 1.00k, False: 0]
  ------------------
  652|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  653|       |            ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY);
  654|       |            goto err;
  655|       |#endif
  656|  1.00k|        }
  657|  2.35k|    }
  658|       |
  659|  2.35k|    req_verified = ossl_cmp_msg_check_update(ctx, req, unprotected_exception,
  660|  2.35k|                                             srv_ctx->acceptUnprotected);
  661|  2.35k|    if (ctx->secretValue != NULL && ctx->pkey != NULL
  ------------------
  |  Branch (661:9): [True: 0, False: 2.35k]
  |  Branch (661:37): [True: 0, False: 0]
  ------------------
  662|  2.35k|            && ossl_cmp_hdr_get_protection_nid(hdr) != NID_id_PasswordBasedMAC)
  ------------------
  |  |  520|      0|#define NID_id_PasswordBasedMAC         782
  ------------------
  |  Branch (662:16): [True: 0, False: 0]
  ------------------
  663|      0|        ctx->secretValue = NULL; /* use MSG_SIG_ALG when protecting rsp */
  664|  2.35k|    if (!req_verified)
  ------------------
  |  Branch (664:9): [True: 0, False: 2.35k]
  ------------------
  665|      0|        goto err;
  666|       |
  667|  2.35k|    if (req_type == OSSL_CMP_PKIBODY_POLLREQ) {
  ------------------
  |  |  937|  2.35k|# define OSSL_CMP_PKIBODY_POLLREQ  25
  ------------------
  |  Branch (667:9): [True: 66, False: 2.29k]
  ------------------
  668|     66|        if (srv_ctx->process_pollReq == NULL)
  ------------------
  |  Branch (668:13): [True: 0, False: 66]
  ------------------
  669|     66|            ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  670|     66|        else
  671|     66|            rsp = process_pollReq(srv_ctx, req);
  672|  2.29k|    } else {
  673|  2.29k|        if (srv_ctx->delayed_delivery != NULL
  ------------------
  |  Branch (673:13): [True: 2.29k, False: 0]
  ------------------
  674|  2.29k|            && (rsp = delayed_delivery(srv_ctx, req)) != NULL) {
  ------------------
  |  Branch (674:16): [True: 0, False: 2.29k]
  ------------------
  675|      0|            goto err;
  676|      0|        }
  677|  2.29k|        rsp = process_non_polling_request(srv_ctx, req);
  678|  2.29k|    }
  679|       |
  680|  6.94k| err:
  681|  6.94k|    if (rsp == NULL) {
  ------------------
  |  Branch (681:9): [True: 6.94k, False: 0]
  ------------------
  682|       |        /* on error, try to respond with CMP error message to client */
  683|  6.94k|        const char *data = NULL, *reason = NULL;
  684|  6.94k|        int flags = 0;
  685|  6.94k|        unsigned long err = ERR_peek_error_data(&data, &flags);
  686|  6.94k|        int fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_badRequest;
  ------------------
  |  |  111|  6.94k|#  define OSSL_CMP_PKIFAILUREINFO_badRequest 2
  ------------------
  687|       |        /* fail_info is not very specific */
  688|  6.94k|        OSSL_CMP_PKISI *si = NULL;
  689|       |
  690|  6.94k|        if (!req_verified) {
  ------------------
  |  Branch (690:13): [True: 4.58k, False: 2.35k]
  ------------------
  691|       |            /*
  692|       |             * Above ossl_cmp_msg_check_update() was not successfully executed,
  693|       |             * which normally would set ctx->transactionID and ctx->recipNonce.
  694|       |             * So anyway try to provide the right transactionID and recipNonce,
  695|       |             * while ignoring any (extra) error in next two function calls.
  696|       |             */
  697|  4.58k|            if (ctx->transactionID == NULL)
  ------------------
  |  Branch (697:17): [True: 4.58k, False: 0]
  ------------------
  698|  4.58k|                (void)OSSL_CMP_CTX_set1_transactionID(ctx, hdr->transactionID);
  699|  4.58k|            (void)ossl_cmp_ctx_set1_recipNonce(ctx, hdr->senderNonce);
  700|  4.58k|        }
  701|       |
  702|  6.94k|        if ((flags & ERR_TXT_STRING) == 0 || *data == '\0')
  ------------------
  |  |   49|  6.94k|# define ERR_TXT_STRING          0x02
  ------------------
  |  Branch (702:13): [True: 6.55k, False: 392]
  |  Branch (702:46): [True: 0, False: 392]
  ------------------
  703|  6.55k|            data = NULL;
  704|  6.94k|        reason = ERR_reason_error_string(err);
  705|  6.94k|        if ((si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection,
  ------------------
  |  |  202|  6.94k|#  define OSSL_CMP_PKISTATUS_rejection              2
  ------------------
  |  Branch (705:13): [True: 6.94k, False: 0]
  ------------------
  706|  6.94k|                                          fail_info, reason)) != NULL) {
  707|  6.94k|            rsp = ossl_cmp_error_new(srv_ctx->ctx, si, err,
  708|  6.94k|                                     data, srv_ctx->sendUnprotectedErrors);
  709|  6.94k|            OSSL_CMP_PKISI_free(si);
  710|  6.94k|        }
  711|  6.94k|    }
  712|  6.94k|    OSSL_CMP_CTX_print_errors(ctx);
  713|  6.94k|    ctx->secretValue = backup_secret;
  714|       |
  715|  6.94k|    rsp_type =
  716|  6.94k|        rsp != NULL ? OSSL_CMP_MSG_get_bodytype(rsp) : OSSL_CMP_PKIBODY_ERROR;
  ------------------
  |  |  935|  13.8k|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (716:9): [True: 0, False: 6.94k]
  ------------------
  717|  6.94k|    if (rsp != NULL)
  ------------------
  |  Branch (717:9): [True: 0, False: 6.94k]
  ------------------
  718|      0|        ossl_cmp_log1(DEBUG, ctx,
  ------------------
  |  |  844|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|      0|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  719|  6.94k|                      "sending %s", ossl_cmp_bodytype_to_string(rsp_type));
  720|  6.94k|    else
  721|  6.94k|        ossl_cmp_log(ERR, ctx, "cannot send proper CMP response");
  ------------------
  |  |  841|  6.94k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  6.94k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  6.94k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  842|  6.94k|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  ------------------
  |  |  |  |  303|  6.94k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  722|       |
  723|       |    /* determine whether to keep the transaction open or not */
  724|  6.94k|    ctx->status = OSSL_CMP_PKISTATUS_trans;
  ------------------
  |  |  198|  6.94k|#  define OSSL_CMP_PKISTATUS_trans                  -2
  ------------------
  725|  6.94k|    switch (rsp_type) {
  726|      0|    case OSSL_CMP_PKIBODY_IP:
  ------------------
  |  |  913|      0|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  |  Branch (726:5): [True: 0, False: 6.94k]
  ------------------
  727|      0|    case OSSL_CMP_PKIBODY_CP:
  ------------------
  |  |  915|      0|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (727:5): [True: 0, False: 6.94k]
  ------------------
  728|      0|    case OSSL_CMP_PKIBODY_KUP:
  ------------------
  |  |  920|      0|# define OSSL_CMP_PKIBODY_KUP       8
  ------------------
  |  Branch (728:5): [True: 0, False: 6.94k]
  ------------------
  729|      0|        if (OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_IMPLICIT_CONFIRM) == 0)
  ------------------
  |  |  494|      0|#  define OSSL_CMP_OPT_IMPLICIT_CONFIRM 25
  ------------------
  |  Branch (729:13): [True: 0, False: 0]
  ------------------
  730|      0|            break;
  731|       |        /* fall through */
  732|       |
  733|  6.94k|    case OSSL_CMP_PKIBODY_ERROR:
  ------------------
  |  |  935|  6.94k|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (733:5): [True: 6.94k, False: 0]
  ------------------
  734|  6.94k|        if (rsp != NULL && ossl_cmp_is_error_with_waiting(rsp))
  ------------------
  |  Branch (734:13): [True: 0, False: 6.94k]
  |  Branch (734:28): [True: 0, False: 0]
  ------------------
  735|      0|            break;
  736|       |        /* fall through */
  737|       |
  738|  6.94k|    case OSSL_CMP_PKIBODY_RP:
  ------------------
  |  |  924|  6.94k|# define OSSL_CMP_PKIBODY_RP       12
  ------------------
  |  Branch (738:5): [True: 0, False: 6.94k]
  ------------------
  739|  6.94k|    case OSSL_CMP_PKIBODY_PKICONF:
  ------------------
  |  |  931|  6.94k|# define OSSL_CMP_PKIBODY_PKICONF  19
  ------------------
  |  Branch (739:5): [True: 0, False: 6.94k]
  ------------------
  740|  6.94k|    case OSSL_CMP_PKIBODY_GENP:
  ------------------
  |  |  934|  6.94k|# define OSSL_CMP_PKIBODY_GENP     22
  ------------------
  |  Branch (740:5): [True: 0, False: 6.94k]
  ------------------
  741|       |        /* Other terminating response message types are not supported */
  742|  6.94k|        srv_ctx->certReqId = OSSL_CMP_CERTREQID_INVALID;
  ------------------
  |  |  943|  6.94k|# define OSSL_CMP_CERTREQID_INVALID -2
  ------------------
  743|       |        /* Prepare for next transaction, ignoring any errors here: */
  744|  6.94k|        if (srv_ctx->clean_transaction != NULL)
  ------------------
  |  Branch (744:13): [True: 6.94k, False: 0]
  ------------------
  745|  6.94k|            (void)srv_ctx->clean_transaction(srv_ctx, ctx->transactionID);
  746|  6.94k|        (void)OSSL_CMP_CTX_set1_transactionID(ctx, NULL);
  747|  6.94k|        (void)OSSL_CMP_CTX_set1_senderNonce(ctx, NULL);
  748|  6.94k|        ctx->status = OSSL_CMP_PKISTATUS_unspecified; /* transaction closed */
  ------------------
  |  |  199|  6.94k|#  define OSSL_CMP_PKISTATUS_unspecified            -1
  ------------------
  749|       |
  750|  6.94k|    default: /* not closing transaction in other cases */
  ------------------
  |  Branch (750:5): [True: 0, False: 6.94k]
  ------------------
  751|  6.94k|        break;
  752|  6.94k|    }
  753|  6.94k|    return rsp;
  754|  6.94k|}
cmp_server.c:unprotected_exception:
  561|  2.35k|{
  562|  2.35k|    if (!ossl_assert(ctx != NULL && req != NULL))
  ------------------
  |  |   52|  4.71k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.35k, False: 0]
  |  |  |  Branch (52:43): [True: 2.35k, False: 0]
  |  |  ------------------
  |  |   53|  2.35k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (562:9): [True: 0, False: 2.35k]
  ------------------
  563|      0|        return -1;
  564|       |
  565|  2.35k|    if (accept_unprotected_requests) {
  ------------------
  |  Branch (565:9): [True: 0, False: 2.35k]
  ------------------
  566|      0|        ossl_cmp_log1(WARN, ctx, "ignoring %s protection of request message",
  ------------------
  |  |  844|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|      0|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (845:51): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  567|      0|                      invalid_protection ? "invalid" : "missing");
  568|      0|        return 1;
  569|      0|    }
  570|  2.35k|    if (OSSL_CMP_MSG_get_bodytype(req) == OSSL_CMP_PKIBODY_ERROR
  ------------------
  |  |  935|  4.71k|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (570:9): [True: 90, False: 2.26k]
  ------------------
  571|  2.35k|        && OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_UNPROTECTED_ERRORS) == 1) {
  ------------------
  |  |  499|     90|#  define OSSL_CMP_OPT_UNPROTECTED_ERRORS 31
  ------------------
  |  Branch (571:12): [True: 0, False: 90]
  ------------------
  572|      0|        ossl_cmp_warn(ctx, "ignoring missing protection of error message");
  ------------------
  |  |  859|      0|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  573|      0|        return 1;
  574|      0|    }
  575|  2.35k|    return 0;
  576|  2.35k|}
cmp_server.c:process_pollReq:
  513|     66|{
  514|     66|    OSSL_CMP_POLLREQCONTENT *prc;
  515|     66|    OSSL_CMP_POLLREQ *pr;
  516|     66|    int certReqId;
  517|     66|    OSSL_CMP_MSG *orig_req;
  518|     66|    int64_t check_after = 0;
  519|     66|    OSSL_CMP_MSG *msg = NULL;
  520|       |
  521|     66|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL))
  ------------------
  |  |   52|    264|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 66, False: 0]
  |  |  |  Branch (52:43): [True: 66, False: 0]
  |  |  |  Branch (52:43): [True: 66, False: 0]
  |  |  ------------------
  |  |   53|     66|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (521:9): [True: 0, False: 66]
  ------------------
  522|      0|        return NULL;
  523|       |
  524|     66|    if (!srv_ctx->polling) {
  ------------------
  |  Branch (524:9): [True: 66, False: 0]
  ------------------
  525|     66|        ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY);
  ------------------
  |  |  401|     66|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     66|    (ERR_new(),                                                 \
  |  |  |  |  404|     66|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     66|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     66|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     66|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     66|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|     66|        return NULL;
  527|     66|    }
  528|       |
  529|      0|    prc = req->body->value.pollReq;
  530|      0|    if (sk_OSSL_CMP_POLLREQ_num(prc) != 1) {
  ------------------
  |  Branch (530:9): [True: 0, False: 0]
  ------------------
  531|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  532|      0|        return NULL;
  533|      0|    }
  534|       |
  535|      0|    pr = sk_OSSL_CMP_POLLREQ_value(prc, 0);
  536|      0|    certReqId = ossl_cmp_asn1_get_int(pr->certReqId);
  537|      0|    if (!srv_ctx->process_pollReq(srv_ctx, req, certReqId,
  ------------------
  |  Branch (537:9): [True: 0, False: 0]
  ------------------
  538|      0|                                  &orig_req, &check_after))
  539|      0|        return NULL;
  540|       |
  541|      0|    if (orig_req != NULL) {
  ------------------
  |  Branch (541:9): [True: 0, False: 0]
  ------------------
  542|      0|        srv_ctx->polling = 0;
  543|      0|        msg = process_non_polling_request(srv_ctx, orig_req);
  544|      0|        OSSL_CMP_MSG_free(orig_req);
  545|      0|    } else {
  546|      0|        if ((msg = ossl_cmp_pollRep_new(srv_ctx->ctx, certReqId,
  ------------------
  |  Branch (546:13): [True: 0, False: 0]
  ------------------
  547|      0|                                        check_after)) == NULL)
  548|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREP);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  549|      0|    }
  550|      0|    return msg;
  551|      0|}
cmp_server.c:delayed_delivery:
  171|  2.29k|{
  172|  2.29k|    int ret;
  173|  2.29k|    unsigned long err;
  174|  2.29k|    int status = OSSL_CMP_PKISTATUS_waiting,
  ------------------
  |  |  203|  2.29k|#  define OSSL_CMP_PKISTATUS_waiting                3
  ------------------
  175|  2.29k|        fail_info = 0, errorCode = 0;
  176|  2.29k|    const char *txt = NULL, *details = NULL;
  177|  2.29k|    OSSL_CMP_PKISI *si;
  178|  2.29k|    OSSL_CMP_MSG *msg;
  179|       |
  180|  2.29k|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL
  ------------------
  |  |   52|  13.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  ------------------
  |  |   53|  2.29k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (180:9): [True: 0, False: 2.29k]
  ------------------
  181|  2.29k|                     && srv_ctx->delayed_delivery != NULL))
  182|      0|        return NULL;
  183|       |
  184|  2.29k|    ret = srv_ctx->delayed_delivery(srv_ctx, req);
  185|  2.29k|    if (ret == 0)
  ------------------
  |  Branch (185:9): [True: 2.29k, False: 0]
  ------------------
  186|  2.29k|        return NULL;
  187|      0|    if (ret == 1) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|        srv_ctx->polling = 1;
  189|      0|    } else {
  190|      0|        status = OSSL_CMP_PKISTATUS_rejection;
  ------------------
  |  |  202|      0|#  define OSSL_CMP_PKISTATUS_rejection              2
  ------------------
  191|      0|        fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_systemFailure;
  ------------------
  |  |  134|      0|#  define OSSL_CMP_PKIFAILUREINFO_systemFailure 25
  ------------------
  192|      0|        txt = "server application error";
  193|      0|        err = ERR_peek_error();
  194|      0|        errorCode = ERR_GET_REASON(err);
  195|      0|        details = ERR_reason_error_string(err);
  196|      0|    }
  197|       |
  198|      0|    si = OSSL_CMP_STATUSINFO_new(status, fail_info, txt);
  199|      0|    if (si == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 0]
  ------------------
  200|      0|        return NULL;
  201|       |
  202|      0|    msg = ossl_cmp_error_new(srv_ctx->ctx, si, errorCode, details,
  203|      0|                             srv_ctx->sendUnprotectedErrors);
  204|      0|    OSSL_CMP_PKISI_free(si);
  205|      0|    return msg;
  206|      0|}
cmp_server.c:process_non_polling_request:
  458|  2.29k|{
  459|  2.29k|    OSSL_CMP_MSG *rsp = NULL;
  460|       |
  461|  2.29k|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL
  ------------------
  |  |   52|  13.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  |  Branch (52:43): [True: 2.29k, False: 0]
  |  |  ------------------
  |  |   53|  2.29k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (461:9): [True: 0, False: 2.29k]
  ------------------
  462|  2.29k|                     && req->body != NULL))
  463|      0|        return NULL;
  464|       |
  465|  2.29k|    switch (OSSL_CMP_MSG_get_bodytype(req)) {
  466|    166|    case OSSL_CMP_PKIBODY_IR:
  ------------------
  |  |  912|    166|# define OSSL_CMP_PKIBODY_IR        0
  ------------------
  |  Branch (466:5): [True: 166, False: 2.12k]
  ------------------
  467|    253|    case OSSL_CMP_PKIBODY_CR:
  ------------------
  |  |  914|    253|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
  |  Branch (467:5): [True: 87, False: 2.20k]
  ------------------
  468|    857|    case OSSL_CMP_PKIBODY_P10CR:
  ------------------
  |  |  916|    857|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (468:5): [True: 604, False: 1.68k]
  ------------------
  469|  1.08k|    case OSSL_CMP_PKIBODY_KUR:
  ------------------
  |  |  919|  1.08k|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
  |  Branch (469:5): [True: 229, False: 2.06k]
  ------------------
  470|  1.08k|        if (srv_ctx->process_cert_request == NULL)
  ------------------
  |  Branch (470:13): [True: 0, False: 1.08k]
  ------------------
  471|  1.08k|            ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  472|  1.08k|        else
  473|  1.08k|            rsp = process_cert_request(srv_ctx, req);
  474|  1.08k|        break;
  475|     22|    case OSSL_CMP_PKIBODY_RR:
  ------------------
  |  |  923|     22|# define OSSL_CMP_PKIBODY_RR       11
  ------------------
  |  Branch (475:5): [True: 22, False: 2.27k]
  ------------------
  476|     22|        if (srv_ctx->process_rr == NULL)
  ------------------
  |  Branch (476:13): [True: 0, False: 22]
  ------------------
  477|     22|            ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  478|     22|        else
  479|     22|            rsp = process_rr(srv_ctx, req);
  480|     22|        break;
  481|    161|    case OSSL_CMP_PKIBODY_GENM:
  ------------------
  |  |  933|    161|# define OSSL_CMP_PKIBODY_GENM     21
  ------------------
  |  Branch (481:5): [True: 161, False: 2.13k]
  ------------------
  482|    161|        if (srv_ctx->process_genm == NULL)
  ------------------
  |  Branch (482:13): [True: 0, False: 161]
  ------------------
  483|    161|            ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  484|    161|        else
  485|    161|            rsp = process_genm(srv_ctx, req);
  486|    161|        break;
  487|     90|    case OSSL_CMP_PKIBODY_ERROR:
  ------------------
  |  |  935|     90|# define OSSL_CMP_PKIBODY_ERROR    23
  ------------------
  |  Branch (487:5): [True: 90, False: 2.20k]
  ------------------
  488|     90|        if (srv_ctx->process_error == NULL)
  ------------------
  |  Branch (488:13): [True: 0, False: 90]
  ------------------
  489|     90|            ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  490|     90|        else
  491|     90|            rsp = process_error(srv_ctx, req);
  492|     90|        break;
  493|    186|    case OSSL_CMP_PKIBODY_CERTCONF:
  ------------------
  |  |  936|    186|# define OSSL_CMP_PKIBODY_CERTCONF 24
  ------------------
  |  Branch (493:5): [True: 186, False: 2.10k]
  ------------------
  494|    186|        if (srv_ctx->process_certConf == NULL)
  ------------------
  |  Branch (494:13): [True: 0, False: 186]
  ------------------
  495|    186|            ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  496|    186|        else
  497|    186|            rsp = process_certConf(srv_ctx, req);
  498|    186|        break;
  499|       |
  500|      0|    case OSSL_CMP_PKIBODY_POLLREQ:
  ------------------
  |  |  937|      0|# define OSSL_CMP_PKIBODY_POLLREQ  25
  ------------------
  |  Branch (500:5): [True: 0, False: 2.29k]
  ------------------
  501|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  502|      0|        break;
  503|    748|    default:
  ------------------
  |  Branch (503:5): [True: 748, False: 1.54k]
  ------------------
  504|    748|        ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PKIBODY);
  ------------------
  |  |  401|    748|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    748|    (ERR_new(),                                                 \
  |  |  |  |  404|    748|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    748|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    748|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    748|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    748|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|    748|        break;
  506|  2.29k|    }
  507|       |
  508|  2.29k|    return rsp;
  509|  2.29k|}
cmp_server.c:process_cert_request:
  215|  1.08k|{
  216|  1.08k|    OSSL_CMP_MSG *msg = NULL;
  217|  1.08k|    OSSL_CMP_PKISI *si = NULL;
  218|  1.08k|    X509 *certOut = NULL;
  219|  1.08k|    EVP_PKEY *keyOut = NULL;
  220|  1.08k|    STACK_OF(X509) *chainOut = NULL, *caPubs = NULL;
  ------------------
  |  |   31|  1.08k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  221|  1.08k|    const OSSL_CRMF_MSG *crm = NULL;
  222|  1.08k|    const X509_REQ *p10cr = NULL;
  223|  1.08k|    int bodytype;
  224|  1.08k|    int certReqId, central_keygen;
  225|       |
  226|  1.08k|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL))
  ------------------
  |  |   52|  4.34k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 1.08k, False: 0]
  |  |  |  Branch (52:43): [True: 1.08k, False: 0]
  |  |  |  Branch (52:43): [True: 1.08k, False: 0]
  |  |  ------------------
  |  |   53|  1.08k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (226:9): [True: 0, False: 1.08k]
  ------------------
  227|      0|        return NULL;
  228|       |
  229|  1.08k|    switch (OSSL_CMP_MSG_get_bodytype(req)) {
  230|    604|    case OSSL_CMP_PKIBODY_P10CR:
  ------------------
  |  |  916|    604|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (230:5): [True: 604, False: 482]
  ------------------
  231|    691|    case OSSL_CMP_PKIBODY_CR:
  ------------------
  |  |  914|    691|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
  |  Branch (231:5): [True: 87, False: 999]
  ------------------
  232|    691|        bodytype = OSSL_CMP_PKIBODY_CP;
  ------------------
  |  |  915|    691|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  233|    691|        break;
  234|    166|    case OSSL_CMP_PKIBODY_IR:
  ------------------
  |  |  912|    166|# define OSSL_CMP_PKIBODY_IR        0
  ------------------
  |  Branch (234:5): [True: 166, False: 920]
  ------------------
  235|    166|        bodytype = OSSL_CMP_PKIBODY_IP;
  ------------------
  |  |  913|    166|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  236|    166|        break;
  237|    229|    case OSSL_CMP_PKIBODY_KUR:
  ------------------
  |  |  919|    229|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
  |  Branch (237:5): [True: 229, False: 857]
  ------------------
  238|    229|        bodytype = OSSL_CMP_PKIBODY_KUP;
  ------------------
  |  |  920|    229|# define OSSL_CMP_PKIBODY_KUP       8
  ------------------
  239|    229|        break;
  240|      0|    default:
  ------------------
  |  Branch (240:5): [True: 0, False: 1.08k]
  ------------------
  241|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  242|      0|        return NULL;
  243|  1.08k|    }
  244|       |
  245|  1.08k|    if (OSSL_CMP_MSG_get_bodytype(req) == OSSL_CMP_PKIBODY_P10CR) {
  ------------------
  |  |  916|  1.08k|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (245:9): [True: 604, False: 482]
  ------------------
  246|    604|        certReqId = OSSL_CMP_CERTREQID_NONE; /* p10cr does not include an Id */
  ------------------
  |  |  942|    604|# define OSSL_CMP_CERTREQID_NONE    -1
  ------------------
  247|    604|        p10cr = req->body->value.p10cr;
  248|    604|    } else {
  249|    482|        OSSL_CRMF_MSGS *reqs = req->body->value.ir; /* same for cr and kur */
  250|       |
  251|    482|        if (sk_OSSL_CRMF_MSG_num(reqs) != 1) {
  ------------------
  |  |   57|    482|#define sk_OSSL_CRMF_MSG_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))
  ------------------
  |  Branch (251:13): [True: 25, False: 457]
  ------------------
  252|     25|            ERR_raise(ERR_LIB_CMP, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED);
  ------------------
  |  |  401|     25|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     25|    (ERR_new(),                                                 \
  |  |  |  |  404|     25|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     25|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     25|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     25|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     25|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|     25|            return NULL;
  254|     25|        }
  255|    457|        if ((crm = sk_OSSL_CRMF_MSG_value(reqs, 0)) == NULL) {
  ------------------
  |  |   58|    457|#define sk_OSSL_CRMF_MSG_value(sk, idx) ((OSSL_CRMF_MSG *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), (idx)))
  ------------------
  |  Branch (255:13): [True: 0, False: 457]
  ------------------
  256|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_CERTREQMSG_NOT_FOUND);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  257|      0|            return NULL;
  258|      0|        }
  259|    457|        certReqId = OSSL_CRMF_MSG_get_certReqId(crm);
  260|    457|        if (certReqId != OSSL_CMP_CERTREQID) { /* so far, only possible value */
  ------------------
  |  |  941|    457|# define OSSL_CMP_CERTREQID         0
  ------------------
  |  Branch (260:13): [True: 161, False: 296]
  ------------------
  261|    161|            ERR_raise(ERR_LIB_CMP, CMP_R_BAD_REQUEST_ID);
  ------------------
  |  |  401|    161|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    161|    (ERR_new(),                                                 \
  |  |  |  |  404|    161|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    161|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    161|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    161|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    161|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|    161|            return NULL;
  263|    161|        }
  264|    457|    }
  265|    900|    srv_ctx->certReqId = certReqId;
  266|       |
  267|    900|    central_keygen = OSSL_CRMF_MSG_centralkeygen_requested(crm, p10cr);
  268|    900|    if (central_keygen < 0)
  ------------------
  |  Branch (268:9): [True: 1, False: 899]
  ------------------
  269|      1|        return NULL;
  270|    899|    if (central_keygen == 0
  ------------------
  |  Branch (270:9): [True: 897, False: 2]
  ------------------
  271|    899|        && !ossl_cmp_verify_popo(srv_ctx->ctx, req, srv_ctx->acceptRAVerified)) {
  ------------------
  |  Branch (271:12): [True: 0, False: 897]
  ------------------
  272|       |        /* Proof of possession could not be verified */
  273|      0|        si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection,
  ------------------
  |  |  202|      0|#  define OSSL_CMP_PKISTATUS_rejection              2
  ------------------
  274|      0|                                     1 << OSSL_CMP_PKIFAILUREINFO_badPOP,
  ------------------
  |  |  118|      0|#  define OSSL_CMP_PKIFAILUREINFO_badPOP 9
  ------------------
  275|      0|                                     ERR_reason_error_string(ERR_peek_error()));
  276|      0|        if (si == NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 0]
  ------------------
  277|      0|            return NULL;
  278|    899|    } else {
  279|    899|        OSSL_CMP_PKIHEADER *hdr = OSSL_CMP_MSG_get0_header(req);
  280|       |
  281|    899|        si = srv_ctx->process_cert_request(srv_ctx, req, certReqId, crm, p10cr,
  282|    899|                                           &certOut, &chainOut, &caPubs);
  283|    899|        if (si == NULL)
  ------------------
  |  Branch (283:13): [True: 899, False: 0]
  ------------------
  284|    899|            goto err;
  285|      0|        if (ossl_cmp_pkisi_get_status(si) == OSSL_CMP_PKISTATUS_waiting)
  ------------------
  |  |  203|      0|#  define OSSL_CMP_PKISTATUS_waiting                3
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|            srv_ctx->polling = 1;
  287|       |        /* set OSSL_CMP_OPT_IMPLICIT_CONFIRM if and only if transaction ends */
  288|      0|        if (!OSSL_CMP_CTX_set_option(srv_ctx->ctx,
  ------------------
  |  Branch (288:13): [True: 0, False: 0]
  ------------------
  289|      0|                                     OSSL_CMP_OPT_IMPLICIT_CONFIRM,
  ------------------
  |  |  494|      0|#  define OSSL_CMP_OPT_IMPLICIT_CONFIRM 25
  ------------------
  290|      0|                                     ossl_cmp_hdr_has_implicitConfirm(hdr)
  ------------------
  |  Branch (290:38): [True: 0, False: 0]
  ------------------
  291|      0|                                         && srv_ctx->grantImplicitConfirm
  ------------------
  |  Branch (291:45): [True: 0, False: 0]
  ------------------
  292|       |                                         /* do not set if polling starts: */
  293|      0|                                         && certOut != NULL))
  ------------------
  |  Branch (293:45): [True: 0, False: 0]
  ------------------
  294|      0|            goto err;
  295|      0|        if (central_keygen == 1
  ------------------
  |  Branch (295:13): [True: 0, False: 0]
  ------------------
  296|      0|            && srv_ctx->ctx->newPkey_priv && srv_ctx->ctx->newPkey != NULL)
  ------------------
  |  Branch (296:16): [True: 0, False: 0]
  |  Branch (296:46): [True: 0, False: 0]
  ------------------
  297|      0|            keyOut = srv_ctx->ctx->newPkey;
  298|      0|    }
  299|       |
  300|      0|    msg = ossl_cmp_certrep_new(srv_ctx->ctx, bodytype, certReqId, si,
  301|      0|                               certOut, keyOut, NULL /* enc */, chainOut, caPubs,
  302|      0|                               srv_ctx->sendUnprotectedErrors);
  303|       |    /* When supporting OSSL_CRMF_POPO_KEYENC, "enc" will need to be set */
  304|      0|    if (msg == NULL)
  ------------------
  |  Branch (304:9): [True: 0, False: 0]
  ------------------
  305|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREP);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|       |
  307|    899| err:
  308|    899|    OSSL_CMP_PKISI_free(si);
  309|    899|    X509_free(certOut);
  310|    899|    OSSL_CMP_CTX_set0_newPkey(srv_ctx->ctx, 0, NULL);
  311|    899|    OSSL_STACK_OF_X509_free(chainOut);
  312|    899|    OSSL_STACK_OF_X509_free(caPubs);
  313|    899|    return msg;
  314|      0|}
cmp_server.c:process_rr:
  318|     22|{
  319|     22|    OSSL_CMP_MSG *msg = NULL;
  320|     22|    OSSL_CMP_REVDETAILS *details;
  321|     22|    OSSL_CRMF_CERTID *certId = NULL;
  322|     22|    OSSL_CRMF_CERTTEMPLATE *tmpl;
  323|     22|    const X509_NAME *issuer;
  324|     22|    const ASN1_INTEGER *serial;
  325|     22|    OSSL_CMP_PKISI *si;
  326|       |
  327|     22|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL))
  ------------------
  |  |   52|     88|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 22, False: 0]
  |  |  |  Branch (52:43): [True: 22, False: 0]
  |  |  |  Branch (52:43): [True: 22, False: 0]
  |  |  ------------------
  |  |   53|     22|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (327:9): [True: 0, False: 22]
  ------------------
  328|      0|        return NULL;
  329|       |
  330|     22|    if (sk_OSSL_CMP_REVDETAILS_num(req->body->value.rr) != 1) {
  ------------------
  |  Branch (330:9): [True: 18, False: 4]
  ------------------
  331|     18|        ERR_raise(ERR_LIB_CMP, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED);
  ------------------
  |  |  401|     18|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     18|    (ERR_new(),                                                 \
  |  |  |  |  404|     18|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     18|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     18|     ERR_set_error)
  |  |  ------------------
  ------------------
  332|     18|        return NULL;
  333|     18|    }
  334|      4|    details = sk_OSSL_CMP_REVDETAILS_value(req->body->value.rr, 0);
  335|      4|    if (details == NULL) {
  ------------------
  |  Branch (335:9): [True: 0, False: 4]
  ------------------
  336|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  337|      0|        return NULL;
  338|      0|    }
  339|       |
  340|      4|    tmpl = details->certDetails;
  341|      4|    issuer = OSSL_CRMF_CERTTEMPLATE_get0_issuer(tmpl);
  342|      4|    serial = OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(tmpl);
  343|      4|    if (issuer != NULL && serial != NULL
  ------------------
  |  Branch (343:9): [True: 3, False: 1]
  |  Branch (343:27): [True: 2, False: 1]
  ------------------
  344|      4|            && (certId = OSSL_CRMF_CERTID_gen(issuer, serial)) == NULL)
  ------------------
  |  Branch (344:16): [True: 0, False: 2]
  ------------------
  345|      0|        return NULL;
  346|      4|    if ((si = srv_ctx->process_rr(srv_ctx, req, issuer, serial)) == NULL)
  ------------------
  |  Branch (346:9): [True: 4, False: 0]
  ------------------
  347|      4|        goto err;
  348|       |
  349|      0|    if ((msg = ossl_cmp_rp_new(srv_ctx->ctx, si, certId,
  ------------------
  |  Branch (349:9): [True: 0, False: 0]
  ------------------
  350|      0|                               srv_ctx->sendUnprotectedErrors)) == NULL)
  351|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_RR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|       |
  353|      4| err:
  354|      4|    OSSL_CRMF_CERTID_free(certId);
  355|      4|    OSSL_CMP_PKISI_free(si);
  356|      4|    return msg;
  357|      0|}
cmp_server.c:process_genm:
  365|    161|{
  366|    161|    OSSL_CMP_GENMSGCONTENT *itavs;
  367|    161|    OSSL_CMP_MSG *msg;
  368|       |
  369|    161|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL))
  ------------------
  |  |   52|    644|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 161, False: 0]
  |  |  |  Branch (52:43): [True: 161, False: 0]
  |  |  |  Branch (52:43): [True: 161, False: 0]
  |  |  ------------------
  |  |   53|    161|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (369:9): [True: 0, False: 161]
  ------------------
  370|      0|        return NULL;
  371|       |
  372|    161|    if (!srv_ctx->process_genm(srv_ctx, req, req->body->value.genm, &itavs))
  ------------------
  |  Branch (372:9): [True: 161, False: 0]
  ------------------
  373|    161|        return NULL;
  374|       |
  375|      0|    msg = ossl_cmp_genp_new(srv_ctx->ctx, itavs);
  376|      0|    sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free);
  ------------------
  |  |  266|      0|#define sk_OSSL_CMP_ITAV_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc))
  ------------------
  377|      0|    return msg;
  378|    161|}
cmp_server.c:process_error:
  382|     90|{
  383|     90|    OSSL_CMP_ERRORMSGCONTENT *errorContent;
  384|     90|    OSSL_CMP_MSG *msg;
  385|       |
  386|     90|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL))
  ------------------
  |  |   52|    360|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 90, False: 0]
  |  |  |  Branch (52:43): [True: 90, False: 0]
  |  |  |  Branch (52:43): [True: 90, False: 0]
  |  |  ------------------
  |  |   53|     90|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (386:9): [True: 0, False: 90]
  ------------------
  387|      0|        return NULL;
  388|     90|    errorContent = req->body->value.error;
  389|     90|    srv_ctx->process_error(srv_ctx, req, errorContent->pKIStatusInfo,
  390|     90|                           errorContent->errorCode, errorContent->errorDetails);
  391|       |
  392|     90|    if ((msg = ossl_cmp_pkiconf_new(srv_ctx->ctx)) == NULL)
  ------------------
  |  Branch (392:9): [True: 90, False: 0]
  ------------------
  393|     90|        ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_PKICONF);
  ------------------
  |  |  401|     90|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     90|    (ERR_new(),                                                 \
  |  |  |  |  404|     90|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     90|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     90|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     90|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     90|     ERR_set_error)
  |  |  ------------------
  ------------------
  394|     90|    return msg;
  395|     90|}
cmp_server.c:process_certConf:
  399|    186|{
  400|    186|    OSSL_CMP_CTX *ctx;
  401|    186|    OSSL_CMP_CERTCONFIRMCONTENT *ccc;
  402|    186|    int num;
  403|    186|    OSSL_CMP_MSG *msg = NULL;
  404|    186|    OSSL_CMP_CERTSTATUS *status = NULL;
  405|       |
  406|    186|    if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL))
  ------------------
  |  |   52|    744|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 186, False: 0]
  |  |  |  Branch (52:43): [True: 186, False: 0]
  |  |  |  Branch (52:43): [True: 186, False: 0]
  |  |  ------------------
  |  |   53|    186|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (406:9): [True: 0, False: 186]
  ------------------
  407|      0|        return NULL;
  408|       |
  409|    186|    ctx = srv_ctx->ctx;
  410|    186|    ccc = req->body->value.certConf;
  411|    186|    num = sk_OSSL_CMP_CERTSTATUS_num(ccc);
  ------------------
  |  |  223|    186|#define sk_OSSL_CMP_CERTSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk))
  ------------------
  412|       |
  413|    186|    if (OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_IMPLICIT_CONFIRM) == 1
  ------------------
  |  |  494|    186|#  define OSSL_CMP_OPT_IMPLICIT_CONFIRM 25
  ------------------
  |  Branch (413:9): [True: 0, False: 186]
  ------------------
  414|    186|            || ctx->status != OSSL_CMP_PKISTATUS_trans) {
  ------------------
  |  |  198|    186|#  define OSSL_CMP_PKISTATUS_trans                  -2
  ------------------
  |  Branch (414:16): [True: 186, False: 0]
  ------------------
  415|    186|        ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_UNEXPECTED_CERTCONF);
  ------------------
  |  |  401|    186|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    186|    (ERR_new(),                                                 \
  |  |  |  |  404|    186|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    186|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    186|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    186|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    186|     ERR_set_error)
  |  |  ------------------
  ------------------
  416|    186|        return NULL;
  417|    186|    }
  418|       |
  419|      0|    if (num == 0) {
  ------------------
  |  Branch (419:9): [True: 0, False: 0]
  ------------------
  420|      0|        ossl_cmp_err(ctx, "certificate rejected by client");
  ------------------
  |  |  858|      0|# define ossl_cmp_err(ctx, msg)   ossl_cmp_log(ERROR, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  421|      0|    } else {
  422|      0|        if (num > 1)
  ------------------
  |  Branch (422:13): [True: 0, False: 0]
  ------------------
  423|      0|            ossl_cmp_warn(ctx, "All CertStatus but the first will be ignored");
  ------------------
  |  |  859|      0|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|      0|        status = sk_OSSL_CMP_CERTSTATUS_value(ccc, 0);
  ------------------
  |  |  224|      0|#define sk_OSSL_CMP_CERTSTATUS_value(sk, idx) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), (idx)))
  ------------------
  425|      0|    }
  426|       |
  427|      0|    if (status != NULL) {
  ------------------
  |  Branch (427:9): [True: 0, False: 0]
  ------------------
  428|      0|        int certReqId = ossl_cmp_asn1_get_int(status->certReqId);
  429|      0|        ASN1_OCTET_STRING *certHash = status->certHash;
  430|      0|        OSSL_CMP_PKISI *si = status->statusInfo;
  431|       |
  432|      0|        if (certReqId != srv_ctx->certReqId) {
  ------------------
  |  Branch (432:13): [True: 0, False: 0]
  ------------------
  433|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_BAD_REQUEST_ID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  434|      0|            return NULL;
  435|      0|        }
  436|      0|        if (!srv_ctx->process_certConf(srv_ctx, req, certReqId, certHash, si))
  ------------------
  |  Branch (436:13): [True: 0, False: 0]
  ------------------
  437|      0|            return NULL; /* reason code may be: CMP_R_CERTHASH_UNMATCHED */
  438|       |
  439|      0|        if (si != NULL
  ------------------
  |  Branch (439:13): [True: 0, False: 0]
  ------------------
  440|      0|            && ossl_cmp_pkisi_get_status(si) != OSSL_CMP_PKISTATUS_accepted) {
  ------------------
  |  |  200|      0|#  define OSSL_CMP_PKISTATUS_accepted               0
  ------------------
  |  Branch (440:16): [True: 0, False: 0]
  ------------------
  441|      0|            int pki_status = ossl_cmp_pkisi_get_status(si);
  442|      0|            const char *str = ossl_cmp_PKIStatus_to_string(pki_status);
  443|       |
  444|      0|            ossl_cmp_log2(INFO, ctx, "certificate rejected by client %s %s",
  ------------------
  |  |  847|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  848|      0|                       OPENSSL_LINE, #level, fmt, arg1, arg2)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (848:51): [True: 0, False: 0]
  |  |  |  Branch (848:57): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  445|      0|                          str == NULL ? "without" : "with",
  446|      0|                          str == NULL ? "PKIStatus" : str);
  447|      0|        }
  448|      0|    }
  449|       |
  450|      0|    if ((msg = ossl_cmp_pkiconf_new(ctx)) == NULL)
  ------------------
  |  Branch (450:9): [True: 0, False: 0]
  ------------------
  451|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_CREATING_PKICONF);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  452|      0|    return msg;
  453|      0|}

OSSL_CMP_STATUSINFO_new:
  280|  6.94k|{
  281|  6.94k|    OSSL_CMP_PKISI *si = OSSL_CMP_PKISI_new();
  282|  6.94k|    ASN1_UTF8STRING *utf8_text = NULL;
  283|  6.94k|    int failure;
  284|       |
  285|  6.94k|    if (si == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 6.94k]
  ------------------
  286|      0|        goto err;
  287|  6.94k|    if (!ASN1_INTEGER_set(si->status, status))
  ------------------
  |  Branch (287:9): [True: 0, False: 6.94k]
  ------------------
  288|      0|        goto err;
  289|       |
  290|  6.94k|    if (text != NULL) {
  ------------------
  |  Branch (290:9): [True: 6.89k, False: 49]
  ------------------
  291|  6.89k|        if ((utf8_text = ASN1_UTF8STRING_new()) == NULL
  ------------------
  |  Branch (291:13): [True: 0, False: 6.89k]
  ------------------
  292|  6.89k|                || !ASN1_STRING_set(utf8_text, text, -1))
  ------------------
  |  Branch (292:20): [True: 0, False: 6.89k]
  ------------------
  293|      0|            goto err;
  294|  6.89k|        if ((si->statusString = sk_ASN1_UTF8STRING_new_null()) == NULL)
  ------------------
  |  |  767|  6.89k|#define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (294:13): [True: 0, False: 6.89k]
  ------------------
  295|      0|            goto err;
  296|  6.89k|        if (!sk_ASN1_UTF8STRING_push(si->statusString, utf8_text))
  ------------------
  |  |  774|  6.89k|#define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
  ------------------
  |  Branch (296:13): [True: 0, False: 6.89k]
  ------------------
  297|      0|            goto err;
  298|       |        /* Ownership is lost. */
  299|  6.89k|        utf8_text = NULL;
  300|  6.89k|    }
  301|       |
  302|   194k|    for (failure = 0; failure <= OSSL_CMP_PKIFAILUREINFO_MAX; failure++) {
  ------------------
  |  |  136|   194k|#  define OSSL_CMP_PKIFAILUREINFO_MAX 26
  ------------------
  |  Branch (302:23): [True: 187k, False: 6.94k]
  ------------------
  303|   187k|        if ((fail_info & (1 << failure)) != 0) {
  ------------------
  |  Branch (303:13): [True: 6.94k, False: 180k]
  ------------------
  304|  6.94k|            if (si->failInfo == NULL
  ------------------
  |  Branch (304:17): [True: 6.94k, False: 0]
  ------------------
  305|  6.94k|                    && (si->failInfo = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (305:24): [True: 0, False: 6.94k]
  ------------------
  306|      0|                goto err;
  307|  6.94k|            if (!ASN1_BIT_STRING_set_bit(si->failInfo, failure, 1))
  ------------------
  |  Branch (307:17): [True: 0, False: 6.94k]
  ------------------
  308|      0|                goto err;
  309|  6.94k|        }
  310|   187k|    }
  311|  6.94k|    return si;
  312|       |
  313|      0| err:
  314|      0|    OSSL_CMP_PKISI_free(si);
  315|      0|    ASN1_UTF8STRING_free(utf8_text);
  316|      0|    return NULL;
  317|  6.94k|}

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|}
OSSL_CMP_print_errors_cb:
  152|  7.58k|{
  153|  7.58k|    unsigned long err;
  154|  7.58k|    char msg[ERR_PRINT_BUF_SIZE];
  155|  7.58k|    const char *file = NULL, *func = NULL, *data = NULL;
  156|  7.58k|    int line, flags;
  157|       |
  158|  48.9k|    while ((err = ERR_get_error_all(&file, &line, &func, &data, &flags)) != 0) {
  ------------------
  |  Branch (158:12): [True: 41.3k, False: 7.58k]
  ------------------
  159|  41.3k|        const char *component =
  160|  41.3k|            improve_location_name(func, ERR_lib_error_string(err));
  161|  41.3k|        unsigned long reason = ERR_GET_REASON(err);
  162|  41.3k|        const char *rs = NULL;
  163|  41.3k|        char rsbuf[256];
  164|       |
  165|  41.3k|#ifndef OPENSSL_NO_ERR
  166|  41.3k|        if (ERR_SYSTEM_ERROR(err)) {
  ------------------
  |  |  239|  41.3k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  41.3k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 41.3k]
  |  |  ------------------
  ------------------
  167|      0|            if (openssl_strerror_r(reason, rsbuf, sizeof(rsbuf)))
  ------------------
  |  Branch (167:17): [True: 0, False: 0]
  ------------------
  168|      0|                rs = rsbuf;
  169|  41.3k|        } else {
  170|  41.3k|            rs = ERR_reason_error_string(err);
  171|  41.3k|        }
  172|  41.3k|#endif
  173|  41.3k|        if (rs == NULL) {
  ------------------
  |  Branch (173:13): [True: 52, False: 41.2k]
  ------------------
  174|     52|            BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", reason);
  175|     52|            rs = rsbuf;
  176|     52|        }
  177|  41.3k|        if (data != NULL && (flags & ERR_TXT_STRING) != 0)
  ------------------
  |  |   49|  41.3k|# define ERR_TXT_STRING          0x02
  ------------------
  |  Branch (177:13): [True: 41.3k, False: 0]
  |  Branch (177:29): [True: 2.51k, False: 38.8k]
  ------------------
  178|  2.51k|            BIO_snprintf(msg, sizeof(msg), "%s:%s", rs, data);
  179|  38.8k|        else
  180|  38.8k|            BIO_snprintf(msg, sizeof(msg), "%s", rs);
  181|       |
  182|  41.3k|        if (log_fn == NULL) {
  ------------------
  |  Branch (182:13): [True: 0, False: 41.3k]
  ------------------
  183|      0|#ifndef OPENSSL_NO_STDIO
  184|      0|            BIO *bio = BIO_new_fp(stderr, BIO_NOCLOSE);
  ------------------
  |  |   82|      0|# define BIO_NOCLOSE             0x00
  ------------------
  185|       |
  186|      0|            if (bio != NULL) {
  ------------------
  |  Branch (186:17): [True: 0, False: 0]
  ------------------
  187|      0|                OSSL_CMP_print_to_bio(bio, component, file, line,
  188|      0|                                      OSSL_CMP_LOG_ERR, msg);
  ------------------
  |  |   37|      0|#  define OSSL_CMP_LOG_ERR     3
  ------------------
  189|      0|                BIO_free(bio);
  190|      0|            }
  191|       |#else
  192|       |            /* ERR_raise(..., CMP_R_NO_STDIO) would make no sense here */
  193|       |#endif
  194|  41.3k|        } else {
  195|  41.3k|            if (log_fn(component, file, line, OSSL_CMP_LOG_ERR, msg) <= 0)
  ------------------
  |  |   37|  41.3k|#  define OSSL_CMP_LOG_ERR     3
  ------------------
  |  Branch (195:17): [True: 0, False: 41.3k]
  ------------------
  196|      0|                break; /* abort outputting the error report */
  197|  41.3k|        }
  198|  41.3k|    }
  199|  7.58k|}
ossl_cmp_sk_ASN1_UTF8STRING_push_str:
  224|  14.2k|{
  225|  14.2k|    ASN1_UTF8STRING *utf8string;
  226|       |
  227|  14.2k|    if (!ossl_assert(sk != NULL && text != NULL))
  ------------------
  |  |   52|  28.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 14.2k, False: 0]
  |  |  |  Branch (52:43): [True: 14.2k, False: 0]
  |  |  ------------------
  |  |   53|  14.2k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (227:9): [True: 0, False: 14.2k]
  ------------------
  228|      0|        return 0;
  229|  14.2k|    if ((utf8string = ASN1_UTF8STRING_new()) == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 14.2k]
  ------------------
  230|      0|        return 0;
  231|  14.2k|    if (!ASN1_STRING_set(utf8string, text, len))
  ------------------
  |  Branch (231:9): [True: 0, False: 14.2k]
  ------------------
  232|      0|        goto err;
  233|  14.2k|    if (!sk_ASN1_UTF8STRING_push(sk, utf8string))
  ------------------
  |  |  774|  14.2k|#define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
  ------------------
  |  Branch (233:9): [True: 0, False: 14.2k]
  ------------------
  234|      0|        goto err;
  235|  14.2k|    return 1;
  236|       |
  237|      0| err:
  238|      0|    ASN1_UTF8STRING_free(utf8string);
  239|      0|    return 0;
  240|  14.2k|}
ossl_cmp_asn1_octet_string_set1:
  244|  59.5k|{
  245|  59.5k|    ASN1_OCTET_STRING *new;
  246|       |
  247|  59.5k|    if (tgt == NULL) {
  ------------------
  |  Branch (247:9): [True: 0, False: 59.5k]
  ------------------
  248|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  249|      0|        return 0;
  250|      0|    }
  251|  59.5k|    if (*tgt == src) /* self-assignment */
  ------------------
  |  Branch (251:9): [True: 26.5k, False: 32.9k]
  ------------------
  252|  26.5k|        return 1;
  253|       |
  254|  32.9k|    if (src != NULL) {
  ------------------
  |  Branch (254:9): [True: 19.0k, False: 13.8k]
  ------------------
  255|  19.0k|        if ((new = ASN1_OCTET_STRING_dup(src)) == NULL)
  ------------------
  |  Branch (255:13): [True: 0, False: 19.0k]
  ------------------
  256|      0|            return 0;
  257|  19.0k|    } else {
  258|  13.8k|        new = NULL;
  259|  13.8k|    }
  260|       |
  261|  32.9k|    ASN1_OCTET_STRING_free(*tgt);
  262|  32.9k|    *tgt = new;
  263|  32.9k|    return 1;
  264|  32.9k|}
ossl_cmp_asn1_octet_string_set1_bytes:
  268|  21.5k|{
  269|  21.5k|    ASN1_OCTET_STRING *new = NULL;
  270|       |
  271|  21.5k|    if (tgt == NULL) {
  ------------------
  |  Branch (271:9): [True: 0, False: 21.5k]
  ------------------
  272|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|        return 0;
  274|      0|    }
  275|  21.5k|    if (bytes != NULL) {
  ------------------
  |  Branch (275:9): [True: 21.5k, False: 0]
  ------------------
  276|  21.5k|        if ((new = ASN1_OCTET_STRING_new()) == NULL
  ------------------
  |  Branch (276:13): [True: 0, False: 21.5k]
  ------------------
  277|  21.5k|                || !(ASN1_OCTET_STRING_set(new, bytes, len))) {
  ------------------
  |  Branch (277:20): [True: 0, False: 21.5k]
  ------------------
  278|      0|            ASN1_OCTET_STRING_free(new);
  279|      0|            return 0;
  280|      0|        }
  281|  21.5k|    }
  282|       |
  283|  21.5k|    ASN1_OCTET_STRING_free(*tgt);
  284|  21.5k|    *tgt = new;
  285|  21.5k|    return 1;
  286|  21.5k|}
cmp_util.c:improve_location_name:
  119|  41.3k|{
  120|  41.3k|    if (fallback == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 41.3k]
  ------------------
  121|      0|        return func == NULL ? UNKNOWN_FUNC : func;
  ------------------
  |  |  113|      0|#define UNKNOWN_FUNC "(unknown function)" /* the default for OPENSSL_FUNC */
  ------------------
  |  Branch (121:16): [True: 0, False: 0]
  ------------------
  122|       |
  123|  41.3k|    return func == NULL || *func == '\0' || strcmp(func, UNKNOWN_FUNC) == 0
  ------------------
  |  |  113|  41.3k|#define UNKNOWN_FUNC "(unknown function)" /* the default for OPENSSL_FUNC */
  ------------------
  |  Branch (123:12): [True: 0, False: 41.3k]
  |  Branch (123:28): [True: 0, False: 41.3k]
  |  Branch (123:45): [True: 0, False: 41.3k]
  ------------------
  124|  41.3k|        ? fallback : func;
  125|  41.3k|}

OSSL_CMP_validate_cert_path:
  108|     13|{
  109|     13|    int valid = 0;
  110|     13|    X509_STORE_CTX *csc = NULL;
  111|     13|    int err;
  112|       |
  113|     13|    if (ctx == NULL || cert == NULL) {
  ------------------
  |  Branch (113:9): [True: 0, False: 13]
  |  Branch (113:24): [True: 0, False: 13]
  ------------------
  114|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|       |
  118|     13|    if (trusted_store == NULL) {
  ------------------
  |  Branch (118:9): [True: 13, False: 0]
  ------------------
  119|     13|        ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_TRUST_STORE);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     13|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|     13|        return 0;
  121|     13|    }
  122|       |
  123|      0|    if ((csc = X509_STORE_CTX_new_ex(ctx->libctx, ctx->propq)) == NULL
  ------------------
  |  Branch (123:9): [True: 0, False: 0]
  ------------------
  124|      0|            || !X509_STORE_CTX_init(csc, trusted_store,
  ------------------
  |  Branch (124:16): [True: 0, False: 0]
  ------------------
  125|      0|                                    cert, ctx->untrusted))
  126|      0|        goto err;
  127|       |
  128|      0|    valid = X509_verify_cert(csc) > 0;
  129|       |
  130|       |    /* make sure suitable error is queued even if callback did not do */
  131|      0|    err = ERR_peek_last_error();
  132|      0|    if (!valid && ERR_GET_REASON(err) != CMP_R_POTENTIALLY_INVALID_CERTIFICATE)
  ------------------
  |  |   97|      0|#  define CMP_R_POTENTIALLY_INVALID_CERTIFICATE            147
  ------------------
  |  Branch (132:9): [True: 0, False: 0]
  |  Branch (132:19): [True: 0, False: 0]
  ------------------
  133|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_POTENTIALLY_INVALID_CERTIFICATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  134|       |
  135|      0| err:
  136|       |    /* directly output any fresh errors, needed for check_msg_find_cert() */
  137|      0|    OSSL_CMP_CTX_print_errors(ctx);
  138|      0|    X509_STORE_CTX_free(csc);
  139|      0|    return valid;
  140|      0|}
OSSL_CMP_validate_msg:
  564|  1.23k|{
  565|  1.23k|    X509 *scrt;
  566|       |
  567|  1.23k|    ossl_cmp_debug(ctx, "validating CMP message");
  ------------------
  |  |  861|  1.23k|# define ossl_cmp_debug(ctx, msg) ossl_cmp_log(DEBUG, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|  1.23k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.23k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.23k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|  1.23k|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.23k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|  1.23k|    if (ctx == NULL || msg == NULL
  ------------------
  |  Branch (568:9): [True: 0, False: 1.23k]
  |  Branch (568:24): [True: 0, False: 1.23k]
  ------------------
  569|  1.23k|            || msg->header == NULL || msg->body == NULL) {
  ------------------
  |  Branch (569:16): [True: 0, False: 1.23k]
  |  Branch (569:39): [True: 0, False: 1.23k]
  ------------------
  570|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  571|      0|        return 0;
  572|      0|    }
  573|       |
  574|  1.23k|    if (msg->header->protectionAlg == NULL /* unprotected message */
  ------------------
  |  Branch (574:9): [True: 0, False: 1.23k]
  ------------------
  575|  1.23k|            || msg->protection == NULL || msg->protection->data == NULL) {
  ------------------
  |  Branch (575:16): [True: 17, False: 1.21k]
  |  Branch (575:43): [True: 0, False: 1.21k]
  ------------------
  576|     17|        ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_PROTECTION);
  ------------------
  |  |  401|     17|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     17|    (ERR_new(),                                                 \
  |  |  |  |  404|     17|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     17|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     17|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     17|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     17|     ERR_set_error)
  |  |  ------------------
  ------------------
  577|     17|        return 0;
  578|     17|    }
  579|       |
  580|  1.21k|    switch (ossl_cmp_hdr_get_protection_nid(msg->header)) {
  581|       |        /* 5.1.3.1.  Shared Secret Information */
  582|    274|    case NID_id_PasswordBasedMAC:
  ------------------
  |  |  520|    274|#define NID_id_PasswordBasedMAC         782
  ------------------
  |  Branch (582:5): [True: 274, False: 942]
  ------------------
  583|    274|        if (ctx->secretValue == NULL) {
  ------------------
  |  Branch (583:13): [True: 102, False: 172]
  ------------------
  584|    102|            ossl_cmp_info(ctx, "no secret available for verifying PBM-based CMP message protection");
  ------------------
  |  |  860|    102|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|    102|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    102|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    102|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|    102|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    102|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  585|    102|            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_SECRET);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    102|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    102|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    102|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    102|     ERR_set_error)
  |  |  ------------------
  ------------------
  586|    102|            return 0;
  587|    102|        }
  588|    172|        if (verify_PBMAC(ctx, msg)) {
  ------------------
  |  Branch (588:13): [True: 2, False: 170]
  ------------------
  589|       |            /*
  590|       |             * RFC 4210, 5.3.2: 'Note that if the PKI Message Protection is
  591|       |             * "shared secret information", then any certificate transported in
  592|       |             * the caPubs field may be directly trusted as a root CA
  593|       |             * certificate by the initiator.'
  594|       |             */
  595|      2|            switch (OSSL_CMP_MSG_get_bodytype(msg)) {
  596|      0|            case -1:
  ------------------
  |  Branch (596:13): [True: 0, False: 2]
  ------------------
  597|      0|                return 0;
  598|      0|            case OSSL_CMP_PKIBODY_IP:
  ------------------
  |  |  913|      0|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  |  Branch (598:13): [True: 0, False: 2]
  ------------------
  599|      0|            case OSSL_CMP_PKIBODY_CP:
  ------------------
  |  |  915|      0|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (599:13): [True: 0, False: 2]
  ------------------
  600|      0|            case OSSL_CMP_PKIBODY_KUP:
  ------------------
  |  |  920|      0|# define OSSL_CMP_PKIBODY_KUP       8
  ------------------
  |  Branch (600:13): [True: 0, False: 2]
  ------------------
  601|      1|            case OSSL_CMP_PKIBODY_CCP:
  ------------------
  |  |  926|      1|# define OSSL_CMP_PKIBODY_CCP      14
  ------------------
  |  Branch (601:13): [True: 1, False: 1]
  ------------------
  602|      1|                if (ctx->trusted != NULL) {
  ------------------
  |  Branch (602:21): [True: 0, False: 1]
  ------------------
  603|      0|                    STACK_OF(X509) *certs = msg->body->value.ip->caPubs;
  ------------------
  |  |   31|      0|# define STACK_OF(type) struct stack_st_##type
  ------------------
  604|       |                    /* value.ip is same for cp, kup, and ccp */
  605|       |
  606|      0|                    if (!ossl_cmp_X509_STORE_add1_certs(ctx->trusted, certs, 0))
  ------------------
  |  Branch (606:25): [True: 0, False: 0]
  ------------------
  607|       |                        /* adds both self-issued and not self-issued certs */
  608|      0|                        return 0;
  609|      0|                }
  610|      1|                break;
  611|      1|            default:
  ------------------
  |  Branch (611:13): [True: 1, False: 1]
  ------------------
  612|      1|                break;
  613|      2|            }
  614|      2|            ossl_cmp_debug(ctx,
  ------------------
  |  |  861|      2|# define ossl_cmp_debug(ctx, msg) ossl_cmp_log(DEBUG, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      2|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      2|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  615|      2|                           "successfully validated PBM-based CMP message protection");
  616|      2|            return 1;
  617|      2|        }
  618|    170|        ossl_cmp_warn(ctx, "verifying PBM-based CMP message protection failed");
  ------------------
  |  |  859|    170|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|    170|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    170|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    170|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|    170|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    170|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  619|    170|        break;
  620|       |
  621|       |        /*
  622|       |         * 5.1.3.2 DH Key Pairs
  623|       |         * Not yet supported
  624|       |         */
  625|      7|    case NID_id_DHBasedMac:
  ------------------
  |  |  525|      7|#define NID_id_DHBasedMac               783
  ------------------
  |  Branch (625:5): [True: 7, False: 1.20k]
  ------------------
  626|      7|        ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC);
  ------------------
  |  |  401|      7|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      7|    (ERR_new(),                                                 \
  |  |  |  |  404|      7|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      7|     ERR_set_error)
  |  |  ------------------
  ------------------
  627|      7|        break;
  628|       |
  629|       |        /*
  630|       |         * 5.1.3.3.  Signature
  631|       |         */
  632|    935|    default:
  ------------------
  |  Branch (632:5): [True: 935, False: 281]
  ------------------
  633|    935|        scrt = ctx->srvCert;
  634|    935|        if (scrt == NULL) {
  ------------------
  |  Branch (634:13): [True: 935, False: 0]
  ------------------
  635|    935|            if (ctx->trusted == NULL && ctx->secretValue != NULL) {
  ------------------
  |  Branch (635:17): [True: 935, False: 0]
  |  Branch (635:41): [True: 299, False: 636]
  ------------------
  636|    299|                ossl_cmp_info(ctx, "no trust store nor pinned server cert available for verifying signature-based CMP message protection");
  ------------------
  |  |  860|    299|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|    299|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    299|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    299|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|    299|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    299|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  637|    299|                ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_TRUST_ANCHOR);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    299|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    299|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    299|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    299|     ERR_set_error)
  |  |  ------------------
  ------------------
  638|    299|                return 0;
  639|    299|            }
  640|    636|            if (check_msg_find_cert(ctx, msg)) {
  ------------------
  |  Branch (640:17): [True: 0, False: 636]
  ------------------
  641|      0|                ossl_cmp_debug(ctx,
  ------------------
  |  |  861|      0|# define ossl_cmp_debug(ctx, msg) ossl_cmp_log(DEBUG, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  642|      0|                               "successfully validated signature-based CMP message protection using trust store");
  643|      0|                return 1;
  644|      0|            }
  645|    636|        } else { /* use pinned sender cert */
  646|       |            /* use ctx->srvCert for signature check even if not acceptable */
  647|      0|            if (verify_signature(ctx, msg, scrt)) {
  ------------------
  |  Branch (647:17): [True: 0, False: 0]
  ------------------
  648|      0|                ossl_cmp_debug(ctx,
  ------------------
  |  |  861|      0|# define ossl_cmp_debug(ctx, msg) ossl_cmp_log(DEBUG, ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|      0|                               "successfully validated signature-based CMP message protection using pinned server cert");
  650|      0|                return ossl_cmp_ctx_set1_validatedSrvCert(ctx, scrt);
  651|      0|            }
  652|      0|            ossl_cmp_warn(ctx, "CMP message signature verification failed");
  ------------------
  |  |  859|      0|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  654|      0|        }
  655|    636|        break;
  656|  1.21k|    }
  657|    813|    return 0;
  658|  1.21k|}
ossl_cmp_msg_check_update:
  705|  8.59k|{
  706|  8.59k|    OSSL_CMP_PKIHEADER *hdr;
  707|  8.59k|    const X509_NAME *expected_sender;
  708|  8.59k|    int num_untrusted, num_added, res;
  709|       |
  710|  8.59k|    if (!ossl_assert(ctx != NULL && msg != NULL && msg->header != NULL))
  ------------------
  |  |   52|  34.3k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 8.59k, False: 0]
  |  |  |  Branch (52:43): [True: 8.59k, False: 0]
  |  |  |  Branch (52:43): [True: 8.59k, False: 0]
  |  |  ------------------
  |  |   53|  8.59k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (710:9): [True: 0, False: 8.59k]
  ------------------
  711|      0|        return 0;
  712|  8.59k|    hdr = OSSL_CMP_MSG_get0_header(msg);
  713|       |
  714|       |    /* If expected_sender is given, validate sender name of received msg */
  715|  8.59k|    expected_sender = ctx->expected_sender;
  716|  8.59k|    if (expected_sender == NULL && ctx->srvCert != NULL)
  ------------------
  |  Branch (716:9): [True: 8.59k, False: 0]
  |  Branch (716:36): [True: 0, False: 8.59k]
  ------------------
  717|      0|        expected_sender = X509_get_subject_name(ctx->srvCert);
  718|  8.59k|    if (expected_sender != NULL) {
  ------------------
  |  Branch (718:9): [True: 0, False: 8.59k]
  ------------------
  719|      0|        const X509_NAME *actual_sender;
  720|      0|        char *str;
  721|       |
  722|      0|        if (hdr->sender->type != GEN_DIRNAME) {
  ------------------
  |  |  177|      0|# define GEN_DIRNAME     4
  ------------------
  |  Branch (722:13): [True: 0, False: 0]
  ------------------
  723|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  724|      0|            return 0;
  725|      0|        }
  726|      0|        actual_sender = hdr->sender->d.directoryName;
  727|       |        /*
  728|       |         * Compare actual sender name of response with expected sender name.
  729|       |         * Mitigates risk of accepting misused PBM secret or
  730|       |         * misused certificate of an unauthorized entity of a trusted hierarchy.
  731|       |         */
  732|      0|        if (!check_name(ctx, 0, "sender DN field", actual_sender,
  ------------------
  |  Branch (732:13): [True: 0, False: 0]
  ------------------
  733|      0|                        "expected sender", expected_sender)) {
  734|      0|            str = X509_NAME_oneline(actual_sender, NULL, 0);
  735|      0|            ERR_raise_data(ERR_LIB_CMP, CMP_R_UNEXPECTED_SENDER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CMP, CMP_R_UNEXPECTED_SENDER,
  ------------------
  |  |  119|      0|# define ERR_LIB_CMP             58
  ------------------
                          ERR_raise_data(ERR_LIB_CMP, CMP_R_UNEXPECTED_SENDER,
  ------------------
  |  |  115|      0|#  define CMP_R_UNEXPECTED_SENDER                          106
  ------------------
  736|      0|                           str != NULL ? str : "<unknown>");
  ------------------
  |  Branch (736:28): [True: 0, False: 0]
  ------------------
  737|      0|            OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  738|      0|            return 0;
  739|      0|        }
  740|      0|    }
  741|       |    /* Note: if recipient was NULL-DN it could be learned here if needed */
  742|       |
  743|  8.59k|    num_added = sk_X509_num(msg->extraCerts);
  ------------------
  |  |   79|  8.59k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  744|  8.59k|    if (num_added > 10)
  ------------------
  |  Branch (744:9): [True: 0, False: 8.59k]
  ------------------
  745|      0|        ossl_cmp_log1(WARN, ctx, "received CMP message contains %d extraCerts",
  ------------------
  |  |  844|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|      0|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  746|  8.59k|                      num_added);
  747|       |    /*
  748|       |     * Store any provided extraCerts in ctx for use in OSSL_CMP_validate_msg()
  749|       |     * and for future use, such that they are available to ctx->certConf_cb and
  750|       |     * the peer does not need to send them again in the same transaction.
  751|       |     * Note that it does not help validating the message before storing the
  752|       |     * extraCerts because they do not belong to the protected msg part anyway.
  753|       |     * The extraCerts are prepended. Allows simple removal if they shall not be
  754|       |     * cached. Also they get used first, which is likely good for efficiency.
  755|       |     */
  756|  8.59k|    num_untrusted = ctx->untrusted == NULL ? 0 : sk_X509_num(ctx->untrusted);
  ------------------
  |  |   79|  17.1k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (756:21): [True: 0, False: 8.59k]
  ------------------
  757|  8.59k|    res = ossl_x509_add_certs_new(&ctx->untrusted, msg->extraCerts,
  758|       |                                  /* this allows self-signed certs */
  759|  8.59k|                                  X509_ADD_FLAG_UP_REF | X509_ADD_FLAG_NO_DUP
  ------------------
  |  |  998|  8.59k|# define X509_ADD_FLAG_UP_REF   0x1
  ------------------
                                                X509_ADD_FLAG_UP_REF | X509_ADD_FLAG_NO_DUP
  ------------------
  |  | 1000|  8.59k|# define X509_ADD_FLAG_NO_DUP   0x4
  ------------------
  760|  8.59k|                                  | X509_ADD_FLAG_PREPEND);
  ------------------
  |  |  999|  8.59k|# define X509_ADD_FLAG_PREPEND  0x2
  ------------------
  761|  8.59k|    num_added = (ctx->untrusted == NULL ? 0 : sk_X509_num(ctx->untrusted))
  ------------------
  |  |   79|  8.59k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (761:18): [True: 0, False: 8.59k]
  ------------------
  762|  8.59k|        - num_untrusted;
  763|  8.59k|    if (!res) {
  ------------------
  |  Branch (763:9): [True: 0, False: 8.59k]
  ------------------
  764|      0|        while (num_added-- > 0)
  ------------------
  |  Branch (764:16): [True: 0, False: 0]
  ------------------
  765|      0|            X509_free(sk_X509_shift(ctx->untrusted));
  ------------------
  |  |   92|      0|#define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk)))
  ------------------
  766|      0|        return 0;
  767|      0|    }
  768|       |
  769|  8.59k|    if (hdr->protectionAlg != NULL)
  ------------------
  |  Branch (769:9): [True: 1.23k, False: 7.36k]
  ------------------
  770|  1.23k|        res = OSSL_CMP_validate_msg(ctx, msg)
  ------------------
  |  Branch (770:15): [True: 2, False: 1.23k]
  ------------------
  771|       |            /* explicitly permitted exceptions for invalid protection: */
  772|  1.23k|            || (cb != NULL && (*cb)(ctx, msg, 1, cb_arg) > 0);
  ------------------
  |  Branch (772:17): [True: 1.23k, False: 0]
  |  Branch (772:31): [True: 479, False: 752]
  ------------------
  773|  7.36k|    else
  774|       |        /* explicitly permitted exceptions for missing protection: */
  775|  7.36k|        res = cb != NULL && (*cb)(ctx, msg, 0, cb_arg) > 0;
  ------------------
  |  Branch (775:15): [True: 7.36k, False: 0]
  |  Branch (775:29): [True: 5.75k, False: 1.60k]
  ------------------
  776|  8.59k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  777|  8.59k|    res = 1; /* support more aggressive fuzzing by letting invalid msg pass */
  778|  8.59k|#endif
  779|       |
  780|       |    /* remove extraCerts again if not caching */
  781|  8.59k|    if (ctx->noCacheExtraCerts)
  ------------------
  |  Branch (781:9): [True: 0, False: 8.59k]
  ------------------
  782|      0|        while (num_added-- > 0)
  ------------------
  |  Branch (782:16): [True: 0, False: 0]
  ------------------
  783|      0|            X509_free(sk_X509_shift(ctx->untrusted));
  ------------------
  |  |   92|      0|#define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk)))
  ------------------
  784|       |
  785|  8.59k|    if (!res) {
  ------------------
  |  Branch (785:9): [True: 0, False: 8.59k]
  ------------------
  786|      0|        if (hdr->protectionAlg != NULL)
  ------------------
  |  Branch (786:13): [True: 0, False: 0]
  ------------------
  787|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_PROTECTION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  788|      0|        else
  789|      0|            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_PROTECTION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  790|      0|        return 0;
  791|      0|    }
  792|       |
  793|       |    /* check CMP version number in header */
  794|  8.59k|    if (ossl_cmp_hdr_get_pvno(hdr) != OSSL_CMP_PVNO_2
  ------------------
  |  |   38|  17.1k|#  define OSSL_CMP_PVNO_2 2
  ------------------
  |  Branch (794:9): [True: 7.52k, False: 1.07k]
  ------------------
  795|  8.59k|            && ossl_cmp_hdr_get_pvno(hdr) != OSSL_CMP_PVNO_3) {
  ------------------
  |  |   39|  7.52k|#  define OSSL_CMP_PVNO_3 3
  ------------------
  |  Branch (795:16): [True: 7.51k, False: 6]
  ------------------
  796|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  797|       |        ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_PVNO);
  798|       |        return 0;
  799|       |#endif
  800|  7.51k|    }
  801|       |
  802|  8.59k|    if (OSSL_CMP_MSG_get_bodytype(msg) < 0) {
  ------------------
  |  Branch (802:9): [True: 0, False: 8.59k]
  ------------------
  803|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  804|       |        ERR_raise(ERR_LIB_CMP, CMP_R_PKIBODY_ERROR);
  805|       |        return 0;
  806|       |#endif
  807|      0|    }
  808|       |
  809|       |    /* compare received transactionID with the expected one in previous msg */
  810|  8.59k|    if (!check_transactionID_or_nonce(ctx->transactionID, hdr->transactionID,
  ------------------
  |  Branch (810:9): [True: 0, False: 8.59k]
  ------------------
  811|  8.59k|                                      CMP_R_TRANSACTIONID_UNMATCHED))
  ------------------
  |  |  105|  8.59k|#  define CMP_R_TRANSACTIONID_UNMATCHED                    152
  ------------------
  812|      0|        return 0;
  813|       |
  814|       |    /*
  815|       |     * enable clearing irrelevant errors
  816|       |     * in attempts to validate recipient nonce in case of delayed delivery.
  817|       |     */
  818|  8.59k|    (void)ERR_set_mark();
  819|       |    /* compare received nonce with the one we sent */
  820|  8.59k|    if (!check_transactionID_or_nonce(ctx->senderNonce, hdr->recipNonce,
  ------------------
  |  Branch (820:9): [True: 0, False: 8.59k]
  ------------------
  821|  8.59k|                                      CMP_R_RECIPNONCE_UNMATCHED)) {
  ------------------
  |  |   99|  8.59k|#  define CMP_R_RECIPNONCE_UNMATCHED                       148
  ------------------
  822|       |        /* check if we are polling and received final response */
  823|      0|        if (ctx->first_senderNonce == NULL
  ------------------
  |  Branch (823:13): [True: 0, False: 0]
  ------------------
  824|      0|            || OSSL_CMP_MSG_get_bodytype(msg) == OSSL_CMP_PKIBODY_POLLREP
  ------------------
  |  |  938|      0|# define OSSL_CMP_PKIBODY_POLLREP  26
  ------------------
  |  Branch (824:16): [True: 0, False: 0]
  ------------------
  825|       |            /* compare received nonce with our sender nonce at poll start */
  826|      0|            || !check_transactionID_or_nonce(ctx->first_senderNonce,
  ------------------
  |  Branch (826:16): [True: 0, False: 0]
  ------------------
  827|      0|                                             hdr->recipNonce,
  828|      0|                                             CMP_R_RECIPNONCE_UNMATCHED)) {
  ------------------
  |  |   99|      0|#  define CMP_R_RECIPNONCE_UNMATCHED                       148
  ------------------
  829|      0|            (void)ERR_clear_last_mark();
  830|      0|            return 0;
  831|      0|        }
  832|      0|    }
  833|  8.59k|    (void)ERR_pop_to_mark();
  834|       |
  835|       |    /* if not yet present, learn transactionID */
  836|  8.59k|    if (ctx->transactionID == NULL
  ------------------
  |  Branch (836:9): [True: 8.59k, False: 0]
  ------------------
  837|  8.59k|        && !OSSL_CMP_CTX_set1_transactionID(ctx, hdr->transactionID))
  ------------------
  |  Branch (837:12): [True: 0, False: 8.59k]
  ------------------
  838|      0|        return 0;
  839|       |
  840|       |    /*
  841|       |     * RFC 4210 section 5.1.1 states: the recipNonce is copied from
  842|       |     * the senderNonce of the previous message in the transaction.
  843|       |     * --> Store for setting in next message
  844|       |     */
  845|  8.59k|    if (!ossl_cmp_ctx_set1_recipNonce(ctx, hdr->senderNonce))
  ------------------
  |  Branch (845:9): [True: 0, False: 8.59k]
  ------------------
  846|      0|        return 0;
  847|       |
  848|  8.59k|    if (ossl_cmp_hdr_get_protection_nid(hdr) == NID_id_PasswordBasedMAC) {
  ------------------
  |  |  520|  8.59k|#define NID_id_PasswordBasedMAC         782
  ------------------
  |  Branch (848:9): [True: 289, False: 8.31k]
  ------------------
  849|       |        /*
  850|       |         * RFC 4210, 5.3.2: 'Note that if the PKI Message Protection is
  851|       |         * "shared secret information", then any certificate transported in
  852|       |         * the caPubs field may be directly trusted as a root CA
  853|       |         * certificate by the initiator.'
  854|       |         */
  855|    289|        switch (OSSL_CMP_MSG_get_bodytype(msg)) {
  856|      1|        case OSSL_CMP_PKIBODY_IP:
  ------------------
  |  |  913|      1|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  |  Branch (856:9): [True: 1, False: 288]
  ------------------
  857|      6|        case OSSL_CMP_PKIBODY_CP:
  ------------------
  |  |  915|      6|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (857:9): [True: 5, False: 284]
  ------------------
  858|      7|        case OSSL_CMP_PKIBODY_KUP:
  ------------------
  |  |  920|      7|# define OSSL_CMP_PKIBODY_KUP       8
  ------------------
  |  Branch (858:9): [True: 1, False: 288]
  ------------------
  859|     13|        case OSSL_CMP_PKIBODY_CCP:
  ------------------
  |  |  926|     13|# define OSSL_CMP_PKIBODY_CCP      14
  ------------------
  |  Branch (859:9): [True: 6, False: 283]
  ------------------
  860|     13|            if (ctx->trusted != NULL) {
  ------------------
  |  Branch (860:17): [True: 0, False: 13]
  ------------------
  861|      0|                STACK_OF(X509) *certs = msg->body->value.ip->caPubs;
  ------------------
  |  |   31|      0|# define STACK_OF(type) struct stack_st_##type
  ------------------
  862|       |                /* value.ip is same for cp, kup, and ccp */
  863|       |
  864|      0|                if (!ossl_cmp_X509_STORE_add1_certs(ctx->trusted, certs, 0))
  ------------------
  |  Branch (864:21): [True: 0, False: 0]
  ------------------
  865|       |                    /* adds both self-issued and not self-issued certs */
  866|      0|                    return 0;
  867|      0|            }
  868|     13|            break;
  869|    276|        default:
  ------------------
  |  Branch (869:9): [True: 276, False: 13]
  ------------------
  870|    276|            break;
  871|    289|        }
  872|    289|    }
  873|  8.59k|    return 1;
  874|  8.59k|}
ossl_cmp_verify_popo:
  878|    897|{
  879|    897|    if (!ossl_assert(msg != NULL && msg->body != NULL))
  ------------------
  |  |   52|  1.79k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 897, False: 0]
  |  |  |  Branch (52:43): [True: 897, False: 0]
  |  |  ------------------
  |  |   53|    897|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (879:9): [True: 0, False: 897]
  ------------------
  880|      0|        return 0;
  881|    897|    switch (msg->body->type) {
  882|    604|    case OSSL_CMP_PKIBODY_P10CR:
  ------------------
  |  |  916|    604|# define OSSL_CMP_PKIBODY_P10CR     4
  ------------------
  |  Branch (882:5): [True: 604, False: 293]
  ------------------
  883|    604|        {
  884|    604|            X509_REQ *req = msg->body->value.p10cr;
  885|       |
  886|    604|            if (X509_REQ_verify_ex(req, X509_REQ_get0_pubkey(req), ctx->libctx,
  ------------------
  |  Branch (886:17): [True: 603, False: 1]
  ------------------
  887|    604|                                   ctx->propq) <= 0) {
  888|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  889|       |                ERR_raise(ERR_LIB_CMP, CMP_R_REQUEST_NOT_ACCEPTED);
  890|       |                return 0;
  891|       |#endif
  892|    603|            }
  893|    604|        }
  894|    604|        break;
  895|    118|    case OSSL_CMP_PKIBODY_IR:
  ------------------
  |  |  912|    118|# define OSSL_CMP_PKIBODY_IR        0
  ------------------
  |  Branch (895:5): [True: 118, False: 779]
  ------------------
  896|    142|    case OSSL_CMP_PKIBODY_CR:
  ------------------
  |  |  914|    142|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
  |  Branch (896:5): [True: 24, False: 873]
  ------------------
  897|    293|    case OSSL_CMP_PKIBODY_KUR:
  ------------------
  |  |  919|    293|# define OSSL_CMP_PKIBODY_KUR       7
  ------------------
  |  Branch (897:5): [True: 151, False: 746]
  ------------------
  898|    293|        if (!OSSL_CRMF_MSGS_verify_popo(msg->body->value.ir, OSSL_CMP_CERTREQID,
  ------------------
  |  |  941|    293|# define OSSL_CMP_CERTREQID         0
  ------------------
  |  Branch (898:13): [True: 283, False: 10]
  ------------------
  899|    293|                                        acceptRAVerified,
  900|    293|                                        ctx->libctx, ctx->propq)) {
  901|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  902|       |            return 0;
  903|       |#endif
  904|    283|        }
  905|    293|        break;
  906|      0|    default:
  ------------------
  |  Branch (906:5): [True: 0, False: 897]
  ------------------
  907|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_PKIBODY_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  908|      0|        return 0;
  909|    897|    }
  910|    897|    return 1;
  911|    897|}
cmp_vfy.c:verify_PBMAC:
   79|    172|{
   80|    172|    ASN1_BIT_STRING *protection = NULL;
   81|    172|    int valid = 0;
   82|       |
   83|       |    /* generate expected protection for the message */
   84|    172|    if ((protection = ossl_cmp_calc_protection(ctx, msg)) == NULL)
  ------------------
  |  Branch (84:9): [True: 112, False: 60]
  ------------------
   85|    112|        return 0; /* failed to generate protection string! */
   86|       |
   87|     60|    valid = msg->protection != NULL && msg->protection->length >= 0
  ------------------
  |  Branch (87:13): [True: 60, False: 0]
  |  Branch (87:40): [True: 60, False: 0]
  ------------------
   88|     60|            && msg->protection->type == protection->type
  ------------------
  |  Branch (88:16): [True: 60, False: 0]
  ------------------
   89|     60|            && msg->protection->length == protection->length
  ------------------
  |  Branch (89:16): [True: 31, False: 29]
  ------------------
   90|     60|            && CRYPTO_memcmp(msg->protection->data, protection->data,
  ------------------
  |  |  319|     31|#  define CRYPTO_memcmp memcmp
  ------------------
  |  Branch (90:16): [True: 2, False: 29]
  ------------------
   91|     31|                             protection->length) == 0;
   92|     60|    ASN1_BIT_STRING_free(protection);
   93|     60|    if (!valid)
  ------------------
  |  Branch (93:9): [True: 58, False: 2]
  ------------------
   94|     60|        ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_PBM_VALUE);
  ------------------
  |  |  401|     58|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     58|    (ERR_new(),                                                 \
  |  |  |  |  404|     58|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     58|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     58|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     58|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     58|     ERR_set_error)
  |  |  ------------------
  ------------------
   95|       |
   96|     60|    return valid;
   97|    172|}
cmp_vfy.c:check_msg_find_cert:
  463|    636|{
  464|    636|    X509 *scrt = ctx->validatedSrvCert; /* previous successful sender cert */
  465|    636|    GENERAL_NAME *sender = msg->header->sender;
  466|    636|    char *sname = NULL;
  467|    636|    char *skid_str = NULL;
  468|    636|    const ASN1_OCTET_STRING *skid = msg->header->senderKID;
  469|    636|    OSSL_CMP_log_cb_t backup_log_cb = ctx->log_cb;
  470|    636|    int res = 0;
  471|       |
  472|    636|    if (sender == NULL || msg->body == NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 636]
  |  Branch (472:27): [True: 0, False: 636]
  ------------------
  473|      0|        return 0; /* other NULL cases already have been checked */
  474|    636|    if (sender->type != GEN_DIRNAME) {
  ------------------
  |  |  177|    636|# define GEN_DIRNAME     4
  ------------------
  |  Branch (474:9): [True: 0, False: 636]
  ------------------
  475|       |        /* So far, only X509_NAME is supported */
  476|      0|        ERR_raise(ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|        return 0;
  478|      0|    }
  479|       |
  480|       |    /* dump any hitherto errors to avoid confusion when printing further ones */
  481|    636|    OSSL_CMP_CTX_print_errors(ctx);
  482|       |
  483|       |    /* enable clearing irrelevant errors in attempts to validate sender certs */
  484|    636|    (void)ERR_set_mark();
  485|    636|    ctx->log_cb = NULL; /* temporarily disable logging */
  486|       |
  487|       |    /*
  488|       |     * try first cached scrt, used successfully earlier in same transaction,
  489|       |     * for validating this and any further msgs where extraCerts may be left out
  490|       |     */
  491|    636|    if (scrt != NULL) {
  ------------------
  |  Branch (491:9): [True: 0, False: 636]
  ------------------
  492|      0|        if (check_msg_given_cert(ctx, scrt, msg)) {
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            ctx->log_cb = backup_log_cb;
  494|      0|            (void)ERR_pop_to_mark();
  495|      0|            return 1;
  496|      0|        }
  497|       |        /* cached sender cert has shown to be no more successfully usable */
  498|      0|        (void)ossl_cmp_ctx_set1_validatedSrvCert(ctx, NULL);
  499|       |        /* re-do the above check (just) for adding diagnostic information */
  500|      0|        ossl_cmp_info(ctx,
  ------------------
  |  |  860|      0|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  501|      0|                      "trying to verify msg signature with previously validated cert");
  502|      0|        (void)check_msg_given_cert(ctx, scrt, msg);
  503|      0|    }
  504|       |
  505|    636|    res = check_msg_all_certs(ctx, msg, 0 /* using ctx->trusted */)
  ------------------
  |  Branch (505:11): [True: 0, False: 636]
  ------------------
  506|    636|            || check_msg_all_certs(ctx, msg, 1 /* 3gpp */);
  ------------------
  |  Branch (506:16): [True: 0, False: 636]
  ------------------
  507|    636|    ctx->log_cb = backup_log_cb;
  508|    636|    if (res) {
  ------------------
  |  Branch (508:9): [True: 0, False: 636]
  ------------------
  509|       |        /* discard any diagnostic information on trying to use certs */
  510|      0|        (void)ERR_pop_to_mark();
  511|      0|        goto end;
  512|      0|    }
  513|       |    /* failed finding a sender cert that verifies the message signature */
  514|    636|    (void)ERR_clear_last_mark();
  515|       |
  516|    636|    sname = X509_NAME_oneline(sender->d.directoryName, NULL, 0);
  517|    636|    skid_str = skid == NULL ? NULL : i2s_ASN1_OCTET_STRING(NULL, skid);
  ------------------
  |  Branch (517:16): [True: 341, False: 295]
  ------------------
  518|    636|    if (ctx->log_cb != NULL) {
  ------------------
  |  Branch (518:9): [True: 636, False: 0]
  ------------------
  519|    636|        ossl_cmp_info(ctx, "trying to verify msg signature with a valid cert that..");
  ------------------
  |  |  860|    636|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|    636|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    636|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    636|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|    636|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    636|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|    636|        if (sname != NULL)
  ------------------
  |  Branch (520:13): [True: 636, False: 0]
  ------------------
  521|    636|            ossl_cmp_log1(INFO, ctx, "matches msg sender    = %s", sname);
  ------------------
  |  |  844|    636|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|    636|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|    636|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|    636|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|    636|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  522|    636|        if (skid_str != NULL)
  ------------------
  |  Branch (522:13): [True: 295, False: 341]
  ------------------
  523|    295|            ossl_cmp_log1(INFO, ctx, "matches msg senderKID = %s", skid_str);
  ------------------
  |  |  844|    295|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|    295|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|    295|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|    295|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|    295|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  524|    341|        else
  525|    636|            ossl_cmp_info(ctx, "while msg header does not contain senderKID");
  ------------------
  |  |  860|    341|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|    341|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    341|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    341|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|    341|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    341|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  526|       |        /* re-do the above checks (just) for adding diagnostic information */
  527|    636|        (void)check_msg_all_certs(ctx, msg, 0 /* using ctx->trusted */);
  528|    636|        (void)check_msg_all_certs(ctx, msg, 1 /* 3gpp */);
  529|    636|    }
  530|       |
  531|    636|    ERR_raise(ERR_LIB_CMP, CMP_R_NO_SUITABLE_SENDER_CERT);
  ------------------
  |  |  401|    636|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    636|    (ERR_new(),                                                 \
  |  |  |  |  404|    636|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    636|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    636|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    636|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    636|     ERR_set_error)
  |  |  ------------------
  ------------------
  532|    636|    if (sname != NULL) {
  ------------------
  |  Branch (532:9): [True: 636, False: 0]
  ------------------
  533|    636|        ERR_add_error_txt(NULL, "for msg sender name = ");
  534|    636|        ERR_add_error_txt(NULL, sname);
  535|    636|    }
  536|    636|    if (skid_str != NULL) {
  ------------------
  |  Branch (536:9): [True: 295, False: 341]
  ------------------
  537|    295|        ERR_add_error_txt(" and ", "for msg senderKID = ");
  538|    295|        ERR_add_error_txt(NULL, skid_str);
  539|    295|    }
  540|       |
  541|    636| end:
  542|    636|    OPENSSL_free(sname);
  ------------------
  |  |  115|    636|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    636|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    636|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  543|    636|    OPENSSL_free(skid_str);
  ------------------
  |  |  115|    636|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    636|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    636|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  544|    636|    return res;
  545|    636|}
cmp_vfy.c:cert_acceptable:
  249|  5.18k|{
  250|  5.18k|    X509_STORE *ts = ctx->trusted;
  251|  5.18k|    int self_issued = X509_check_issued(cert, cert) == X509_V_OK;
  ------------------
  |  |  303|  5.18k|# define X509_V_OK                                       0
  ------------------
  252|  5.18k|    char *str;
  253|  5.18k|    X509_VERIFY_PARAM *vpm = ts != NULL ? X509_STORE_get0_param(ts) : NULL;
  ------------------
  |  Branch (253:30): [True: 0, False: 5.18k]
  ------------------
  254|  5.18k|    int time_cmp;
  255|       |
  256|  5.18k|    ossl_cmp_log3(INFO, ctx, " considering %s%s %s with..",
  ------------------
  |  |  850|  5.18k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  5.18k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  5.18k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  851|  10.3k|                       OPENSSL_LINE, #level, fmt, arg1, arg2, arg3)
  |  |  ------------------
  |  |  |  |  303|  5.18k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (851:51): [True: 444, False: 4.74k]
  |  |  ------------------
  ------------------
  257|  5.18k|                  self_issued ? "self-issued ": "", desc1, desc2);
  258|  5.18k|    if ((str = X509_NAME_oneline(X509_get_subject_name(cert), NULL, 0)) != NULL)
  ------------------
  |  Branch (258:9): [True: 5.18k, False: 0]
  ------------------
  259|  5.18k|        ossl_cmp_log1(INFO, ctx, "  subject = %s", str);
  ------------------
  |  |  844|  5.18k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  5.18k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  5.18k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|  5.18k|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|  5.18k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  260|  5.18k|    OPENSSL_free(str);
  ------------------
  |  |  115|  5.18k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.18k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.18k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  5.18k|    if (!self_issued) {
  ------------------
  |  Branch (261:9): [True: 4.74k, False: 444]
  ------------------
  262|  4.74k|        str = X509_NAME_oneline(X509_get_issuer_name(cert), NULL, 0);
  263|  4.74k|        if (str != NULL)
  ------------------
  |  Branch (263:13): [True: 4.74k, False: 0]
  ------------------
  264|  4.74k|            ossl_cmp_log1(INFO, ctx, "  issuer  = %s", str);
  ------------------
  |  |  844|  4.74k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  4.74k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  4.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|  4.74k|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|  4.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  265|  4.74k|        OPENSSL_free(str);
  ------------------
  |  |  115|  4.74k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|  4.74k|    }
  267|       |
  268|  5.18k|    if (already_checked(cert, already_checked1)
  ------------------
  |  Branch (268:9): [True: 2.59k, False: 2.59k]
  ------------------
  269|  5.18k|            || already_checked(cert, already_checked2)) {
  ------------------
  |  Branch (269:16): [True: 0, False: 2.59k]
  ------------------
  270|  2.59k|        ossl_cmp_info(ctx, " cert has already been checked");
  ------------------
  |  |  860|  2.59k|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|  2.59k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.59k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.59k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|  2.59k|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.59k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|  2.59k|        return 0;
  272|  2.59k|    }
  273|       |
  274|  2.59k|    time_cmp = X509_cmp_timeframe(vpm, X509_get0_notBefore(cert),
  275|  2.59k|                                  X509_get0_notAfter(cert));
  276|  2.59k|    if (time_cmp != 0) {
  ------------------
  |  Branch (276:9): [True: 1.17k, False: 1.41k]
  ------------------
  277|  1.17k|        int err = time_cmp > 0 ? X509_V_ERR_CERT_HAS_EXPIRED
  ------------------
  |  |  313|  1.03k|# define X509_V_ERR_CERT_HAS_EXPIRED                     10
  ------------------
  |  Branch (277:19): [True: 1.03k, False: 144]
  ------------------
  278|  1.17k|                               : X509_V_ERR_CERT_NOT_YET_VALID;
  ------------------
  |  |  312|    144|# define X509_V_ERR_CERT_NOT_YET_VALID                   9
  ------------------
  279|       |
  280|  1.17k|        ossl_cmp_warn(ctx, time_cmp > 0 ? "cert has expired"
  ------------------
  |  |  859|  1.17k|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|  1.17k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.17k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.17k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|  2.35k|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.17k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (842:52): [True: 1.03k, False: 144]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  1.17k|                                        : "cert is not yet valid");
  282|  1.17k|        if (ctx->log_cb != NULL /* logging not temporarily disabled */
  ------------------
  |  Branch (282:13): [True: 589, False: 589]
  ------------------
  283|  1.17k|                && verify_cb_cert(ts, cert, err) <= 0)
  ------------------
  |  Branch (283:20): [True: 589, False: 0]
  ------------------
  284|    589|            return 0;
  285|  1.17k|    }
  286|       |
  287|  2.00k|    if (!check_name(ctx, 1,
  ------------------
  |  Branch (287:9): [True: 1.15k, False: 853]
  ------------------
  288|  2.00k|                    "cert subject", X509_get_subject_name(cert),
  289|  2.00k|                    "sender field", msg->header->sender->d.directoryName))
  290|  1.15k|        return 0;
  291|       |
  292|    853|    if (!check_kid(ctx, X509_get0_subject_key_id(cert), msg->header->senderKID))
  ------------------
  |  Branch (292:9): [True: 56, False: 797]
  ------------------
  293|     56|        return 0;
  294|       |    /* prevent misleading error later in case x509v3_cache_extensions() fails */
  295|    797|    if (!ossl_x509v3_cache_extensions(cert)) {
  ------------------
  |  Branch (295:9): [True: 42, False: 755]
  ------------------
  296|     42|        ossl_cmp_warn(ctx, "cert appears to be invalid");
  ------------------
  |  |  859|     42|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|     42|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     42|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     42|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|     42|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     42|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  297|     42|        return 0;
  298|     42|    }
  299|    755|    if (!verify_signature(ctx, msg, cert)) {
  ------------------
  |  Branch (299:9): [True: 742, False: 13]
  ------------------
  300|    742|        ossl_cmp_warn(ctx, "msg signature verification failed");
  ------------------
  |  |  859|    742|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|    742|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    742|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    742|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|    742|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    742|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  301|    742|        return 0;
  302|    742|    }
  303|       |    /* acceptable also if there is no senderKID in msg header */
  304|     13|    ossl_cmp_info(ctx, " cert seems acceptable");
  ------------------
  |  |  860|     13|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|     13|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|     13|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|     13|    return 1;
  306|    755|}
cmp_vfy.c:already_checked:
  227|  7.77k|{
  228|  7.77k|    int i;
  229|       |
  230|  11.9k|    for (i = sk_X509_num(already_checked /* may be NULL */); i > 0; i--)
  ------------------
  |  |   79|  7.77k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (230:62): [True: 6.78k, False: 5.18k]
  ------------------
  231|  6.78k|        if (X509_cmp(sk_X509_value(already_checked, i - 1), cert) == 0)
  ------------------
  |  |   80|  6.78k|#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
  ------------------
  |  Branch (231:13): [True: 2.59k, False: 4.18k]
  ------------------
  232|  2.59k|            return 1;
  233|  5.18k|    return 0;
  234|  7.77k|}
cmp_vfy.c:verify_cb_cert:
  143|    589|{
  144|    589|    X509_STORE_CTX_verify_cb verify_cb;
  145|    589|    X509_STORE_CTX *csc;
  146|    589|    int ok = 0;
  147|       |
  148|    589|    if (ts == NULL || (verify_cb = X509_STORE_get_verify_cb(ts)) == NULL)
  ------------------
  |  Branch (148:9): [True: 589, False: 0]
  |  Branch (148:23): [True: 0, False: 0]
  ------------------
  149|    589|        return ok;
  150|      0|    if ((csc = X509_STORE_CTX_new()) != NULL
  ------------------
  |  Branch (150:9): [True: 0, False: 0]
  ------------------
  151|      0|            && X509_STORE_CTX_init(csc, ts, cert, NULL)) {
  ------------------
  |  Branch (151:16): [True: 0, False: 0]
  ------------------
  152|      0|        X509_STORE_CTX_set_error(csc, err);
  153|      0|        X509_STORE_CTX_set_current_cert(csc, cert);
  154|      0|        ok = (*verify_cb)(0, csc);
  155|      0|    }
  156|      0|    X509_STORE_CTX_free(csc);
  157|      0|    return ok;
  158|    589|}
cmp_vfy.c:check_kid:
  197|    853|{
  198|    853|    char *str;
  199|       |
  200|    853|    if (skid == NULL)
  ------------------
  |  Branch (200:9): [True: 484, False: 369]
  ------------------
  201|    484|        return 1; /* no expectation, thus trivially fulfilled */
  202|       |
  203|       |    /* make sure that the expected subject key identifier is there */
  204|    369|    if (ckid == NULL) {
  ------------------
  |  Branch (204:9): [True: 28, False: 341]
  ------------------
  205|     28|        ossl_cmp_warn(ctx, "missing Subject Key Identifier in certificate");
  ------------------
  |  |  859|     28|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|     28|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     28|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|     28|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|     28|        return 0;
  207|     28|    }
  208|    341|    str = i2s_ASN1_OCTET_STRING(NULL, ckid);
  209|    341|    if (ASN1_OCTET_STRING_cmp(ckid, skid) == 0) {
  ------------------
  |  Branch (209:9): [True: 313, False: 28]
  ------------------
  210|    313|        if (str != NULL)
  ------------------
  |  Branch (210:13): [True: 313, False: 0]
  ------------------
  211|    313|            ossl_cmp_log1(INFO, ctx, " subjectKID matches senderKID: %s", str);
  ------------------
  |  |  844|    313|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|    313|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|    313|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|    313|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|    313|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|    313|        OPENSSL_free(str);
  ------------------
  |  |  115|    313|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    313|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    313|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|    313|        return 1;
  214|    313|    }
  215|       |
  216|     28|    if (str != NULL)
  ------------------
  |  Branch (216:9): [True: 28, False: 0]
  ------------------
  217|     28|        ossl_cmp_log1(INFO, ctx, " cert Subject Key Identifier = %s", str);
  ------------------
  |  |  844|     28|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|     28|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|     28|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  218|     28|    OPENSSL_free(str);
  ------------------
  |  |  115|     28|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     28|    if ((str = i2s_ASN1_OCTET_STRING(NULL, skid)) != NULL)
  ------------------
  |  Branch (219:9): [True: 28, False: 0]
  ------------------
  220|     28|        ossl_cmp_log1(INFO, ctx, " does not match senderKID    = %s", str);
  ------------------
  |  |  844|     28|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|     28|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|     28|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  221|     28|    OPENSSL_free(str);
  ------------------
  |  |  115|     28|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  222|     28|    return 0;
  223|    341|}
cmp_vfy.c:check_cert_path:
  310|     13|{
  311|     13|    if (OSSL_CMP_validate_cert_path(ctx, store, scrt))
  ------------------
  |  Branch (311:9): [True: 0, False: 13]
  ------------------
  312|      0|        return 1;
  313|       |
  314|     13|    ossl_cmp_warn(ctx,
  ------------------
  |  |  859|     13|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|     13|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|     13|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|     13|                  "msg signature validates but cert path validation failed");
  316|     13|    return 0;
  317|     13|}
cmp_vfy.c:check_msg_all_certs:
  424|  2.54k|{
  425|  2.54k|    int ret = 0;
  426|       |
  427|  2.54k|    if (ctx->permitTAInExtraCertsForIR
  ------------------
  |  Branch (427:9): [True: 0, False: 2.54k]
  ------------------
  428|  2.54k|            && OSSL_CMP_MSG_get_bodytype(msg) == OSSL_CMP_PKIBODY_IP)
  ------------------
  |  |  913|      0|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  |  Branch (428:16): [True: 0, False: 0]
  ------------------
  429|  2.54k|        ossl_cmp_info(ctx, mode_3gpp ?
  ------------------
  |  |  860|      0|# define ossl_cmp_info(ctx, msg)  ossl_cmp_log(INFO,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|      0|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (842:52): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|  2.54k|                      "normal mode failed; trying now 3GPP mode trusting extraCerts"
  431|  2.54k|                      : "trying first normal mode using trust store");
  432|  2.54k|    else if (mode_3gpp)
  ------------------
  |  Branch (432:14): [True: 1.27k, False: 1.27k]
  ------------------
  433|  1.27k|        return 0;
  434|       |
  435|  1.27k|    if (check_msg_with_certs(ctx, msg->extraCerts, "extraCerts",
  ------------------
  |  Branch (435:9): [True: 0, False: 1.27k]
  ------------------
  436|  1.27k|                             NULL, NULL, msg, mode_3gpp))
  437|      0|        return 1;
  438|  1.27k|    if (check_msg_with_certs(ctx, ctx->untrusted, "untrusted certs",
  ------------------
  |  Branch (438:9): [True: 0, False: 1.27k]
  ------------------
  439|  1.27k|                             msg->extraCerts, NULL, msg, mode_3gpp))
  440|      0|        return 1;
  441|       |
  442|  1.27k|    if (ctx->trusted == NULL) {
  ------------------
  |  Branch (442:9): [True: 1.27k, False: 0]
  ------------------
  443|  1.27k|        ossl_cmp_warn(ctx, mode_3gpp ? "no self-issued extraCerts"
  ------------------
  |  |  859|  1.27k|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|  1.27k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.27k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.27k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|  2.54k|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.27k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (842:52): [True: 0, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  444|  1.27k|                                     : "no trusted store");
  445|  1.27k|    } else {
  446|      0|        STACK_OF(X509) *trusted = X509_STORE_get1_all_certs(ctx->trusted);
  ------------------
  |  |   31|      0|# define STACK_OF(type) struct stack_st_##type
  ------------------
  447|       |
  448|      0|        ret = check_msg_with_certs(ctx, trusted,
  449|      0|                                   mode_3gpp ? "self-issued extraCerts"
  ------------------
  |  Branch (449:36): [True: 0, False: 0]
  ------------------
  450|      0|                                             : "certs in trusted store",
  451|      0|                                   msg->extraCerts, ctx->untrusted,
  452|      0|                                   msg, mode_3gpp);
  453|      0|        OSSL_STACK_OF_X509_free(trusted);
  454|      0|    }
  455|  1.27k|    return ret;
  456|  1.27k|}
cmp_vfy.c:check_msg_with_certs:
  387|  2.54k|{
  388|  2.54k|    int in_extraCerts = already_checked1 == NULL;
  389|  2.54k|    int n_acceptable_certs = 0;
  390|  2.54k|    int i;
  391|       |
  392|  2.54k|    if (sk_X509_num(certs) <= 0) {
  ------------------
  |  |   79|  2.54k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (392:9): [True: 156, False: 2.38k]
  ------------------
  393|    156|        ossl_cmp_log1(WARN, ctx, "no %s", desc);
  ------------------
  |  |  844|    156|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|    156|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|    156|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|    156|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|    156|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  394|    156|        return 0;
  395|    156|    }
  396|       |
  397|  7.57k|    for (i = 0; i < sk_X509_num(certs); i++) { /* certs may be NULL */
  ------------------
  |  |   79|  7.57k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (397:17): [True: 5.18k, False: 2.38k]
  ------------------
  398|  5.18k|        X509 *cert = sk_X509_value(certs, i);
  ------------------
  |  |   80|  5.18k|#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
  ------------------
  399|       |
  400|  5.18k|        if (!ossl_assert(cert != NULL))
  ------------------
  |  |   52|  5.18k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  5.18k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (400:13): [True: 0, False: 5.18k]
  ------------------
  401|      0|            return 0;
  402|  5.18k|        if (!cert_acceptable(ctx, "cert from", desc, cert,
  ------------------
  |  Branch (402:13): [True: 5.17k, False: 13]
  ------------------
  403|  5.18k|                             already_checked1, already_checked2, msg))
  404|  5.17k|            continue;
  405|     13|        n_acceptable_certs++;
  406|     13|        if (mode_3gpp ? check_cert_path_3gpp(ctx, msg, cert)
  ------------------
  |  Branch (406:13): [True: 0, False: 13]
  |  Branch (406:13): [True: 0, False: 13]
  ------------------
  407|     13|                      : check_cert_path(ctx, ctx->trusted, cert)) {
  408|       |            /* store successful sender cert for further msgs in transaction */
  409|      0|            return ossl_cmp_ctx_set1_validatedSrvCert(ctx, cert);
  410|      0|        }
  411|     13|    }
  412|  2.38k|    if (in_extraCerts && n_acceptable_certs == 0)
  ------------------
  |  Branch (412:9): [True: 1.19k, False: 1.19k]
  |  Branch (412:26): [True: 1.18k, False: 13]
  ------------------
  413|  2.38k|        ossl_cmp_warn(ctx, "no acceptable cert in extraCerts");
  ------------------
  |  |  859|  1.18k|# define ossl_cmp_warn(ctx, msg)  ossl_cmp_log(WARN,  ctx, msg)
  |  |  ------------------
  |  |  |  |  841|  1.18k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.18k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.18k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |  842|  1.18k|                       OPENSSL_LINE, #level, "%s", msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.18k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  414|  2.38k|    return 0;
  415|  2.38k|}
cmp_vfy.c:verify_signature:
   27|    755|{
   28|    755|    OSSL_CMP_PROTECTEDPART prot_part;
   29|    755|    EVP_PKEY *pubkey = NULL;
   30|    755|    BIO *bio;
   31|    755|    int res = 0;
   32|       |
   33|    755|    if (!ossl_assert(cmp_ctx != NULL && msg != NULL && cert != NULL))
  ------------------
  |  |   52|  3.02k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 755, False: 0]
  |  |  |  Branch (52:43): [True: 755, False: 0]
  |  |  |  Branch (52:43): [True: 755, False: 0]
  |  |  ------------------
  |  |   53|    755|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (33:9): [True: 0, False: 755]
  ------------------
   34|      0|        return 0;
   35|       |
   36|    755|    bio = BIO_new(BIO_s_mem()); /* may be NULL */
   37|    755|    if (bio == NULL)
  ------------------
  |  Branch (37:9): [True: 0, False: 755]
  ------------------
   38|      0|        return 0;
   39|       |    /* verify that keyUsage, if present, contains digitalSignature */
   40|    755|    if (!cmp_ctx->ignore_keyusage
  ------------------
  |  Branch (40:9): [True: 755, False: 0]
  ------------------
   41|    755|            && (X509_get_key_usage(cert) & X509v3_KU_DIGITAL_SIGNATURE) == 0) {
  ------------------
  |  |  174|    755|# define X509v3_KU_DIGITAL_SIGNATURE     0x0080     /* (0) */
  ------------------
  |  Branch (41:16): [True: 108, False: 647]
  ------------------
   42|    108|        ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE);
  ------------------
  |  |  401|    108|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    108|    (ERR_new(),                                                 \
  |  |  |  |  404|    108|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    108|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    108|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    108|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    108|     ERR_set_error)
  |  |  ------------------
  ------------------
   43|    108|        goto sig_err;
   44|    108|    }
   45|       |
   46|    647|    pubkey = X509_get_pubkey(cert);
   47|    647|    if (pubkey == NULL) {
  ------------------
  |  Branch (47:9): [True: 385, False: 262]
  ------------------
   48|    385|        ERR_raise(ERR_LIB_CMP, CMP_R_FAILED_EXTRACTING_PUBKEY);
  ------------------
  |  |  401|    385|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    385|    (ERR_new(),                                                 \
  |  |  |  |  404|    385|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    385|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    385|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    385|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    385|     ERR_set_error)
  |  |  ------------------
  ------------------
   49|    385|        goto sig_err;
   50|    385|    }
   51|       |
   52|    262|    prot_part.header = msg->header;
   53|    262|    prot_part.body = msg->body;
   54|       |
   55|    262|    if (ASN1_item_verify_ex(ASN1_ITEM_rptr(OSSL_CMP_PROTECTEDPART),
  ------------------
  |  |  427|    262|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  |  Branch (55:9): [True: 13, False: 249]
  ------------------
   56|    262|                            msg->header->protectionAlg, msg->protection,
   57|    262|                            &prot_part, NULL, pubkey, cmp_ctx->libctx,
   58|    262|                            cmp_ctx->propq) > 0) {
   59|     13|        res = 1;
   60|     13|        goto end;
   61|     13|    }
   62|       |
   63|    742| sig_err:
   64|    742|    res = ossl_x509_print_ex_brief(bio, cert, X509_FLAG_NO_EXTENSIONS);
  ------------------
  |  |  306|    742|# define X509_FLAG_NO_EXTENSIONS         (1L << 8)
  ------------------
   65|    742|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_SIGNATURE);
  ------------------
  |  |  401|    742|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    742|    (ERR_new(),                                                 \
  |  |  |  |  404|    742|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    742|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    742|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    742|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    742|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|    742|    if (res)
  ------------------
  |  Branch (66:9): [True: 742, False: 0]
  ------------------
   67|    742|        ERR_add_error_mem_bio("\n", bio);
   68|    742|    res = 0;
   69|       |
   70|    755| end:
   71|    755|    EVP_PKEY_free(pubkey);
   72|    755|    BIO_free(bio);
   73|       |
   74|    755|    return res;
   75|    742|}
cmp_vfy.c:check_name:
  164|  2.00k|{
  165|  2.00k|    char *str;
  166|       |
  167|  2.00k|    if (expect_name == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 2.00k]
  ------------------
  168|      0|        return 1; /* no expectation, thus trivially fulfilled */
  169|       |
  170|       |    /* make sure that a matching name is there */
  171|  2.00k|    if (actual_name == NULL) {
  ------------------
  |  Branch (171:9): [True: 0, False: 2.00k]
  ------------------
  172|      0|        ossl_cmp_log1(WARN, ctx, "missing %s", actual_desc);
  ------------------
  |  |  844|      0|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  845|      0|                       OPENSSL_LINE, #level, fmt, arg1)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|      0|        return 0;
  174|      0|    }
  175|  2.00k|    str = X509_NAME_oneline(actual_name, NULL, 0);
  176|  2.00k|    if (X509_NAME_cmp(actual_name, expect_name) == 0) {
  ------------------
  |  Branch (176:9): [True: 853, False: 1.15k]
  ------------------
  177|    853|        if (log_success && str != NULL)
  ------------------
  |  Branch (177:13): [True: 853, False: 0]
  |  Branch (177:28): [True: 853, False: 0]
  ------------------
  178|    853|            ossl_cmp_log3(INFO, ctx, " %s matches %s: %s",
  ------------------
  |  |  850|    853|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|    853|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|    853|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  851|    853|                       OPENSSL_LINE, #level, fmt, arg1, arg2, arg3)
  |  |  ------------------
  |  |  |  |  303|    853|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  179|    853|                          actual_desc, expect_desc, str);
  180|    853|        OPENSSL_free(str);
  ------------------
  |  |  115|    853|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    853|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    853|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  181|    853|        return 1;
  182|    853|    }
  183|       |
  184|  1.15k|    if (str != NULL)
  ------------------
  |  Branch (184:9): [True: 1.15k, False: 0]
  ------------------
  185|  1.15k|        ossl_cmp_log2(INFO, ctx, " actual name in %s = %s", actual_desc, str);
  ------------------
  |  |  847|  1.15k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  1.15k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  848|  1.15k|                       OPENSSL_LINE, #level, fmt, arg1, arg2)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  186|  1.15k|    OPENSSL_free(str);
  ------------------
  |  |  115|  1.15k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  187|  1.15k|    if ((str = X509_NAME_oneline(expect_name, NULL, 0)) != NULL)
  ------------------
  |  Branch (187:9): [True: 1.15k, False: 0]
  ------------------
  188|  1.15k|        ossl_cmp_log2(INFO, ctx, " does not match %s = %s", expect_desc, str);
  ------------------
  |  |  847|  1.15k|    ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  323|  1.15k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |                   ossl_cmp_print_log(OSSL_CMP_LOG_##level, ctx, OPENSSL_FUNC, OPENSSL_FILE, \
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |  848|  1.15k|                       OPENSSL_LINE, #level, fmt, arg1, arg2)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  189|  1.15k|    OPENSSL_free(str);
  ------------------
  |  |  115|  1.15k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  190|  1.15k|    return 0;
  191|  2.00k|}
cmp_vfy.c:check_transactionID_or_nonce:
  662|  17.1k|{
  663|  17.1k|    if (expected != NULL
  ------------------
  |  Branch (663:9): [True: 0, False: 17.1k]
  ------------------
  664|  17.1k|        && (actual == NULL || ASN1_OCTET_STRING_cmp(expected, actual) != 0)) {
  ------------------
  |  Branch (664:13): [True: 0, False: 0]
  |  Branch (664:31): [True: 0, False: 0]
  ------------------
  665|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  666|       |        char *expected_str, *actual_str;
  667|       |
  668|       |        expected_str = i2s_ASN1_OCTET_STRING(NULL, expected);
  669|       |        actual_str = actual == NULL ? NULL: i2s_ASN1_OCTET_STRING(NULL, actual);
  670|       |        ERR_raise_data(ERR_LIB_CMP, reason,
  671|       |                       "expected = %s, actual = %s",
  672|       |                       expected_str == NULL ? "?" : expected_str,
  673|       |                       actual == NULL ? "(none)" :
  674|       |                       actual_str == NULL ? "?" : actual_str);
  675|       |        OPENSSL_free(expected_str);
  676|       |        OPENSSL_free(actual_str);
  677|       |        return 0;
  678|       |#endif
  679|      0|    }
  680|  17.1k|    return 1;
  681|  17.1k|}

cms_asn1.c:cms_ec_cb:
   96|    157|{
   97|    157|    CMS_EncryptedContentInfo *ec = (CMS_EncryptedContentInfo *)*pval;
   98|       |
   99|    157|    if (operation == ASN1_OP_FREE_POST)
  ------------------
  |  |  745|    157|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (99:9): [True: 39, False: 118]
  ------------------
  100|     39|        OPENSSL_clear_free(ec->key, ec->keylen);
  ------------------
  |  |  113|     39|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     39|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     39|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|    157|    return 1;
  102|    157|}
cms_asn1.c:cms_kari_cb:
  161|      5|{
  162|      5|    CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval;
  163|      5|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|      5|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (163:9): [True: 1, False: 4]
  ------------------
  164|      1|        kari->ctx = EVP_CIPHER_CTX_new();
  165|      1|        if (kari->ctx == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 1]
  ------------------
  166|      0|            return 0;
  167|      1|        EVP_CIPHER_CTX_set_flags(kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
  ------------------
  |  |  386|      1|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  168|      1|        kari->pctx = NULL;
  169|      4|    } else if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|      4|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (169:16): [True: 1, False: 3]
  ------------------
  170|      1|        EVP_PKEY_CTX_free(kari->pctx);
  171|      1|        EVP_CIPHER_CTX_free(kari->ctx);
  172|      1|    }
  173|      5|    return 1;
  174|      5|}
cms_asn1.c:cms_ri_cb:
  212|     40|{
  213|     40|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|     40|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (213:9): [True: 8, False: 32]
  ------------------
  214|      8|        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
  215|      8|        if (ri->type == CMS_RECIPINFO_TRANS) {
  ------------------
  |  |  166|      8|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (215:13): [True: 0, False: 8]
  ------------------
  216|      0|            CMS_KeyTransRecipientInfo *ktri = ri->d.ktri;
  217|      0|            EVP_PKEY_free(ktri->pkey);
  218|      0|            X509_free(ktri->recip);
  219|      0|            EVP_PKEY_CTX_free(ktri->pctx);
  220|      8|        } else if (ri->type == CMS_RECIPINFO_KEK) {
  ------------------
  |  |  168|      8|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (220:20): [True: 0, False: 8]
  ------------------
  221|      0|            CMS_KEKRecipientInfo *kekri = ri->d.kekri;
  222|      0|            OPENSSL_clear_free(kekri->key, kekri->keylen);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|      8|        } else if (ri->type == CMS_RECIPINFO_PASS) {
  ------------------
  |  |  169|      8|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (223:20): [True: 0, False: 8]
  ------------------
  224|      0|            CMS_PasswordRecipientInfo *pwri = ri->d.pwri;
  225|      0|            OPENSSL_clear_free(pwri->pass, pwri->passlen);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|      0|        }
  227|      8|    }
  228|     40|    return 1;
  229|     40|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

OSSL_CRMF_MSG_set1_regCtrl_oldCertID:
   66|     23|int OSSL_CRMF_MSG_set1_##ctrlinf##_##atyp(OSSL_CRMF_MSG *msg, const valt *in) \
   67|     23|{                                                                         \
   68|     23|    OSSL_CRMF_ATTRIBUTETYPEANDVALUE *atav = NULL;                         \
   69|     23|                                                                          \
   70|     23|    if (msg == NULL || in == NULL)                                        \
  ------------------
  |  Branch (70:9): [True: 0, False: 23]
  |  Branch (70:24): [True: 0, False: 23]
  ------------------
   71|     23|        goto err;                                                         \
   72|     23|    if ((atav = OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new()) == NULL)           \
  ------------------
  |  Branch (72:9): [True: 0, False: 23]
  ------------------
   73|     23|        goto err;                                                         \
   74|     23|    if ((atav->type = OBJ_nid2obj(NID_id_##ctrlinf##_##atyp)) == NULL)    \
  ------------------
  |  Branch (74:9): [True: 0, False: 23]
  ------------------
   75|     23|        goto err;                                                         \
   76|     23|    if ((atav->value.atyp = valt##_dup(in)) == NULL)                      \
  ------------------
  |  Branch (76:9): [True: 0, False: 23]
  ------------------
   77|     23|        goto err;                                                         \
   78|     23|    if (!OSSL_CRMF_MSG_push0_##ctrlinf(msg, atav))                        \
  ------------------
  |  Branch (78:9): [True: 0, False: 23]
  ------------------
   79|     23|        goto err;                                                         \
   80|     23|    return 1;                                                             \
   81|     23| err:                                                                     \
   82|      0|    OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(atav);                           \
   83|      0|    return 0;                                                             \
   84|     23|}
OSSL_CRMF_CERTID_gen:
  181|     25|{
  182|     25|    OSSL_CRMF_CERTID *cid = NULL;
  183|       |
  184|     25|    if (issuer == NULL || serial == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 25]
  |  Branch (184:27): [True: 0, False: 25]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return NULL;
  187|      0|    }
  188|       |
  189|     25|    if ((cid = OSSL_CRMF_CERTID_new()) == NULL)
  ------------------
  |  Branch (189:9): [True: 0, False: 25]
  ------------------
  190|      0|        goto err;
  191|       |
  192|     25|    if (!X509_NAME_set(&cid->issuer->d.directoryName, issuer))
  ------------------
  |  Branch (192:9): [True: 0, False: 25]
  ------------------
  193|      0|        goto err;
  194|     25|    cid->issuer->type = GEN_DIRNAME;
  ------------------
  |  |  177|     25|# define GEN_DIRNAME     4
  ------------------
  195|       |
  196|     25|    ASN1_INTEGER_free(cid->serialNumber);
  197|     25|    if ((cid->serialNumber = ASN1_INTEGER_dup(serial)) == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 25]
  ------------------
  198|      0|        goto err;
  199|       |
  200|     25|    return cid;
  201|       |
  202|      0| err:
  203|      0|    OSSL_CRMF_CERTID_free(cid);
  204|      0|    return NULL;
  205|     25|}
OSSL_CRMF_MSG_get0_tmpl:
  250|  1.20k|{
  251|  1.20k|    if (crm == NULL || crm->certReq == NULL) {
  ------------------
  |  Branch (251:9): [True: 0, False: 1.20k]
  |  Branch (251:24): [True: 0, False: 1.20k]
  ------------------
  252|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|        return NULL;
  254|      0|    }
  255|  1.20k|    return crm->certReq->certTemplate;
  256|  1.20k|}
OSSL_CRMF_MSG_set_certReqId:
  278|    303|{
  279|    303|    if (crm == NULL || crm->certReq == NULL || crm->certReq->certReqId == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 303]
  |  Branch (279:24): [True: 0, False: 303]
  |  Branch (279:48): [True: 0, False: 303]
  ------------------
  280|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  281|      0|        return 0;
  282|      0|    }
  283|       |
  284|    303|    return ASN1_INTEGER_set(crm->certReq->certReqId, rid);
  285|    303|}
OSSL_CRMF_MSG_get_certReqId:
  308|    457|{
  309|    457|    if (crm == NULL || /* not really needed: */ crm->certReq == NULL) {
  ------------------
  |  Branch (309:9): [True: 0, False: 457]
  |  Branch (309:49): [True: 0, False: 457]
  ------------------
  310|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  311|      0|        return -1;
  312|      0|    }
  313|    457|    return crmf_asn1_get_int(crm->certReq->certReqId);
  314|    457|}
OSSL_CRMF_MSG_set0_extensions:
  318|    303|{
  319|    303|    OSSL_CRMF_CERTTEMPLATE *tmpl = OSSL_CRMF_MSG_get0_tmpl(crm);
  320|       |
  321|    303|    if (tmpl == NULL) { /* also crm == NULL implies this */
  ------------------
  |  Branch (321:9): [True: 0, False: 303]
  ------------------
  322|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |
  326|    303|    if (sk_X509_EXTENSION_num(exts) == 0) {
  ------------------
  |  |  235|    303|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (326:9): [True: 0, False: 303]
  ------------------
  327|      0|        sk_X509_EXTENSION_free(exts);
  ------------------
  |  |  241|      0|#define sk_X509_EXTENSION_free(sk) OPENSSL_sk_free(ossl_check_X509_EXTENSION_sk_type(sk))
  ------------------
  328|      0|        exts = NULL; /* do not include empty extensions list */
  329|      0|    }
  330|       |
  331|    303|    sk_X509_EXTENSION_pop_free(tmpl->extensions, X509_EXTENSION_free);
  ------------------
  |  |  249|    303|#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_freefunc_type(freefunc))
  ------------------
  332|    303|    tmpl->extensions = exts;
  333|    303|    return 1;
  334|    303|}
OSSL_CRMF_MSG_create_popo:
  399|    303|{
  400|    303|    OSSL_CRMF_POPO *pp = NULL;
  401|    303|    ASN1_INTEGER *tag = NULL;
  402|       |
  403|    303|    if (crm == NULL || (meth == OSSL_CRMF_POPO_SIGNATURE && pkey == NULL)) {
  ------------------
  |  |  226|    606|#  define OSSL_CRMF_POPO_SIGNATURE  1
  ------------------
  |  Branch (403:9): [True: 0, False: 303]
  |  Branch (403:25): [True: 0, False: 303]
  |  Branch (403:61): [True: 0, False: 0]
  ------------------
  404|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  405|      0|        return 0;
  406|      0|    }
  407|       |
  408|    303|    if (meth == OSSL_CRMF_POPO_NONE)
  ------------------
  |  |  224|    303|#  define OSSL_CRMF_POPO_NONE       -1
  ------------------
  |  Branch (408:9): [True: 303, False: 0]
  ------------------
  409|    303|        goto end;
  410|      0|    if ((pp = OSSL_CRMF_POPO_new()) == NULL)
  ------------------
  |  Branch (410:9): [True: 0, False: 0]
  ------------------
  411|      0|        goto err;
  412|      0|    pp->type = meth;
  413|       |
  414|      0|    switch (meth) {
  415|      0|    case OSSL_CRMF_POPO_RAVERIFIED:
  ------------------
  |  |  225|      0|#  define OSSL_CRMF_POPO_RAVERIFIED 0
  ------------------
  |  Branch (415:5): [True: 0, False: 0]
  ------------------
  416|      0|        if ((pp->value.raVerified = ASN1_NULL_new()) == NULL)
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            goto err;
  418|      0|        break;
  419|       |
  420|      0|    case OSSL_CRMF_POPO_SIGNATURE:
  ------------------
  |  |  226|      0|#  define OSSL_CRMF_POPO_SIGNATURE  1
  ------------------
  |  Branch (420:5): [True: 0, False: 0]
  ------------------
  421|      0|        {
  422|      0|            OSSL_CRMF_POPOSIGNINGKEY *ps = OSSL_CRMF_POPOSIGNINGKEY_new();
  423|       |
  424|      0|            if (ps == NULL)
  ------------------
  |  Branch (424:17): [True: 0, False: 0]
  ------------------
  425|      0|                goto err;
  426|      0|            if (!create_popo_signature(ps, crm->certReq, pkey, digest,
  ------------------
  |  Branch (426:17): [True: 0, False: 0]
  ------------------
  427|      0|                                       libctx, propq)) {
  428|      0|                OSSL_CRMF_POPOSIGNINGKEY_free(ps);
  429|      0|                goto err;
  430|      0|            }
  431|      0|            pp->value.signature = ps;
  432|      0|        }
  433|      0|        break;
  434|       |
  435|      0|    case OSSL_CRMF_POPO_KEYENC:
  ------------------
  |  |  227|      0|#  define OSSL_CRMF_POPO_KEYENC     2
  ------------------
  |  Branch (435:5): [True: 0, False: 0]
  ------------------
  436|      0|        if ((pp->value.keyEncipherment = OSSL_CRMF_POPOPRIVKEY_new()) == NULL)
  ------------------
  |  Branch (436:13): [True: 0, False: 0]
  ------------------
  437|      0|            goto err;
  438|      0|        tag = ASN1_INTEGER_new();
  439|      0|        pp->value.keyEncipherment->type =
  440|      0|            OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE;
  ------------------
  |  |   40|      0|#  define OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE    1
  ------------------
  441|      0|        pp->value.keyEncipherment->value.subsequentMessage = tag;
  442|      0|        if (tag == NULL
  ------------------
  |  Branch (442:13): [True: 0, False: 0]
  ------------------
  443|      0|                || !ASN1_INTEGER_set(tag, OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT))
  ------------------
  |  |   45|      0|#  define OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT       0
  ------------------
  |  Branch (443:20): [True: 0, False: 0]
  ------------------
  444|      0|            goto err;
  445|      0|        break;
  446|       |
  447|      0|    default:
  ------------------
  |  Branch (447:5): [True: 0, False: 0]
  ------------------
  448|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  449|      0|        goto err;
  450|      0|    }
  451|       |
  452|    303| end:
  453|    303|    OSSL_CRMF_POPO_free(crm->popo);
  454|    303|    crm->popo = pp;
  455|       |
  456|    303|    return 1;
  457|      0| err:
  458|      0|    OSSL_CRMF_POPO_free(pp);
  459|      0|    return 0;
  460|      0|}
OSSL_CRMF_MSGS_verify_popo:
  466|    293|{
  467|    293|    OSSL_CRMF_MSG *req = NULL;
  468|    293|    X509_PUBKEY *pubkey = NULL;
  469|    293|    OSSL_CRMF_POPOSIGNINGKEY *sig = NULL;
  470|    293|    const ASN1_ITEM *it;
  471|    293|    void *asn;
  472|       |
  473|    293|    if (reqs == NULL || (req = sk_OSSL_CRMF_MSG_value(reqs, rid)) == NULL) {
  ------------------
  |  |   58|    293|#define sk_OSSL_CRMF_MSG_value(sk, idx) ((OSSL_CRMF_MSG *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), (idx)))
  ------------------
  |  Branch (473:9): [True: 0, False: 293]
  |  Branch (473:25): [True: 0, False: 293]
  ------------------
  474|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  475|      0|        return 0;
  476|      0|    }
  477|       |
  478|    293|    if (req->popo == NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 293]
  ------------------
  479|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_MISSING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  480|      0|        return 0;
  481|      0|    }
  482|       |
  483|    293|    switch (req->popo->type) {
  484|      0|    case OSSL_CRMF_POPO_RAVERIFIED:
  ------------------
  |  |  225|      0|#  define OSSL_CRMF_POPO_RAVERIFIED 0
  ------------------
  |  Branch (484:5): [True: 0, False: 293]
  ------------------
  485|      0|        if (!acceptRAVerified) {
  ------------------
  |  Branch (485:13): [True: 0, False: 0]
  ------------------
  486|      0|            ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  487|      0|            return 0;
  488|      0|        }
  489|      0|        break;
  490|    293|    case OSSL_CRMF_POPO_SIGNATURE:
  ------------------
  |  |  226|    293|#  define OSSL_CRMF_POPO_SIGNATURE  1
  ------------------
  |  Branch (490:5): [True: 293, False: 0]
  ------------------
  491|    293|        pubkey = req->certReq->certTemplate->publicKey;
  492|    293|        if (pubkey == NULL) {
  ------------------
  |  Branch (492:13): [True: 0, False: 293]
  ------------------
  493|      0|            ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_MISSING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  494|      0|            return 0;
  495|      0|        }
  496|    293|        sig = req->popo->value.signature;
  497|    293|        if (sig->poposkInput != NULL) {
  ------------------
  |  Branch (497:13): [True: 0, False: 293]
  ------------------
  498|       |            /*
  499|       |             * According to RFC 4211: publicKey contains a copy of
  500|       |             * the public key from the certificate template. This MUST be
  501|       |             * exactly the same value as contained in the certificate template.
  502|       |             */
  503|      0|            if (sig->poposkInput->publicKey == NULL) {
  ------------------
  |  Branch (503:17): [True: 0, False: 0]
  ------------------
  504|      0|                ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_MISSING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|                return 0;
  506|      0|            }
  507|      0|            if (X509_PUBKEY_eq(pubkey, sig->poposkInput->publicKey) != 1) {
  ------------------
  |  Branch (507:17): [True: 0, False: 0]
  ------------------
  508|      0|                ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|                return 0;
  510|      0|            }
  511|       |
  512|       |            /*
  513|       |             * Should check at this point the contents of the authInfo sub-field
  514|       |             * as requested in FR #19807 according to RFC 4211 section 4.1.
  515|       |             */
  516|       |
  517|      0|            it = ASN1_ITEM_rptr(OSSL_CRMF_POPOSIGNINGKEYINPUT);
  ------------------
  |  |  427|      0|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  518|      0|            asn = sig->poposkInput;
  519|    293|        } else {
  520|    293|            if (req->certReq->certTemplate->subject == NULL) {
  ------------------
  |  Branch (520:17): [True: 1, False: 292]
  ------------------
  521|      1|                ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_MISSING_SUBJECT);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      1|                return 0;
  523|      1|            }
  524|    292|            it = ASN1_ITEM_rptr(OSSL_CRMF_CERTREQUEST);
  ------------------
  |  |  427|    292|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  525|    292|            asn = req->certReq;
  526|    292|        }
  527|    292|        if (ASN1_item_verify_ex(it, sig->algorithmIdentifier, sig->signature,
  ------------------
  |  Branch (527:13): [True: 282, False: 10]
  ------------------
  528|    292|                                asn, NULL, X509_PUBKEY_get0(pubkey), libctx,
  529|    292|                                propq) < 1)
  530|    282|            return 0;
  531|     10|        break;
  532|     10|    case OSSL_CRMF_POPO_KEYENC:
  ------------------
  |  |  227|      0|#  define OSSL_CRMF_POPO_KEYENC     2
  ------------------
  |  Branch (532:5): [True: 0, False: 293]
  ------------------
  533|       |        /*
  534|       |         * When OSSL_CMP_certrep_new() supports encrypted certs,
  535|       |         * should return 1 if the type of req->popo->value.keyEncipherment
  536|       |         * is OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE and
  537|       |         * its value.subsequentMessage == OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT
  538|       |         */
  539|      0|    case OSSL_CRMF_POPO_KEYAGREE:
  ------------------
  |  |  228|      0|#  define OSSL_CRMF_POPO_KEYAGREE   3
  ------------------
  |  Branch (539:5): [True: 0, False: 293]
  ------------------
  540|      0|    default:
  ------------------
  |  Branch (540:5): [True: 0, False: 293]
  ------------------
  541|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_POPO_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  542|      0|        return 0;
  543|    293|    }
  544|     10|    return 1;
  545|    293|}
OSSL_CRMF_MSG_centralkeygen_requested:
  548|    900|{
  549|    900|    X509_PUBKEY *pubkey = NULL;
  550|    900|    const unsigned char *pk = NULL;
  551|    900|    int pklen, ret = 0;
  552|       |
  553|    900|    if (crm == NULL && p10cr == NULL) {
  ------------------
  |  Branch (553:9): [True: 604, False: 296]
  |  Branch (553:24): [True: 0, False: 604]
  ------------------
  554|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  555|      0|        return -1;
  556|      0|    }
  557|       |
  558|    900|    if (crm != NULL)
  ------------------
  |  Branch (558:9): [True: 296, False: 604]
  ------------------
  559|    296|        pubkey = OSSL_CRMF_CERTTEMPLATE_get0_publicKey(OSSL_CRMF_MSG_get0_tmpl(crm));
  560|    604|    else
  561|    604|        pubkey = p10cr->req_info.pubkey;
  562|       |
  563|    900|    if (pubkey == NULL
  ------------------
  |  Branch (563:9): [True: 2, False: 898]
  ------------------
  564|    900|        || (X509_PUBKEY_get0_param(NULL, &pk, &pklen, NULL, pubkey)
  ------------------
  |  Branch (564:13): [True: 898, False: 0]
  ------------------
  565|    898|            && pklen == 0))
  ------------------
  |  Branch (565:16): [True: 1, False: 897]
  ------------------
  566|      3|        ret = 1;
  567|       |
  568|       |    /*
  569|       |     * In case of CRMF, POPO MUST be absent if central key generation
  570|       |     * is requested, otherwise MUST be present
  571|       |     */
  572|    900|    if (crm != NULL && ret != (crm->popo == NULL)) {
  ------------------
  |  Branch (572:9): [True: 296, False: 604]
  |  Branch (572:24): [True: 1, False: 295]
  ------------------
  573|      1|        ERR_raise(ERR_LIB_CRMF, CRMF_R_POPO_INCONSISTENT_CENTRAL_KEYGEN);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      1|        return -2;
  575|      1|    }
  576|    899|    return ret;
  577|    900|}
OSSL_CRMF_CERTTEMPLATE_get0_publicKey:
  581|    296|{
  582|    296|    return tmpl != NULL ? tmpl->publicKey : NULL;
  ------------------
  |  Branch (582:12): [True: 296, False: 0]
  ------------------
  583|    296|}
OSSL_CRMF_CERTTEMPLATE_get0_serialNumber:
  587|      4|{
  588|      4|    return tmpl != NULL ? tmpl->serialNumber : NULL;
  ------------------
  |  Branch (588:12): [True: 4, False: 0]
  ------------------
  589|      4|}
OSSL_CRMF_CERTTEMPLATE_get0_issuer:
  599|      4|{
  600|      4|    return tmpl != NULL ? tmpl->issuer : NULL;
  ------------------
  |  Branch (600:12): [True: 4, False: 0]
  ------------------
  601|      4|}
OSSL_CRMF_CERTTEMPLATE_fill:
  630|    412|{
  631|    412|    if (tmpl == NULL) {
  ------------------
  |  Branch (631:9): [True: 0, False: 412]
  ------------------
  632|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  633|      0|        return 0;
  634|      0|    }
  635|    412|    if (subject != NULL && !X509_NAME_set((X509_NAME **)&tmpl->subject, subject))
  ------------------
  |  Branch (635:9): [True: 303, False: 109]
  |  Branch (635:28): [True: 0, False: 303]
  ------------------
  636|      0|        return 0;
  637|    412|    if (issuer != NULL && !X509_NAME_set((X509_NAME **)&tmpl->issuer, issuer))
  ------------------
  |  Branch (637:9): [True: 412, False: 0]
  |  Branch (637:27): [True: 0, False: 412]
  ------------------
  638|      0|        return 0;
  639|    412|    if (serial != NULL) {
  ------------------
  |  Branch (639:9): [True: 109, False: 303]
  ------------------
  640|    109|        ASN1_INTEGER_free(tmpl->serialNumber);
  641|    109|        if ((tmpl->serialNumber = ASN1_INTEGER_dup(serial)) == NULL)
  ------------------
  |  Branch (641:13): [True: 0, False: 109]
  ------------------
  642|      0|            return 0;
  643|    109|    }
  644|    412|    if (pubkey != NULL && !X509_PUBKEY_set(&tmpl->publicKey, pubkey))
  ------------------
  |  Branch (644:9): [True: 0, False: 412]
  |  Branch (644:27): [True: 0, False: 0]
  ------------------
  645|      0|        return 0;
  646|    412|    return 1;
  647|    412|}
crmf_lib.c:OSSL_CRMF_MSG_push0_regCtrl:
   93|     23|{
   94|     23|    int new = 0;
   95|       |
   96|     23|    if (crm == NULL || crm->certReq == NULL || ctrl == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 23]
  |  Branch (96:24): [True: 0, False: 23]
  |  Branch (96:48): [True: 0, False: 23]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        return 0;
   99|      0|    }
  100|       |
  101|     23|    if (crm->certReq->controls == NULL) {
  ------------------
  |  Branch (101:9): [True: 23, False: 0]
  ------------------
  102|     23|        crm->certReq->controls = sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_null();
  ------------------
  |  |   90|     23|#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_null() ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new_null())
  ------------------
  103|     23|        if (crm->certReq->controls == NULL)
  ------------------
  |  Branch (103:13): [True: 0, False: 23]
  ------------------
  104|      0|            goto err;
  105|     23|        new = 1;
  106|     23|    }
  107|     23|    if (!sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push(crm->certReq->controls, ctrl))
  ------------------
  |  |   97|     23|#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
  ------------------
  |  Branch (107:9): [True: 0, False: 23]
  ------------------
  108|      0|        goto err;
  109|       |
  110|     23|    return 1;
  111|      0| err:
  112|      0|    if (new != 0) {
  ------------------
  |  Branch (112:9): [True: 0, False: 0]
  ------------------
  113|      0|        sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(crm->certReq->controls);
  ------------------
  |  |   93|      0|#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
  ------------------
  114|      0|        crm->certReq->controls = NULL;
  115|      0|    }
  116|      0|    return 0;
  117|     23|}
crmf_lib.c:crmf_asn1_get_int:
  289|    457|{
  290|    457|    int64_t res;
  291|       |
  292|    457|    if (!ASN1_INTEGER_get_int64(&res, a)) {
  ------------------
  |  Branch (292:9): [True: 3, False: 454]
  ------------------
  293|      3|        ERR_raise(ERR_LIB_CRMF, ASN1_R_INVALID_NUMBER);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  294|      3|        return -1;
  295|      3|    }
  296|    454|    if (res < INT_MIN) {
  ------------------
  |  Branch (296:9): [True: 47, False: 407]
  ------------------
  297|     47|        ERR_raise(ERR_LIB_CRMF, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|     47|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     47|    (ERR_new(),                                                 \
  |  |  |  |  404|     47|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     47|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     47|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     47|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     47|     ERR_set_error)
  |  |  ------------------
  ------------------
  298|     47|        return -1;
  299|     47|    }
  300|    407|    if (res > INT_MAX) {
  ------------------
  |  Branch (300:9): [True: 2, False: 405]
  ------------------
  301|      2|        ERR_raise(ERR_LIB_CRMF, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
  302|      2|        return -1;
  303|      2|    }
  304|    405|    return (int)res;
  305|    407|}

OSSL_CRMF_pbm_new:
  132|    167|{
  133|    167|    int mac_nid, hmac_md_nid = NID_undef;
  ------------------
  |  |   18|    167|#define NID_undef                       0
  ------------------
  134|    167|    char mdname[OSSL_MAX_NAME_SIZE];
  135|    167|    char hmac_mdname[OSSL_MAX_NAME_SIZE];
  136|    167|    EVP_MD *owf = NULL;
  137|    167|    EVP_MD_CTX *ctx = NULL;
  138|    167|    unsigned char basekey[EVP_MAX_MD_SIZE];
  139|    167|    unsigned int bklen = EVP_MAX_MD_SIZE;
  ------------------
  |  |   34|    167|# define EVP_MAX_MD_SIZE                 64/* longest known is SHA512 */
  ------------------
  140|    167|    int64_t iterations;
  141|    167|    unsigned char *mac_res = 0;
  142|    167|    int ok = 0;
  143|       |
  144|    167|    if (out == NULL || pbmp == NULL || pbmp->mac == NULL
  ------------------
  |  Branch (144:9): [True: 0, False: 167]
  |  Branch (144:24): [True: 0, False: 167]
  |  Branch (144:40): [True: 0, False: 167]
  ------------------
  145|    167|            || pbmp->mac->algorithm == NULL || msg == NULL || sec == NULL) {
  ------------------
  |  Branch (145:16): [True: 0, False: 167]
  |  Branch (145:48): [True: 0, False: 167]
  |  Branch (145:63): [True: 0, False: 167]
  ------------------
  146|      0|        ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  147|      0|        goto err;
  148|      0|    }
  149|    167|    if ((mac_res = OPENSSL_malloc(EVP_MAX_MD_SIZE)) == NULL)
  ------------------
  |  |  102|    167|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    167|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    167|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (149:9): [True: 0, False: 167]
  ------------------
  150|      0|        goto err;
  151|       |
  152|       |    /*
  153|       |     * owf identifies the hash algorithm and associated parameters used to
  154|       |     * compute the key used in the MAC process.  All implementations MUST
  155|       |     * support SHA-1.
  156|       |     */
  157|    167|    OBJ_obj2txt(mdname, sizeof(mdname), pbmp->owf->algorithm, 0);
  158|    167|    if ((owf = EVP_MD_fetch(libctx, mdname, propq)) == NULL) {
  ------------------
  |  Branch (158:9): [True: 12, False: 155]
  ------------------
  159|     12|        ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  160|     12|        goto err;
  161|     12|    }
  162|       |
  163|    155|    if ((ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 155]
  ------------------
  164|      0|        goto err;
  165|       |
  166|       |    /* compute the basekey of the salted secret */
  167|    155|    if (!EVP_DigestInit_ex(ctx, owf, NULL))
  ------------------
  |  Branch (167:9): [True: 0, False: 155]
  ------------------
  168|      0|        goto err;
  169|       |    /* first the secret */
  170|    155|    if (!EVP_DigestUpdate(ctx, sec, seclen))
  ------------------
  |  Branch (170:9): [True: 0, False: 155]
  ------------------
  171|      0|        goto err;
  172|       |    /* then the salt */
  173|    155|    if (!EVP_DigestUpdate(ctx, pbmp->salt->data, pbmp->salt->length))
  ------------------
  |  Branch (173:9): [True: 0, False: 155]
  ------------------
  174|      0|        goto err;
  175|    155|    if (!EVP_DigestFinal_ex(ctx, basekey, &bklen))
  ------------------
  |  Branch (175:9): [True: 3, False: 152]
  ------------------
  176|      3|        goto err;
  177|    152|    if (!ASN1_INTEGER_get_int64(&iterations, pbmp->iterationCount)
  ------------------
  |  Branch (177:9): [True: 0, False: 152]
  ------------------
  178|    152|            || iterations < 100 /* min from RFC */
  ------------------
  |  Branch (178:16): [True: 28, False: 124]
  ------------------
  179|    152|            || iterations > OSSL_CRMF_PBM_MAX_ITERATION_COUNT) {
  ------------------
  |  |  235|    124|# define OSSL_CRMF_PBM_MAX_ITERATION_COUNT 100000 /* if too large allows DoS */
  ------------------
  |  Branch (179:16): [True: 11, False: 113]
  ------------------
  180|     39|        ERR_raise(ERR_LIB_CRMF, CRMF_R_BAD_PBM_ITERATIONCOUNT);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     39|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     39|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     39|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     39|     ERR_set_error)
  |  |  ------------------
  ------------------
  181|     39|        goto err;
  182|     39|    }
  183|       |
  184|       |    /* the first iteration was already done above */
  185|   660k|    while (--iterations > 0) {
  ------------------
  |  Branch (185:12): [True: 659k, False: 113]
  ------------------
  186|   659k|        if (!EVP_DigestInit_ex(ctx, owf, NULL))
  ------------------
  |  Branch (186:13): [True: 0, False: 659k]
  ------------------
  187|      0|            goto err;
  188|   659k|        if (!EVP_DigestUpdate(ctx, basekey, bklen))
  ------------------
  |  Branch (188:13): [True: 0, False: 659k]
  ------------------
  189|      0|            goto err;
  190|   659k|        if (!EVP_DigestFinal_ex(ctx, basekey, &bklen))
  ------------------
  |  Branch (190:13): [True: 0, False: 659k]
  ------------------
  191|      0|            goto err;
  192|   659k|    }
  193|       |
  194|       |    /*
  195|       |     * mac identifies the algorithm and associated parameters of the MAC
  196|       |     * function to be used.  All implementations MUST support HMAC-SHA1 [HMAC].
  197|       |     * All implementations SHOULD support DES-MAC and Triple-DES-MAC [PKCS11].
  198|       |     */
  199|    113|    mac_nid = OBJ_obj2nid(pbmp->mac->algorithm);
  200|       |
  201|    113|    if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, mac_nid, NULL, &hmac_md_nid, NULL)
  ------------------
  |  | 1591|    113|# define EVP_PBE_TYPE_PRF        0x1
  ------------------
  |  Branch (201:9): [True: 45, False: 68]
  ------------------
  202|    113|        || OBJ_obj2txt(hmac_mdname, sizeof(hmac_mdname),
  ------------------
  |  Branch (202:12): [True: 0, False: 68]
  ------------------
  203|     68|                       OBJ_nid2obj(hmac_md_nid), 0) <= 0) {
  204|     45|        ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|     45|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     45|    (ERR_new(),                                                 \
  |  |  |  |  404|     45|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     45|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     45|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     45|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     45|     ERR_set_error)
  |  |  ------------------
  ------------------
  205|     45|        goto err;
  206|     45|    }
  207|       |    /* could be generalized to allow non-HMAC: */
  208|     68|    if (EVP_Q_mac(libctx, "HMAC", propq, hmac_mdname, NULL, basekey, bklen,
  ------------------
  |  Branch (208:9): [True: 8, False: 60]
  ------------------
  209|     68|                  msg, msglen, mac_res, EVP_MAX_MD_SIZE, outlen) == NULL)
  ------------------
  |  |   34|     68|# define EVP_MAX_MD_SIZE                 64/* longest known is SHA512 */
  ------------------
  210|      8|        goto err;
  211|       |
  212|     60|    ok = 1;
  213|       |
  214|    167| err:
  215|    167|    OPENSSL_cleanse(basekey, bklen);
  216|    167|    EVP_MD_free(owf);
  217|    167|    EVP_MD_CTX_free(ctx);
  218|       |
  219|    167|    if (ok == 1) {
  ------------------
  |  Branch (219:9): [True: 60, False: 107]
  ------------------
  220|     60|        *out = mac_res;
  221|     60|        return 1;
  222|     60|    }
  223|       |
  224|    107|    OPENSSL_free(mac_res);
  ------------------
  |  |  115|    107|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    107|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    107|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  225|       |
  226|    107|    if (pbmp != NULL && pbmp->mac != NULL) {
  ------------------
  |  Branch (226:9): [True: 107, False: 0]
  |  Branch (226:25): [True: 107, False: 0]
  ------------------
  227|    107|        char buf[128];
  228|       |
  229|    107|        if (OBJ_obj2txt(buf, sizeof(buf), pbmp->mac->algorithm, 0))
  ------------------
  |  Branch (229:13): [True: 107, False: 0]
  ------------------
  230|    107|            ERR_add_error_data(1, buf);
  231|    107|    }
  232|    107|    return 0;
  233|    167|}

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|   771k|{
  254|   771k|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|   771k|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|   771k|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|   771k|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 771k, False: 0]
  |  Branch (257:22): [True: 746k, False: 24.8k]
  |  Branch (257:33): [True: 30.5k, False: 716k]
  ------------------
  258|   771k|}
ossl_isdigit:
  270|  44.0M|{
  271|  44.0M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  44.0M|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|  44.0M|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  44.0M|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 42.9M, False: 1.06M]
  |  |  |  Branch (265:43): [True: 15.0M, False: 27.8M]
  |  |  ------------------
  ------------------
  274|  44.0M|}
ossl_isupper:
  277|  37.0k|{
  278|  37.0k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  37.0k|#  define ossl_toascii(c)       (c)
  ------------------
  279|       |
  280|  37.0k|    return ASCII_IS_UPPER(a);
  ------------------
  |  |  266|  37.0k|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 32.7k, False: 4.35k]
  |  |  |  Branch (266:43): [True: 16.6k, False: 16.0k]
  |  |  ------------------
  ------------------
  281|  37.0k|}
ossl_tolower:
  297|  11.8M|{
  298|  11.8M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  11.8M|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  11.8M|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  11.8M|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 10.2M, False: 1.52M]
  |  |  |  Branch (266:43): [True: 2.73M, False: 7.56M]
  |  |  ------------------
  ------------------
  301|  11.8M|}
ossl_ascii_isdigit:
  311|   138k|{
  312|   138k|    return ASCII_IS_DIGIT(c);
  ------------------
  |  |  265|   138k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 136k, False: 1.92k]
  |  |  |  Branch (265:43): [True: 135k, False: 1.59k]
  |  |  ------------------
  ------------------
  313|   138k|}

ossl_DER_w_precompiled:
   54|    160|{
   55|    160|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (55:12): [True: 160, False: 0]
  ------------------
   56|    160|        && WPACKET_memcpy(pkt, precompiled, precompiled_n)
  ------------------
  |  Branch (56:12): [True: 160, False: 0]
  ------------------
   57|    160|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (57:12): [True: 160, False: 0]
  ------------------
   58|    160|}
ossl_DER_w_begin_sequence:
  172|    160|{
  173|    160|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (173:12): [True: 160, False: 0]
  ------------------
  174|    160|        && WPACKET_start_sub_packet(pkt);
  ------------------
  |  Branch (174:12): [True: 160, False: 0]
  ------------------
  175|    160|}
ossl_DER_w_end_sequence:
  178|    160|{
  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|    160|    size_t size1, size2;
  191|       |
  192|    160|    return WPACKET_get_total_written(pkt, &size1)
  ------------------
  |  Branch (192:12): [True: 160, False: 0]
  ------------------
  193|    160|        && WPACKET_close(pkt)
  ------------------
  |  Branch (193:12): [True: 160, False: 0]
  ------------------
  194|    160|        && WPACKET_get_total_written(pkt, &size2)
  ------------------
  |  Branch (194:12): [True: 160, False: 0]
  ------------------
  195|    160|        && (size1 == size2
  ------------------
  |  Branch (195:12): [True: 160, False: 0]
  |  Branch (195:13): [True: 0, False: 160]
  ------------------
  196|    160|            ? WPACKET_set_flags(pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH)
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  197|    160|            : WPACKET_put_bytes_u8(pkt, DER_F_CONSTRUCTED | DER_P_SEQUENCE))
  ------------------
  |  |  878|    160|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  198|    160|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (198:12): [True: 160, False: 0]
  ------------------
  199|    160|}
der_writer.c:int_start_context:
   17|    320|{
   18|    320|    if (tag < 0)
  ------------------
  |  Branch (18:9): [True: 320, False: 0]
  ------------------
   19|    320|        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|    320|{
   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|    320|    size_t size1, size2;
   36|       |
   37|    320|    if (tag < 0)
  ------------------
  |  Branch (37:9): [True: 320, False: 0]
  ------------------
   38|    320|        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|  4.47k|{
   62|  4.47k|    const unsigned char *p, *pm;
   63|  4.47k|    int pklen, pmlen;
   64|  4.47k|    int ptype;
   65|  4.47k|    const void *pval;
   66|  4.47k|    const ASN1_STRING *pstr;
   67|  4.47k|    X509_ALGOR *palg;
   68|  4.47k|    ASN1_INTEGER *public_key = NULL;
   69|       |
   70|  4.47k|    DH *dh = NULL;
   71|       |
   72|  4.47k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (72:9): [True: 0, False: 4.47k]
  ------------------
   73|      0|        return 0;
   74|  4.47k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
   75|       |
   76|  4.47k|    if (ptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|  4.47k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (76:9): [True: 2.18k, False: 2.29k]
  ------------------
   77|  2.18k|        ERR_raise(ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR);
  ------------------
  |  |  401|  2.18k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.18k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.18k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  2.18k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  2.18k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.18k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.18k|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|  2.18k|        goto err;
   79|  2.18k|    }
   80|       |
   81|  2.29k|    pstr = pval;
   82|  2.29k|    pm = pstr->data;
   83|  2.29k|    pmlen = pstr->length;
   84|       |
   85|  2.29k|    if ((dh = d2i_dhp(pkey, &pm, pmlen)) == NULL) {
  ------------------
  |  Branch (85:9): [True: 1.24k, False: 1.04k]
  ------------------
   86|  1.24k|        ERR_raise(ERR_LIB_DH, DH_R_DECODE_ERROR);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.24k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.24k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.24k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.24k|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|  1.24k|        goto err;
   88|  1.24k|    }
   89|       |
   90|  1.04k|    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) {
  ------------------
  |  Branch (90:9): [True: 904, False: 143]
  ------------------
   91|    904|        ERR_raise(ERR_LIB_DH, DH_R_DECODE_ERROR);
  ------------------
  |  |  401|    904|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    904|    (ERR_new(),                                                 \
  |  |  |  |  404|    904|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    904|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    904|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    904|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    904|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|    904|        goto err;
   93|    904|    }
   94|       |
   95|       |    /* We have parameters now set public key */
   96|    143|    if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 143]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_DH, DH_R_BN_DECODE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|       |
  101|    143|    ASN1_INTEGER_free(public_key);
  102|    143|    EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh);
  103|    143|    return 1;
  104|       |
  105|  4.33k| err:
  106|  4.33k|    ASN1_INTEGER_free(public_key);
  107|  4.33k|    DH_free(dh);
  108|  4.33k|    return 0;
  109|    143|}
dh_ameth.c:d2i_dhp:
   36|  2.29k|{
   37|  2.29k|    DH *dh = NULL;
   38|  2.29k|    int is_dhx = (pkey->ameth == &ossl_dhx_asn1_meth);
   39|       |
   40|  2.29k|    if (is_dhx)
  ------------------
  |  Branch (40:9): [True: 1.62k, False: 674]
  ------------------
   41|  1.62k|        dh = d2i_DHxparams(NULL, pp, length);
   42|    674|    else
   43|    674|        dh = d2i_DHparams(NULL, pp, length);
   44|       |
   45|  2.29k|    return dh;
   46|  2.29k|}
dh_ameth.c:int_dh_free:
   56|  4.47k|{
   57|  4.47k|    DH_free(pkey->pkey.dh);
   58|  4.47k|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ossl_ec_GF2m_simple_group_init:
   29|  27.3k|{
   30|  27.3k|    group->field = BN_new();
   31|  27.3k|    group->a = BN_new();
   32|  27.3k|    group->b = BN_new();
   33|       |
   34|  27.3k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (34:9): [True: 0, False: 27.3k]
  |  Branch (34:33): [True: 0, False: 27.3k]
  |  Branch (34:53): [True: 0, False: 27.3k]
  ------------------
   35|      0|        BN_free(group->field);
   36|      0|        BN_free(group->a);
   37|      0|        BN_free(group->b);
   38|      0|        return 0;
   39|      0|    }
   40|  27.3k|    return 1;
   41|  27.3k|}
ossl_ec_GF2m_simple_group_finish:
   48|  27.3k|{
   49|  27.3k|    BN_free(group->field);
   50|  27.3k|    BN_free(group->a);
   51|  27.3k|    BN_free(group->b);
   52|  27.3k|}
ossl_ec_GF2m_simple_group_copy:
   76|  13.6k|{
   77|  13.6k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (77:9): [True: 0, False: 13.6k]
  ------------------
   78|      0|        return 0;
   79|  13.6k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (79:9): [True: 0, False: 13.6k]
  ------------------
   80|      0|        return 0;
   81|  13.6k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (81:9): [True: 0, False: 13.6k]
  ------------------
   82|      0|        return 0;
   83|  13.6k|    dest->poly[0] = src->poly[0];
   84|  13.6k|    dest->poly[1] = src->poly[1];
   85|  13.6k|    dest->poly[2] = src->poly[2];
   86|  13.6k|    dest->poly[3] = src->poly[3];
   87|  13.6k|    dest->poly[4] = src->poly[4];
   88|  13.6k|    dest->poly[5] = src->poly[5];
   89|  13.6k|    if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (89:9): [True: 0, False: 13.6k]
  ------------------
   90|  13.6k|        NULL)
   91|      0|        return 0;
   92|  13.6k|    if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (92:9): [True: 0, False: 13.6k]
  ------------------
   93|  13.6k|        NULL)
   94|      0|        return 0;
   95|  13.6k|    bn_set_all_zero(dest->a);
   96|  13.6k|    bn_set_all_zero(dest->b);
   97|  13.6k|    return 1;
   98|  13.6k|}
ossl_ec_GF2m_simple_group_set_curve:
  104|  13.6k|{
  105|  13.6k|    int ret = 0, i;
  106|       |
  107|       |    /* group->field */
  108|  13.6k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (108:9): [True: 0, False: 13.6k]
  ------------------
  109|      0|        goto err;
  110|  13.6k|    i = BN_GF2m_poly2arr(group->field, group->poly, 6) - 1;
  111|  13.6k|    if ((i != 5) && (i != 3)) {
  ------------------
  |  Branch (111:9): [True: 4.18k, False: 9.47k]
  |  Branch (111:21): [True: 0, False: 4.18k]
  ------------------
  112|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|        goto err;
  114|      0|    }
  115|       |
  116|       |    /* group->a */
  117|  13.6k|    if (!BN_GF2m_mod_arr(group->a, a, group->poly))
  ------------------
  |  Branch (117:9): [True: 0, False: 13.6k]
  ------------------
  118|      0|        goto err;
  119|  13.6k|    if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 13.6k]
  ------------------
  120|  13.6k|        == NULL)
  121|      0|        goto err;
  122|  13.6k|    bn_set_all_zero(group->a);
  123|       |
  124|       |    /* group->b */
  125|  13.6k|    if (!BN_GF2m_mod_arr(group->b, b, group->poly))
  ------------------
  |  Branch (125:9): [True: 0, False: 13.6k]
  ------------------
  126|      0|        goto err;
  127|  13.6k|    if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  13.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  13.6k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (127:9): [True: 0, False: 13.6k]
  ------------------
  128|  13.6k|        == NULL)
  129|      0|        goto err;
  130|  13.6k|    bn_set_all_zero(group->b);
  131|       |
  132|  13.6k|    ret = 1;
  133|  13.6k| err:
  134|  13.6k|    return ret;
  135|  13.6k|}
ossl_ec_GF2m_simple_group_get_degree:
  172|  15.5k|{
  173|  15.5k|    return BN_num_bits(group->field) - 1;
  174|  15.5k|}
ossl_ec_GF2m_simple_point_init:
  223|  55.0k|{
  224|  55.0k|    point->X = BN_new();
  225|  55.0k|    point->Y = BN_new();
  226|  55.0k|    point->Z = BN_new();
  227|       |
  228|  55.0k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (228:9): [True: 0, False: 55.0k]
  |  Branch (228:29): [True: 0, False: 55.0k]
  |  Branch (228:49): [True: 0, False: 55.0k]
  ------------------
  229|      0|        BN_free(point->X);
  230|      0|        BN_free(point->Y);
  231|      0|        BN_free(point->Z);
  232|      0|        return 0;
  233|      0|    }
  234|  55.0k|    return 1;
  235|  55.0k|}
ossl_ec_GF2m_simple_point_finish:
  239|  54.9k|{
  240|  54.9k|    BN_free(point->X);
  241|  54.9k|    BN_free(point->Y);
  242|  54.9k|    BN_free(point->Z);
  243|  54.9k|}
ossl_ec_GF2m_simple_point_clear_finish:
  247|    128|{
  248|    128|    BN_clear_free(point->X);
  249|    128|    BN_clear_free(point->Y);
  250|    128|    BN_clear_free(point->Z);
  251|    128|    point->Z_is_one = 0;
  252|    128|}
ossl_ec_GF2m_simple_point_copy:
  259|  27.4k|{
  260|  27.4k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (260:9): [True: 0, False: 27.4k]
  ------------------
  261|      0|        return 0;
  262|  27.4k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (262:9): [True: 0, False: 27.4k]
  ------------------
  263|      0|        return 0;
  264|  27.4k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (264:9): [True: 0, False: 27.4k]
  ------------------
  265|      0|        return 0;
  266|  27.4k|    dest->Z_is_one = src->Z_is_one;
  267|  27.4k|    dest->curve_name = src->curve_name;
  268|       |
  269|  27.4k|    return 1;
  270|  27.4k|}
ossl_ec_GF2m_simple_point_set_to_infinity:
  278|  2.96k|{
  279|  2.96k|    point->Z_is_one = 0;
  280|  2.96k|    BN_zero(point->Z);
  ------------------
  |  |  202|  2.96k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  281|  2.96k|    return 1;
  282|  2.96k|}
ossl_ec_GF2m_simple_point_set_affine_coordinates:
  293|  18.7k|{
  294|  18.7k|    int ret = 0;
  295|  18.7k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (295:9): [True: 0, False: 18.7k]
  |  Branch (295:22): [True: 0, False: 18.7k]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return 0;
  298|      0|    }
  299|       |
  300|  18.7k|    if (!BN_copy(point->X, x))
  ------------------
  |  Branch (300:9): [True: 0, False: 18.7k]
  ------------------
  301|      0|        goto err;
  302|  18.7k|    BN_set_negative(point->X, 0);
  303|  18.7k|    if (!BN_copy(point->Y, y))
  ------------------
  |  Branch (303:9): [True: 0, False: 18.7k]
  ------------------
  304|      0|        goto err;
  305|  18.7k|    BN_set_negative(point->Y, 0);
  306|  18.7k|    if (!BN_copy(point->Z, BN_value_one()))
  ------------------
  |  Branch (306:9): [True: 0, False: 18.7k]
  ------------------
  307|      0|        goto err;
  308|  18.7k|    BN_set_negative(point->Z, 0);
  309|  18.7k|    point->Z_is_one = 1;
  310|  18.7k|    ret = 1;
  311|       |
  312|  18.7k| err:
  313|  18.7k|    return ret;
  314|  18.7k|}
ossl_ec_GF2m_simple_point_get_affine_coordinates:
  324|     64|{
  325|     64|    int ret = 0;
  326|       |
  327|     64|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 64]
  ------------------
  328|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  329|      0|        return 0;
  330|      0|    }
  331|       |
  332|     64|    if (BN_cmp(point->Z, BN_value_one())) {
  ------------------
  |  Branch (332:9): [True: 0, False: 64]
  ------------------
  333|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  334|      0|        return 0;
  335|      0|    }
  336|     64|    if (x != NULL) {
  ------------------
  |  Branch (336:9): [True: 64, False: 0]
  ------------------
  337|     64|        if (!BN_copy(x, point->X))
  ------------------
  |  Branch (337:13): [True: 0, False: 64]
  ------------------
  338|      0|            goto err;
  339|     64|        BN_set_negative(x, 0);
  340|     64|    }
  341|     64|    if (y != NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 64]
  ------------------
  342|      0|        if (!BN_copy(y, point->Y))
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  ------------------
  343|      0|            goto err;
  344|      0|        BN_set_negative(y, 0);
  345|      0|    }
  346|     64|    ret = 1;
  347|       |
  348|     64| err:
  349|     64|    return ret;
  350|     64|}
ossl_ec_GF2m_simple_add:
  358|     64|{
  359|     64|    BIGNUM *x0, *y0, *x1, *y1, *x2, *y2, *s, *t;
  360|     64|    int ret = 0;
  361|     64|#ifndef FIPS_MODULE
  362|     64|    BN_CTX *new_ctx = NULL;
  363|     64|#endif
  364|       |
  365|     64|    if (EC_POINT_is_at_infinity(group, a)) {
  ------------------
  |  Branch (365:9): [True: 0, False: 64]
  ------------------
  366|      0|        if (!EC_POINT_copy(r, b))
  ------------------
  |  Branch (366:13): [True: 0, False: 0]
  ------------------
  367|      0|            return 0;
  368|      0|        return 1;
  369|      0|    }
  370|       |
  371|     64|    if (EC_POINT_is_at_infinity(group, b)) {
  ------------------
  |  Branch (371:9): [True: 0, False: 64]
  ------------------
  372|      0|        if (!EC_POINT_copy(r, a))
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  ------------------
  373|      0|            return 0;
  374|      0|        return 1;
  375|      0|    }
  376|       |
  377|     64|#ifndef FIPS_MODULE
  378|     64|    if (ctx == NULL) {
  ------------------
  |  Branch (378:9): [True: 0, False: 64]
  ------------------
  379|      0|        ctx = new_ctx = BN_CTX_new();
  380|      0|        if (ctx == NULL)
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  ------------------
  381|      0|            return 0;
  382|      0|    }
  383|     64|#endif
  384|       |
  385|     64|    BN_CTX_start(ctx);
  386|     64|    x0 = BN_CTX_get(ctx);
  387|     64|    y0 = BN_CTX_get(ctx);
  388|     64|    x1 = BN_CTX_get(ctx);
  389|     64|    y1 = BN_CTX_get(ctx);
  390|     64|    x2 = BN_CTX_get(ctx);
  391|     64|    y2 = BN_CTX_get(ctx);
  392|     64|    s = BN_CTX_get(ctx);
  393|     64|    t = BN_CTX_get(ctx);
  394|     64|    if (t == NULL)
  ------------------
  |  Branch (394:9): [True: 0, False: 64]
  ------------------
  395|      0|        goto err;
  396|       |
  397|     64|    if (a->Z_is_one) {
  ------------------
  |  Branch (397:9): [True: 64, False: 0]
  ------------------
  398|     64|        if (!BN_copy(x0, a->X))
  ------------------
  |  Branch (398:13): [True: 0, False: 64]
  ------------------
  399|      0|            goto err;
  400|     64|        if (!BN_copy(y0, a->Y))
  ------------------
  |  Branch (400:13): [True: 0, False: 64]
  ------------------
  401|      0|            goto err;
  402|     64|    } else {
  403|      0|        if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx))
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|            goto err;
  405|      0|    }
  406|     64|    if (b->Z_is_one) {
  ------------------
  |  Branch (406:9): [True: 64, False: 0]
  ------------------
  407|     64|        if (!BN_copy(x1, b->X))
  ------------------
  |  Branch (407:13): [True: 0, False: 64]
  ------------------
  408|      0|            goto err;
  409|     64|        if (!BN_copy(y1, b->Y))
  ------------------
  |  Branch (409:13): [True: 0, False: 64]
  ------------------
  410|      0|            goto err;
  411|     64|    } else {
  412|      0|        if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx))
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|            goto err;
  414|      0|    }
  415|       |
  416|     64|    if (BN_GF2m_cmp(x0, x1)) {
  ------------------
  |  |  504|     64|#  define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
  |  |  ------------------
  |  |  |  Branch (504:29): [True: 64, False: 0]
  |  |  ------------------
  ------------------
  417|     64|        if (!BN_GF2m_add(t, x0, x1))
  ------------------
  |  Branch (417:13): [True: 0, False: 64]
  ------------------
  418|      0|            goto err;
  419|     64|        if (!BN_GF2m_add(s, y0, y1))
  ------------------
  |  Branch (419:13): [True: 0, False: 64]
  ------------------
  420|      0|            goto err;
  421|     64|        if (!group->meth->field_div(group, s, s, t, ctx))
  ------------------
  |  Branch (421:13): [True: 0, False: 64]
  ------------------
  422|      0|            goto err;
  423|     64|        if (!group->meth->field_sqr(group, x2, s, ctx))
  ------------------
  |  Branch (423:13): [True: 0, False: 64]
  ------------------
  424|      0|            goto err;
  425|     64|        if (!BN_GF2m_add(x2, x2, group->a))
  ------------------
  |  Branch (425:13): [True: 0, False: 64]
  ------------------
  426|      0|            goto err;
  427|     64|        if (!BN_GF2m_add(x2, x2, s))
  ------------------
  |  Branch (427:13): [True: 0, False: 64]
  ------------------
  428|      0|            goto err;
  429|     64|        if (!BN_GF2m_add(x2, x2, t))
  ------------------
  |  Branch (429:13): [True: 0, False: 64]
  ------------------
  430|      0|            goto err;
  431|     64|    } else {
  432|      0|        if (BN_GF2m_cmp(y0, y1) || BN_is_zero(x1)) {
  ------------------
  |  |  504|      0|#  define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
  |  |  ------------------
  |  |  |  Branch (504:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (432:36): [True: 0, False: 0]
  ------------------
  433|      0|            if (!EC_POINT_set_to_infinity(group, r))
  ------------------
  |  Branch (433:17): [True: 0, False: 0]
  ------------------
  434|      0|                goto err;
  435|      0|            ret = 1;
  436|      0|            goto err;
  437|      0|        }
  438|      0|        if (!group->meth->field_div(group, s, y1, x1, ctx))
  ------------------
  |  Branch (438:13): [True: 0, False: 0]
  ------------------
  439|      0|            goto err;
  440|      0|        if (!BN_GF2m_add(s, s, x1))
  ------------------
  |  Branch (440:13): [True: 0, False: 0]
  ------------------
  441|      0|            goto err;
  442|       |
  443|      0|        if (!group->meth->field_sqr(group, x2, s, ctx))
  ------------------
  |  Branch (443:13): [True: 0, False: 0]
  ------------------
  444|      0|            goto err;
  445|      0|        if (!BN_GF2m_add(x2, x2, s))
  ------------------
  |  Branch (445:13): [True: 0, False: 0]
  ------------------
  446|      0|            goto err;
  447|      0|        if (!BN_GF2m_add(x2, x2, group->a))
  ------------------
  |  Branch (447:13): [True: 0, False: 0]
  ------------------
  448|      0|            goto err;
  449|      0|    }
  450|       |
  451|     64|    if (!BN_GF2m_add(y2, x1, x2))
  ------------------
  |  Branch (451:9): [True: 0, False: 64]
  ------------------
  452|      0|        goto err;
  453|     64|    if (!group->meth->field_mul(group, y2, y2, s, ctx))
  ------------------
  |  Branch (453:9): [True: 0, False: 64]
  ------------------
  454|      0|        goto err;
  455|     64|    if (!BN_GF2m_add(y2, y2, x2))
  ------------------
  |  Branch (455:9): [True: 0, False: 64]
  ------------------
  456|      0|        goto err;
  457|     64|    if (!BN_GF2m_add(y2, y2, y1))
  ------------------
  |  Branch (457:9): [True: 0, False: 64]
  ------------------
  458|      0|        goto err;
  459|       |
  460|     64|    if (!EC_POINT_set_affine_coordinates(group, r, x2, y2, ctx))
  ------------------
  |  Branch (460:9): [True: 0, False: 64]
  ------------------
  461|      0|        goto err;
  462|       |
  463|     64|    ret = 1;
  464|       |
  465|     64| err:
  466|     64|    BN_CTX_end(ctx);
  467|     64|#ifndef FIPS_MODULE
  468|     64|    BN_CTX_free(new_ctx);
  469|     64|#endif
  470|     64|    return ret;
  471|     64|}
ossl_ec_GF2m_simple_is_at_infinity:
  499|  19.0k|{
  500|  19.0k|    return BN_is_zero(point->Z);
  501|  19.0k|}
ossl_ec_GF2m_simple_is_on_curve:
  510|  18.7k|{
  511|  18.7k|    int ret = -1;
  512|  18.7k|    BIGNUM *lh, *y2;
  513|  18.7k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  514|  18.7k|                      const BIGNUM *, BN_CTX *);
  515|  18.7k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  516|  18.7k|#ifndef FIPS_MODULE
  517|  18.7k|    BN_CTX *new_ctx = NULL;
  518|  18.7k|#endif
  519|       |
  520|  18.7k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (520:9): [True: 0, False: 18.7k]
  ------------------
  521|      0|        return 1;
  522|       |
  523|  18.7k|    field_mul = group->meth->field_mul;
  524|  18.7k|    field_sqr = group->meth->field_sqr;
  525|       |
  526|       |    /* only support affine coordinates */
  527|  18.7k|    if (!point->Z_is_one)
  ------------------
  |  Branch (527:9): [True: 0, False: 18.7k]
  ------------------
  528|      0|        return -1;
  529|       |
  530|  18.7k|#ifndef FIPS_MODULE
  531|  18.7k|    if (ctx == NULL) {
  ------------------
  |  Branch (531:9): [True: 0, False: 18.7k]
  ------------------
  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|  18.7k|#endif
  537|       |
  538|  18.7k|    BN_CTX_start(ctx);
  539|  18.7k|    y2 = BN_CTX_get(ctx);
  540|  18.7k|    lh = BN_CTX_get(ctx);
  541|  18.7k|    if (lh == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 18.7k]
  ------------------
  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|  18.7k|    if (!BN_GF2m_add(lh, point->X, group->a))
  ------------------
  |  Branch (550:9): [True: 0, False: 18.7k]
  ------------------
  551|      0|        goto err;
  552|  18.7k|    if (!field_mul(group, lh, lh, point->X, ctx))
  ------------------
  |  Branch (552:9): [True: 0, False: 18.7k]
  ------------------
  553|      0|        goto err;
  554|  18.7k|    if (!BN_GF2m_add(lh, lh, point->Y))
  ------------------
  |  Branch (554:9): [True: 0, False: 18.7k]
  ------------------
  555|      0|        goto err;
  556|  18.7k|    if (!field_mul(group, lh, lh, point->X, ctx))
  ------------------
  |  Branch (556:9): [True: 0, False: 18.7k]
  ------------------
  557|      0|        goto err;
  558|  18.7k|    if (!BN_GF2m_add(lh, lh, group->b))
  ------------------
  |  Branch (558:9): [True: 0, False: 18.7k]
  ------------------
  559|      0|        goto err;
  560|  18.7k|    if (!field_sqr(group, y2, point->Y, ctx))
  ------------------
  |  Branch (560:9): [True: 0, False: 18.7k]
  ------------------
  561|      0|        goto err;
  562|  18.7k|    if (!BN_GF2m_add(lh, lh, y2))
  ------------------
  |  Branch (562:9): [True: 0, False: 18.7k]
  ------------------
  563|      0|        goto err;
  564|  18.7k|    ret = BN_is_zero(lh);
  565|       |
  566|  18.7k| err:
  567|  18.7k|    BN_CTX_end(ctx);
  568|  18.7k|#ifndef FIPS_MODULE
  569|  18.7k|    BN_CTX_free(new_ctx);
  570|  18.7k|#endif
  571|  18.7k|    return ret;
  572|  18.7k|}
ossl_ec_GF2m_simple_field_mul:
  697|   318k|{
  698|   318k|    return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
  699|   318k|}
ossl_ec_GF2m_simple_field_sqr:
  704|   255k|{
  705|   255k|    return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
  706|   255k|}
ossl_ec_GF2m_simple_field_div:
  711|  6.74k|{
  712|  6.74k|    return BN_GF2m_mod_div(r, a, b, group->field, ctx);
  713|  6.74k|}
EC_GF2m_simple_method:
  940|  13.6k|{
  941|  13.6k|    static const EC_METHOD ret = {
  942|  13.6k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  13.6k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  943|  13.6k|        NID_X9_62_characteristic_two_field,
  ------------------
  |  |  156|  13.6k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  944|  13.6k|        ossl_ec_GF2m_simple_group_init,
  945|  13.6k|        ossl_ec_GF2m_simple_group_finish,
  946|  13.6k|        ossl_ec_GF2m_simple_group_clear_finish,
  947|  13.6k|        ossl_ec_GF2m_simple_group_copy,
  948|  13.6k|        ossl_ec_GF2m_simple_group_set_curve,
  949|  13.6k|        ossl_ec_GF2m_simple_group_get_curve,
  950|  13.6k|        ossl_ec_GF2m_simple_group_get_degree,
  951|  13.6k|        ossl_ec_group_simple_order_bits,
  952|  13.6k|        ossl_ec_GF2m_simple_group_check_discriminant,
  953|  13.6k|        ossl_ec_GF2m_simple_point_init,
  954|  13.6k|        ossl_ec_GF2m_simple_point_finish,
  955|  13.6k|        ossl_ec_GF2m_simple_point_clear_finish,
  956|  13.6k|        ossl_ec_GF2m_simple_point_copy,
  957|  13.6k|        ossl_ec_GF2m_simple_point_set_to_infinity,
  958|  13.6k|        ossl_ec_GF2m_simple_point_set_affine_coordinates,
  959|  13.6k|        ossl_ec_GF2m_simple_point_get_affine_coordinates,
  960|  13.6k|        0, /* point_set_compressed_coordinates */
  961|  13.6k|        0, /* point2oct */
  962|  13.6k|        0, /* oct2point */
  963|  13.6k|        ossl_ec_GF2m_simple_add,
  964|  13.6k|        ossl_ec_GF2m_simple_dbl,
  965|  13.6k|        ossl_ec_GF2m_simple_invert,
  966|  13.6k|        ossl_ec_GF2m_simple_is_at_infinity,
  967|  13.6k|        ossl_ec_GF2m_simple_is_on_curve,
  968|  13.6k|        ossl_ec_GF2m_simple_cmp,
  969|  13.6k|        ossl_ec_GF2m_simple_make_affine,
  970|  13.6k|        ossl_ec_GF2m_simple_points_make_affine,
  971|  13.6k|        ec_GF2m_simple_points_mul,
  972|  13.6k|        0, /* precompute_mult */
  973|  13.6k|        0, /* have_precompute_mult */
  974|  13.6k|        ossl_ec_GF2m_simple_field_mul,
  975|  13.6k|        ossl_ec_GF2m_simple_field_sqr,
  976|  13.6k|        ossl_ec_GF2m_simple_field_div,
  977|  13.6k|        ec_GF2m_simple_field_inv,
  978|  13.6k|        0, /* field_encode */
  979|  13.6k|        0, /* field_decode */
  980|  13.6k|        0, /* field_set_to_one */
  981|  13.6k|        ossl_ec_key_simple_priv2oct,
  982|  13.6k|        ossl_ec_key_simple_oct2priv,
  983|  13.6k|        0, /* set private */
  984|  13.6k|        ossl_ec_key_simple_generate_key,
  985|  13.6k|        ossl_ec_key_simple_check_key,
  986|  13.6k|        ossl_ec_key_simple_generate_public_key,
  987|  13.6k|        0, /* keycopy */
  988|  13.6k|        0, /* keyfinish */
  989|  13.6k|        ossl_ecdh_simple_compute_key,
  990|  13.6k|        ossl_ecdsa_simple_sign_setup,
  991|  13.6k|        ossl_ecdsa_simple_sign_sig,
  992|  13.6k|        ossl_ecdsa_simple_verify_sig,
  993|  13.6k|        0, /* field_inverse_mod_ord */
  994|  13.6k|        0, /* blind_coordinates */
  995|  13.6k|        ec_GF2m_simple_ladder_pre,
  996|  13.6k|        ec_GF2m_simple_ladder_step,
  997|  13.6k|        ec_GF2m_simple_ladder_post
  998|  13.6k|    };
  999|       |
 1000|  13.6k|    return &ret;
 1001|  13.6k|}
ec2_smpl.c:ec_GF2m_simple_points_mul:
  873|     64|{
  874|     64|    int ret = 0;
  875|     64|    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|     64|    if (num > 1 || BN_is_zero(group->order) || BN_is_zero(group->cofactor))
  ------------------
  |  Branch (891:9): [True: 0, False: 64]
  |  Branch (891:20): [True: 0, False: 64]
  |  Branch (891:48): [True: 0, False: 64]
  ------------------
  892|      0|        return ossl_ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
  893|       |
  894|     64|    if (scalar != NULL && num == 0)
  ------------------
  |  Branch (894:9): [True: 64, False: 0]
  |  Branch (894:27): [True: 0, False: 64]
  ------------------
  895|       |        /* Fixed point multiplication */
  896|      0|        return ossl_ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
  897|       |
  898|     64|    if (scalar == NULL && num == 1)
  ------------------
  |  Branch (898:9): [True: 0, False: 64]
  |  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|     64|    if ((t = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (907:9): [True: 0, False: 64]
  ------------------
  908|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  909|      0|        return 0;
  910|      0|    }
  911|       |
  912|     64|    if (!ossl_ec_scalar_mul_ladder(group, t, scalar, NULL, ctx)
  ------------------
  |  Branch (912:9): [True: 0, False: 64]
  ------------------
  913|     64|        || !ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx)
  ------------------
  |  Branch (913:12): [True: 0, False: 64]
  ------------------
  914|     64|        || !EC_POINT_add(group, r, t, r, ctx))
  ------------------
  |  Branch (914:12): [True: 0, False: 64]
  ------------------
  915|      0|        goto err;
  916|       |
  917|     64|    ret = 1;
  918|       |
  919|     64| err:
  920|     64|    EC_POINT_free(t);
  921|     64|    return ret;
  922|     64|}
ec2_smpl.c:ec_GF2m_simple_field_inv:
  931|    128|{
  932|    128|    int ret;
  933|       |
  934|    128|    if (!(ret = BN_GF2m_mod_inv(r, a, group->field, ctx)))
  ------------------
  |  Branch (934:9): [True: 0, False: 128]
  ------------------
  935|    128|        ERR_raise(ERR_LIB_EC, EC_R_CANNOT_INVERT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  936|    128|    return ret;
  937|    128|}
ec2_smpl.c:ec_GF2m_simple_ladder_pre:
  725|    128|{
  726|       |    /* if p is not affine, something is wrong */
  727|    128|    if (p->Z_is_one == 0)
  ------------------
  |  Branch (727:9): [True: 0, False: 128]
  ------------------
  728|      0|        return 0;
  729|       |
  730|       |    /* s blinding: make sure lambda (s->Z here) is not zero */
  731|    128|    do {
  732|    128|        if (!BN_priv_rand_ex(s->Z, BN_num_bits(group->field) - 1,
  ------------------
  |  Branch (732:13): [True: 0, False: 128]
  ------------------
  733|    128|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   80|    128|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   85|    128|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  734|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  735|      0|            return 0;
  736|      0|        }
  737|    128|    } while (BN_is_zero(s->Z));
  ------------------
  |  Branch (737:14): [True: 0, False: 128]
  ------------------
  738|       |
  739|       |    /* if field_encode defined convert between representations */
  740|    128|    if ((group->meth->field_encode != NULL
  ------------------
  |  Branch (740:10): [True: 0, False: 128]
  ------------------
  741|    128|         && !group->meth->field_encode(group, s->Z, s->Z, ctx))
  ------------------
  |  Branch (741:13): [True: 0, False: 0]
  ------------------
  742|    128|        || !group->meth->field_mul(group, s->X, p->X, s->Z, ctx))
  ------------------
  |  Branch (742:12): [True: 0, False: 128]
  ------------------
  743|      0|        return 0;
  744|       |
  745|       |    /* r blinding: make sure lambda (r->Y here for storage) is not zero */
  746|    128|    do {
  747|    128|        if (!BN_priv_rand_ex(r->Y, BN_num_bits(group->field) - 1,
  ------------------
  |  Branch (747:13): [True: 0, False: 128]
  ------------------
  748|    128|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   80|    128|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx)) {
  ------------------
  |  |   85|    128|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  749|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|            return 0;
  751|      0|        }
  752|    128|    } while (BN_is_zero(r->Y));
  ------------------
  |  Branch (752:14): [True: 0, False: 128]
  ------------------
  753|       |
  754|    128|    if ((group->meth->field_encode != NULL
  ------------------
  |  Branch (754:10): [True: 0, False: 128]
  ------------------
  755|    128|         && !group->meth->field_encode(group, r->Y, r->Y, ctx))
  ------------------
  |  Branch (755:13): [True: 0, False: 0]
  ------------------
  756|    128|        || !group->meth->field_sqr(group, r->Z, p->X, ctx)
  ------------------
  |  Branch (756:12): [True: 0, False: 128]
  ------------------
  757|    128|        || !group->meth->field_sqr(group, r->X, r->Z, ctx)
  ------------------
  |  Branch (757:12): [True: 0, False: 128]
  ------------------
  758|    128|        || !BN_GF2m_add(r->X, r->X, group->b)
  ------------------
  |  Branch (758:12): [True: 0, False: 128]
  ------------------
  759|    128|        || !group->meth->field_mul(group, r->Z, r->Z, r->Y, ctx)
  ------------------
  |  Branch (759:12): [True: 0, False: 128]
  ------------------
  760|    128|        || !group->meth->field_mul(group, r->X, r->X, r->Y, ctx))
  ------------------
  |  Branch (760:12): [True: 0, False: 128]
  ------------------
  761|      0|        return 0;
  762|       |
  763|    128|    s->Z_is_one = 0;
  764|    128|    r->Z_is_one = 0;
  765|       |
  766|    128|    return 1;
  767|    128|}
ec2_smpl.c:ec_GF2m_simple_ladder_step:
  778|  45.9k|{
  779|  45.9k|    if (!group->meth->field_mul(group, r->Y, r->Z, s->X, ctx)
  ------------------
  |  Branch (779:9): [True: 0, False: 45.9k]
  ------------------
  780|  45.9k|        || !group->meth->field_mul(group, s->X, r->X, s->Z, ctx)
  ------------------
  |  Branch (780:12): [True: 0, False: 45.9k]
  ------------------
  781|  45.9k|        || !group->meth->field_sqr(group, s->Y, r->Z, ctx)
  ------------------
  |  Branch (781:12): [True: 0, False: 45.9k]
  ------------------
  782|  45.9k|        || !group->meth->field_sqr(group, r->Z, r->X, ctx)
  ------------------
  |  Branch (782:12): [True: 0, False: 45.9k]
  ------------------
  783|  45.9k|        || !BN_GF2m_add(s->Z, r->Y, s->X)
  ------------------
  |  Branch (783:12): [True: 0, False: 45.9k]
  ------------------
  784|  45.9k|        || !group->meth->field_sqr(group, s->Z, s->Z, ctx)
  ------------------
  |  Branch (784:12): [True: 0, False: 45.9k]
  ------------------
  785|  45.9k|        || !group->meth->field_mul(group, s->X, r->Y, s->X, ctx)
  ------------------
  |  Branch (785:12): [True: 0, False: 45.9k]
  ------------------
  786|  45.9k|        || !group->meth->field_mul(group, r->Y, s->Z, p->X, ctx)
  ------------------
  |  Branch (786:12): [True: 0, False: 45.9k]
  ------------------
  787|  45.9k|        || !BN_GF2m_add(s->X, s->X, r->Y)
  ------------------
  |  Branch (787:12): [True: 0, False: 45.9k]
  ------------------
  788|  45.9k|        || !group->meth->field_sqr(group, r->Y, r->Z, ctx)
  ------------------
  |  Branch (788:12): [True: 0, False: 45.9k]
  ------------------
  789|  45.9k|        || !group->meth->field_mul(group, r->Z, r->Z, s->Y, ctx)
  ------------------
  |  Branch (789:12): [True: 0, False: 45.9k]
  ------------------
  790|  45.9k|        || !group->meth->field_sqr(group, s->Y, s->Y, ctx)
  ------------------
  |  Branch (790:12): [True: 0, False: 45.9k]
  ------------------
  791|  45.9k|        || !group->meth->field_mul(group, s->Y, s->Y, group->b, ctx)
  ------------------
  |  Branch (791:12): [True: 0, False: 45.9k]
  ------------------
  792|  45.9k|        || !BN_GF2m_add(r->X, r->Y, s->Y))
  ------------------
  |  Branch (792:12): [True: 0, False: 45.9k]
  ------------------
  793|      0|        return 0;
  794|       |
  795|  45.9k|    return 1;
  796|  45.9k|}
ec2_smpl.c:ec_GF2m_simple_ladder_post:
  808|    128|{
  809|    128|    int ret = 0;
  810|    128|    BIGNUM *t0, *t1, *t2 = NULL;
  811|       |
  812|    128|    if (BN_is_zero(r->Z))
  ------------------
  |  Branch (812:9): [True: 0, False: 128]
  ------------------
  813|      0|        return EC_POINT_set_to_infinity(group, r);
  814|       |
  815|    128|    if (BN_is_zero(s->Z)) {
  ------------------
  |  Branch (815:9): [True: 0, False: 128]
  ------------------
  816|      0|        if (!EC_POINT_copy(r, p)
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      0|            || !EC_POINT_invert(group, r, ctx)) {
  ------------------
  |  Branch (817:16): [True: 0, False: 0]
  ------------------
  818|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  819|      0|            return 0;
  820|      0|        }
  821|      0|        return 1;
  822|      0|    }
  823|       |
  824|    128|    BN_CTX_start(ctx);
  825|    128|    t0 = BN_CTX_get(ctx);
  826|    128|    t1 = BN_CTX_get(ctx);
  827|    128|    t2 = BN_CTX_get(ctx);
  828|    128|    if (t2 == NULL) {
  ------------------
  |  Branch (828:9): [True: 0, False: 128]
  ------------------
  829|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  830|      0|        goto err;
  831|      0|    }
  832|       |
  833|    128|    if (!group->meth->field_mul(group, t0, r->Z, s->Z, ctx)
  ------------------
  |  Branch (833:9): [True: 0, False: 128]
  ------------------
  834|    128|        || !group->meth->field_mul(group, t1, p->X, r->Z, ctx)
  ------------------
  |  Branch (834:12): [True: 0, False: 128]
  ------------------
  835|    128|        || !BN_GF2m_add(t1, r->X, t1)
  ------------------
  |  Branch (835:12): [True: 0, False: 128]
  ------------------
  836|    128|        || !group->meth->field_mul(group, t2, p->X, s->Z, ctx)
  ------------------
  |  Branch (836:12): [True: 0, False: 128]
  ------------------
  837|    128|        || !group->meth->field_mul(group, r->Z, r->X, t2, ctx)
  ------------------
  |  Branch (837:12): [True: 0, False: 128]
  ------------------
  838|    128|        || !BN_GF2m_add(t2, t2, s->X)
  ------------------
  |  Branch (838:12): [True: 0, False: 128]
  ------------------
  839|    128|        || !group->meth->field_mul(group, t1, t1, t2, ctx)
  ------------------
  |  Branch (839:12): [True: 0, False: 128]
  ------------------
  840|    128|        || !group->meth->field_sqr(group, t2, p->X, ctx)
  ------------------
  |  Branch (840:12): [True: 0, False: 128]
  ------------------
  841|    128|        || !BN_GF2m_add(t2, p->Y, t2)
  ------------------
  |  Branch (841:12): [True: 0, False: 128]
  ------------------
  842|    128|        || !group->meth->field_mul(group, t2, t2, t0, ctx)
  ------------------
  |  Branch (842:12): [True: 0, False: 128]
  ------------------
  843|    128|        || !BN_GF2m_add(t1, t2, t1)
  ------------------
  |  Branch (843:12): [True: 0, False: 128]
  ------------------
  844|    128|        || !group->meth->field_mul(group, t2, p->X, t0, ctx)
  ------------------
  |  Branch (844:12): [True: 0, False: 128]
  ------------------
  845|    128|        || !group->meth->field_inv(group, t2, t2, ctx)
  ------------------
  |  Branch (845:12): [True: 0, False: 128]
  ------------------
  846|    128|        || !group->meth->field_mul(group, t1, t1, t2, ctx)
  ------------------
  |  Branch (846:12): [True: 0, False: 128]
  ------------------
  847|    128|        || !group->meth->field_mul(group, r->X, r->Z, t2, ctx)
  ------------------
  |  Branch (847:12): [True: 0, False: 128]
  ------------------
  848|    128|        || !BN_GF2m_add(t2, p->X, r->X)
  ------------------
  |  Branch (848:12): [True: 0, False: 128]
  ------------------
  849|    128|        || !group->meth->field_mul(group, t2, t2, t1, ctx)
  ------------------
  |  Branch (849:12): [True: 0, False: 128]
  ------------------
  850|    128|        || !BN_GF2m_add(r->Y, p->Y, t2)
  ------------------
  |  Branch (850:12): [True: 0, False: 128]
  ------------------
  851|    128|        || !BN_one(r->Z))
  ------------------
  |  |  197|    128|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (851:12): [True: 0, False: 128]
  ------------------
  852|      0|        goto err;
  853|       |
  854|    128|    r->Z_is_one = 1;
  855|       |
  856|       |    /* GF(2^m) field elements should always have BIGNUM::neg = 0 */
  857|    128|    BN_set_negative(r->X, 0);
  858|    128|    BN_set_negative(r->Y, 0);
  859|       |
  860|    128|    ret = 1;
  861|       |
  862|    128| err:
  863|    128|    BN_CTX_end(ctx);
  864|    128|    return ret;
  865|    128|}

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

d2i_ECPKParameters:
  886|  5.65k|{
  887|  5.65k|    EC_GROUP *group = NULL;
  888|  5.65k|    ECPKPARAMETERS *params = NULL;
  889|  5.65k|    const unsigned char *p = *in;
  890|       |
  891|  5.65k|    if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) {
  ------------------
  |  Branch (891:9): [True: 5.65k, False: 0]
  ------------------
  892|  5.65k|        ECPKPARAMETERS_free(params);
  893|  5.65k|        return NULL;
  894|  5.65k|    }
  895|       |
  896|      0|    if ((group = EC_GROUP_new_from_ecpkparameters(params)) == NULL) {
  ------------------
  |  Branch (896:9): [True: 0, False: 0]
  ------------------
  897|      0|        ECPKPARAMETERS_free(params);
  898|      0|        return NULL;
  899|      0|    }
  900|       |
  901|      0|    if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|        group->decoded_from_explicit_params = 1;
  903|       |
  904|      0|    if (a) {
  ------------------
  |  Branch (904:9): [True: 0, False: 0]
  ------------------
  905|      0|        EC_GROUP_free(*a);
  906|      0|        *a = group;
  907|      0|    }
  908|       |
  909|      0|    ECPKPARAMETERS_free(params);
  910|      0|    *in = p;
  911|      0|    return group;
  912|      0|}
d2i_ECParameters:
 1098|  2.82k|{
 1099|  2.82k|    EC_KEY *ret;
 1100|       |
 1101|  2.82k|    if (in == NULL || *in == NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 2.82k]
  |  Branch (1101:23): [True: 0, False: 2.82k]
  ------------------
 1102|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1103|      0|        return NULL;
 1104|      0|    }
 1105|       |
 1106|  2.82k|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (1106:9): [True: 0, False: 2.82k]
  |  Branch (1106:22): [True: 0, False: 2.82k]
  ------------------
 1107|      0|        if ((ret = EC_KEY_new()) == NULL) {
  ------------------
  |  Branch (1107:13): [True: 0, False: 0]
  ------------------
 1108|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1109|      0|            return NULL;
 1110|      0|        }
 1111|      0|    } else
 1112|  2.82k|        ret = *a;
 1113|       |
 1114|  2.82k|    if (!d2i_ECPKParameters(&ret->group, in, len)) {
  ------------------
  |  Branch (1114:9): [True: 2.82k, False: 0]
  ------------------
 1115|  2.82k|        if (a == NULL || *a != ret)
  ------------------
  |  Branch (1115:13): [True: 0, False: 2.82k]
  |  Branch (1115:26): [True: 0, False: 2.82k]
  ------------------
 1116|      0|             EC_KEY_free(ret);
 1117|  2.82k|        else
 1118|  2.82k|            ret->dirty_cnt++;
 1119|  2.82k|        return NULL;
 1120|  2.82k|    }
 1121|       |
 1122|      0|    if (EC_GROUP_get_curve_name(ret->group) == NID_sm2)
  ------------------
  |  | 1232|      0|#define NID_sm2         1172
  ------------------
  |  Branch (1122:9): [True: 0, False: 0]
  ------------------
 1123|      0|        EC_KEY_set_flags(ret, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      0|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
 1124|       |
 1125|      0|    ret->dirty_cnt++;
 1126|       |
 1127|      0|    if (a)
  ------------------
  |  Branch (1127:9): [True: 0, False: 0]
  ------------------
 1128|      0|        *a = ret;
 1129|       |
 1130|      0|    return ret;
 1131|  2.82k|}
o2i_ECPublicKey:
 1134|  27.4k|{
 1135|  27.4k|    EC_KEY *ret = NULL;
 1136|       |
 1137|  27.4k|    if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
  ------------------
  |  Branch (1137:9): [True: 0, False: 27.4k]
  |  Branch (1137:22): [True: 0, False: 27.4k]
  |  Branch (1137:38): [True: 0, False: 27.4k]
  ------------------
 1138|       |        /*
 1139|       |         * sorry, but a EC_GROUP-structure is necessary to set the public key
 1140|       |         */
 1141|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        return 0;
 1143|      0|    }
 1144|  27.4k|    ret = *a;
 1145|       |    /* EC_KEY_opt2key updates dirty_cnt */
 1146|  27.4k|    if (!EC_KEY_oct2key(ret, *in, len, NULL)) {
  ------------------
  |  Branch (1146:9): [True: 14.9k, False: 12.4k]
  ------------------
 1147|  14.9k|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|  14.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  14.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  14.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  14.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  14.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  14.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1148|  14.9k|        return 0;
 1149|  14.9k|    }
 1150|  12.4k|    *in += len;
 1151|  12.4k|    return ret;
 1152|  27.4k|}
ECDSA_SIG_new:
 1196|    160|{
 1197|    160|    ECDSA_SIG *sig = OPENSSL_zalloc(sizeof(*sig));
  ------------------
  |  |  104|    160|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1198|       |
 1199|    160|    return sig;
 1200|    160|}
ECDSA_SIG_free:
 1203|    160|{
 1204|    160|    if (sig == NULL)
  ------------------
  |  Branch (1204:9): [True: 0, False: 160]
  ------------------
 1205|      0|        return;
 1206|    160|    BN_clear_free(sig->r);
 1207|    160|    BN_clear_free(sig->s);
 1208|    160|    OPENSSL_free(sig);
  ------------------
  |  |  115|    160|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1209|    160|}
d2i_ECDSA_SIG:
 1212|    160|{
 1213|    160|    ECDSA_SIG *sig;
 1214|       |
 1215|    160|    if (len < 0)
  ------------------
  |  Branch (1215:9): [True: 0, False: 160]
  ------------------
 1216|      0|        return NULL;
 1217|    160|    if (psig != NULL && *psig != NULL) {
  ------------------
  |  Branch (1217:9): [True: 160, False: 0]
  |  Branch (1217:25): [True: 160, False: 0]
  ------------------
 1218|    160|        sig = *psig;
 1219|    160|    } else {
 1220|      0|        sig = ECDSA_SIG_new();
 1221|      0|        if (sig == NULL)
  ------------------
  |  Branch (1221:13): [True: 0, False: 0]
  ------------------
 1222|      0|            return NULL;
 1223|      0|    }
 1224|    160|    if (sig->r == NULL)
  ------------------
  |  Branch (1224:9): [True: 160, False: 0]
  ------------------
 1225|    160|        sig->r = BN_new();
 1226|    160|    if (sig->s == NULL)
  ------------------
  |  Branch (1226:9): [True: 160, False: 0]
  ------------------
 1227|    160|        sig->s = BN_new();
 1228|    160|    if (sig->r == NULL || sig->s == NULL
  ------------------
  |  Branch (1228:9): [True: 0, False: 160]
  |  Branch (1228:27): [True: 0, False: 160]
  ------------------
 1229|    160|        || ossl_decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) {
  ------------------
  |  Branch (1229:12): [True: 78, False: 82]
  ------------------
 1230|     78|        if (psig == NULL || *psig == NULL)
  ------------------
  |  Branch (1230:13): [True: 0, False: 78]
  |  Branch (1230:29): [True: 0, False: 78]
  ------------------
 1231|      0|            ECDSA_SIG_free(sig);
 1232|     78|        return NULL;
 1233|     78|    }
 1234|     82|    if (psig != NULL && *psig == NULL)
  ------------------
  |  Branch (1234:9): [True: 82, False: 0]
  |  Branch (1234:25): [True: 0, False: 82]
  ------------------
 1235|      0|        *psig = sig;
 1236|     82|    return sig;
 1237|    160|}
i2d_ECDSA_SIG:
 1240|  12.4k|{
 1241|  12.4k|    BUF_MEM *buf = NULL;
 1242|  12.4k|    size_t encoded_len;
 1243|  12.4k|    WPACKET pkt;
 1244|       |
 1245|  12.4k|    if (ppout == NULL) {
  ------------------
  |  Branch (1245:9): [True: 12.4k, False: 82]
  ------------------
 1246|  12.4k|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (1246:13): [True: 0, False: 12.4k]
  ------------------
 1247|      0|            return -1;
 1248|  12.4k|    } else if (*ppout == NULL) {
  ------------------
  |  Branch (1248:16): [True: 82, False: 0]
  ------------------
 1249|     82|        if ((buf = BUF_MEM_new()) == NULL
  ------------------
  |  Branch (1249:13): [True: 0, False: 82]
  ------------------
 1250|     82|                || !WPACKET_init_len(&pkt, buf, 0)) {
  ------------------
  |  Branch (1250:20): [True: 0, False: 82]
  ------------------
 1251|      0|            BUF_MEM_free(buf);
 1252|      0|            return -1;
 1253|      0|        }
 1254|     82|    } 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|  12.4k|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (1259:9): [True: 0, False: 12.4k]
  ------------------
 1260|  12.4k|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (1260:16): [True: 0, False: 12.4k]
  ------------------
 1261|  12.4k|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (1261:16): [True: 0, False: 12.4k]
  ------------------
 1262|      0|        BUF_MEM_free(buf);
 1263|      0|        WPACKET_cleanup(&pkt);
 1264|      0|        return -1;
 1265|      0|    }
 1266|       |
 1267|  12.4k|    if (ppout != NULL) {
  ------------------
  |  Branch (1267:9): [True: 82, False: 12.4k]
  ------------------
 1268|     82|        if (*ppout == NULL) {
  ------------------
  |  Branch (1268:13): [True: 82, False: 0]
  ------------------
 1269|     82|            *ppout = (unsigned char *)buf->data;
 1270|     82|            buf->data = NULL;
 1271|     82|            BUF_MEM_free(buf);
 1272|     82|        } else {
 1273|      0|            *ppout += encoded_len;
 1274|      0|        }
 1275|     82|    }
 1276|       |
 1277|  12.4k|    return (int)encoded_len;
 1278|  12.4k|}
ECDSA_size:
 1310|  12.4k|{
 1311|  12.4k|    int ret;
 1312|  12.4k|    ECDSA_SIG sig;
 1313|  12.4k|    const EC_GROUP *group;
 1314|  12.4k|    const BIGNUM *bn;
 1315|       |
 1316|  12.4k|    if (ec == NULL)
  ------------------
  |  Branch (1316:9): [True: 0, False: 12.4k]
  ------------------
 1317|      0|        return 0;
 1318|  12.4k|    group = EC_KEY_get0_group(ec);
 1319|  12.4k|    if (group == NULL)
  ------------------
  |  Branch (1319:9): [True: 0, False: 12.4k]
  ------------------
 1320|      0|        return 0;
 1321|       |
 1322|  12.4k|    bn = EC_GROUP_get0_order(group);
 1323|  12.4k|    if (bn == NULL)
  ------------------
  |  Branch (1323:9): [True: 0, False: 12.4k]
  ------------------
 1324|      0|        return 0;
 1325|       |
 1326|  12.4k|    sig.r = sig.s = (BIGNUM *)bn;
 1327|  12.4k|    ret = i2d_ECDSA_SIG(&sig, NULL);
 1328|       |
 1329|  12.4k|    if (ret < 0)
  ------------------
  |  Branch (1329:9): [True: 0, False: 12.4k]
  ------------------
 1330|      0|        ret = 0;
 1331|  12.4k|    return ret;
 1332|  12.4k|}

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

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

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

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

EC_KEY_new_ex:
   41|  32.7k|{
   42|  32.7k|    return ossl_ec_key_new_method_int(ctx, propq, NULL);
   43|  32.7k|}
EC_KEY_free:
   72|  98.7k|{
   73|  98.7k|    int i;
   74|       |
   75|  98.7k|    if (r == NULL)
  ------------------
  |  Branch (75:9): [True: 53.2k, False: 45.4k]
  ------------------
   76|  53.2k|        return;
   77|       |
   78|  45.4k|    CRYPTO_DOWN_REF(&r->references, &i);
   79|  45.4k|    REF_PRINT_COUNT("EC_KEY", i, r);
  ------------------
  |  |  301|  45.4k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  45.4k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  45.4k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  45.4k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  45.4k|    if (i > 0)
  ------------------
  |  Branch (80:9): [True: 12.7k, False: 32.7k]
  ------------------
   81|  12.7k|        return;
   82|  32.7k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  32.7k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 32.7k]
  |  |  ------------------
  ------------------
   83|       |
   84|  32.7k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (84:9): [True: 32.7k, False: 0]
  |  Branch (84:28): [True: 0, False: 32.7k]
  ------------------
   85|      0|        r->meth->finish(r);
   86|       |
   87|  32.7k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   88|  32.7k|    ENGINE_finish(r->engine);
   89|  32.7k|#endif
   90|       |
   91|  32.7k|    if (r->group && r->group->meth->keyfinish)
  ------------------
  |  Branch (91:9): [True: 27.4k, False: 5.32k]
  |  Branch (91:21): [True: 0, False: 27.4k]
  ------------------
   92|      0|        r->group->meth->keyfinish(r);
   93|       |
   94|  32.7k|#ifndef FIPS_MODULE
   95|  32.7k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data);
  ------------------
  |  |  237|  32.7k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
   96|  32.7k|#endif
   97|  32.7k|    CRYPTO_FREE_REF(&r->references);
   98|  32.7k|    EC_GROUP_free(r->group);
   99|  32.7k|    EC_POINT_free(r->pub_key);
  100|  32.7k|    BN_clear_free(r->priv_key);
  101|  32.7k|    OPENSSL_free(r->propq);
  ------------------
  |  |  115|  32.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  32.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  32.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|       |
  103|  32.7k|    OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
  ------------------
  |  |  113|  32.7k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  32.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  32.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|  32.7k|}
EC_KEY_up_ref:
  194|  12.7k|{
  195|  12.7k|    int i;
  196|       |
  197|  12.7k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 12.7k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|  12.7k|    REF_PRINT_COUNT("EC_KEY", i, r);
  ------------------
  |  |  301|  12.7k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  12.7k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  12.7k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  12.7k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  12.7k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  12.7k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 12.7k]
  |  |  ------------------
  ------------------
  202|  12.7k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (202:13): [True: 12.7k, False: 0]
  ------------------
  203|  12.7k|}
ossl_ec_key_get_libctx:
  752|  24.8k|{
  753|  24.8k|    return key->libctx;
  754|  24.8k|}
ossl_ec_key_get0_propq:
  757|  12.4k|{
  758|  12.4k|    return key->propq;
  759|  12.4k|}
ossl_ec_key_set0_libctx:
  762|  12.4k|{
  763|  12.4k|    key->libctx = libctx;
  764|       |    /* Do we need to propagate this to the group? */
  765|  12.4k|}
EC_KEY_get0_group:
  768|  62.1k|{
  769|  62.1k|    return key->group;
  770|  62.1k|}
EC_KEY_set_group:
  773|  27.4k|{
  774|  27.4k|    if (key->meth->set_group != NULL && key->meth->set_group(key, group) == 0)
  ------------------
  |  Branch (774:9): [True: 0, False: 27.4k]
  |  Branch (774:41): [True: 0, False: 0]
  ------------------
  775|      0|        return 0;
  776|  27.4k|    EC_GROUP_free(key->group);
  777|  27.4k|    key->group = EC_GROUP_dup(group);
  778|  27.4k|    if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2)
  ------------------
  |  | 1232|  27.4k|#define NID_sm2         1172
  ------------------
  |  Branch (778:9): [True: 27.4k, False: 0]
  |  Branch (778:31): [True: 1.06k, False: 26.3k]
  ------------------
  779|  1.06k|        EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|  1.06k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  780|       |
  781|  27.4k|    key->dirty_cnt++;
  782|  27.4k|    return (key->group == NULL) ? 0 : 1;
  ------------------
  |  Branch (782:12): [True: 0, False: 27.4k]
  ------------------
  783|  27.4k|}
EC_KEY_get0_private_key:
  786|  12.4k|{
  787|  12.4k|    return key->priv_key;
  788|  12.4k|}
EC_KEY_get0_public_key:
  886|  12.4k|{
  887|  12.4k|    return key->pub_key;
  888|  12.4k|}
EC_KEY_get_enc_flags:
  902|  12.4k|{
  903|  12.4k|    return key->enc_flag;
  904|  12.4k|}
EC_KEY_get_conv_form:
  912|  12.4k|{
  913|  12.4k|    return key->conv_form;
  914|  12.4k|}
EC_KEY_get_flags:
  939|  48.6k|{
  940|  48.6k|    return key->flags;
  941|  48.6k|}
EC_KEY_set_flags:
  944|  1.06k|{
  945|  1.06k|    key->flags |= flags;
  946|  1.06k|    key->dirty_cnt++;
  947|  1.06k|}
EC_KEY_oct2key:
  972|  27.4k|{
  973|  27.4k|    if (key == NULL || key->group == NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 27.4k]
  |  Branch (973:24): [True: 0, False: 27.4k]
  ------------------
  974|      0|        return 0;
  975|  27.4k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (975:9): [True: 27.4k, False: 0]
  ------------------
  976|  27.4k|        key->pub_key = EC_POINT_new(key->group);
  977|  27.4k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (977:9): [True: 0, False: 27.4k]
  ------------------
  978|      0|        return 0;
  979|  27.4k|    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)
  ------------------
  |  Branch (979:9): [True: 14.9k, False: 12.4k]
  ------------------
  980|  14.9k|        return 0;
  981|  12.4k|    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|  12.4k|    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
  ------------------
  |  |   29|  12.4k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (989:9): [True: 12.4k, False: 0]
  ------------------
  990|  12.4k|        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
  991|  12.4k|    return 1;
  992|  27.4k|}
EC_KEY_can_sign:
 1083|     77|{
 1084|     77|    if (eckey->group == NULL || eckey->group->meth == NULL
  ------------------
  |  Branch (1084:9): [True: 0, False: 77]
  |  Branch (1084:33): [True: 0, False: 77]
  ------------------
 1085|     77|        || (eckey->group->meth->flags & EC_FLAGS_NO_SIGN))
  ------------------
  |  |   32|     77|#define EC_FLAGS_NO_SIGN        0x4
  ------------------
  |  Branch (1085:12): [True: 0, False: 77]
  ------------------
 1086|      0|        return 0;
 1087|     77|    return 1;
 1088|     77|}

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

ossl_ec_group_new_ex:
   32|  54.8k|{
   33|  54.8k|    EC_GROUP *ret;
   34|       |
   35|  54.8k|    if (meth == NULL) {
  ------------------
  |  Branch (35:9): [True: 0, False: 54.8k]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_EC, EC_R_SLOT_FULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        return NULL;
   38|      0|    }
   39|  54.8k|    if (meth->group_init == 0) {
  ------------------
  |  Branch (39:9): [True: 0, False: 54.8k]
  ------------------
   40|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   41|      0|        return NULL;
   42|      0|    }
   43|       |
   44|  54.8k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  54.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  54.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  54.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|  54.8k|    if (ret == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 54.8k]
  ------------------
   46|      0|        return NULL;
   47|       |
   48|  54.8k|    ret->libctx = libctx;
   49|  54.8k|    if (propq != NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 54.8k]
  ------------------
   50|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            goto err;
   53|      0|    }
   54|  54.8k|    ret->meth = meth;
   55|  54.8k|    if ((ret->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  54.8k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (55:9): [True: 54.8k, False: 0]
  ------------------
   56|  54.8k|        ret->order = BN_new();
   57|  54.8k|        if (ret->order == NULL)
  ------------------
  |  Branch (57:13): [True: 0, False: 54.8k]
  ------------------
   58|      0|            goto err;
   59|  54.8k|        ret->cofactor = BN_new();
   60|  54.8k|        if (ret->cofactor == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 54.8k]
  ------------------
   61|      0|            goto err;
   62|  54.8k|    }
   63|  54.8k|    ret->asn1_flag = OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  54.8k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
   64|  54.8k|    ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
   65|  54.8k|    if (!meth->group_init(ret))
  ------------------
  |  Branch (65:9): [True: 0, False: 54.8k]
  ------------------
   66|      0|        goto err;
   67|  54.8k|    return ret;
   68|       |
   69|      0| err:
   70|      0|    BN_free(ret->order);
   71|      0|    BN_free(ret->cofactor);
   72|      0|    OPENSSL_free(ret->propq);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|      0|    return NULL;
   75|  54.8k|}
EC_pre_comp_free:
   87|  54.8k|{
   88|  54.8k|    switch (group->pre_comp_type) {
  ------------------
  |  Branch (88:13): [True: 0, False: 54.8k]
  ------------------
   89|  54.8k|    case PCT_none:
  ------------------
  |  Branch (89:5): [True: 54.8k, False: 0]
  ------------------
   90|  54.8k|        break;
   91|      0|    case PCT_nistz256:
  ------------------
  |  Branch (91:5): [True: 0, False: 54.8k]
  ------------------
   92|      0|#ifdef ECP_NISTZ256_ASM
   93|      0|        EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
   94|      0|#endif
   95|      0|        break;
   96|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
   97|      0|    case PCT_nistp224:
  ------------------
  |  Branch (97:5): [True: 0, False: 54.8k]
  ------------------
   98|      0|        EC_nistp224_pre_comp_free(group->pre_comp.nistp224);
   99|      0|        break;
  100|      0|    case PCT_nistp256:
  ------------------
  |  Branch (100:5): [True: 0, False: 54.8k]
  ------------------
  101|      0|        EC_nistp256_pre_comp_free(group->pre_comp.nistp256);
  102|      0|        break;
  103|      0|    case PCT_nistp384:
  ------------------
  |  Branch (103:5): [True: 0, False: 54.8k]
  ------------------
  104|      0|        ossl_ec_nistp384_pre_comp_free(group->pre_comp.nistp384);
  105|      0|        break;
  106|      0|    case PCT_nistp521:
  ------------------
  |  Branch (106:5): [True: 0, False: 54.8k]
  ------------------
  107|      0|        EC_nistp521_pre_comp_free(group->pre_comp.nistp521);
  108|      0|        break;
  109|       |#else
  110|       |    case PCT_nistp224:
  111|       |    case PCT_nistp256:
  112|       |    case PCT_nistp384:
  113|       |    case PCT_nistp521:
  114|       |        break;
  115|       |#endif
  116|      0|    case PCT_ec:
  ------------------
  |  Branch (116:5): [True: 0, False: 54.8k]
  ------------------
  117|      0|        EC_ec_pre_comp_free(group->pre_comp.ec);
  118|      0|        break;
  119|  54.8k|    }
  120|  54.8k|    group->pre_comp.ec = NULL;
  121|  54.8k|}
EC_GROUP_free:
  124|  95.6k|{
  125|  95.6k|    if (!group)
  ------------------
  |  Branch (125:9): [True: 40.8k, False: 54.8k]
  ------------------
  126|  40.8k|        return;
  127|       |
  128|  54.8k|    if (group->meth->group_finish != 0)
  ------------------
  |  Branch (128:9): [True: 54.8k, False: 0]
  ------------------
  129|  54.8k|        group->meth->group_finish(group);
  130|       |
  131|  54.8k|    EC_pre_comp_free(group);
  132|  54.8k|    BN_MONT_CTX_free(group->mont_data);
  133|  54.8k|    EC_POINT_free(group->generator);
  134|  54.8k|    BN_free(group->order);
  135|  54.8k|    BN_free(group->cofactor);
  136|  54.8k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  54.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  54.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  54.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  54.8k|    OPENSSL_free(group->propq);
  ------------------
  |  |  115|  54.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  54.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  54.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  138|  54.8k|    OPENSSL_free(group);
  ------------------
  |  |  115|  54.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  54.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  54.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|  54.8k|}
EC_GROUP_copy:
  163|  27.4k|{
  164|  27.4k|    if (dest->meth->group_copy == 0) {
  ------------------
  |  Branch (164:9): [True: 0, False: 27.4k]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|        return 0;
  167|      0|    }
  168|  27.4k|    if (dest->meth != src->meth) {
  ------------------
  |  Branch (168:9): [True: 0, False: 27.4k]
  ------------------
  169|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|        return 0;
  171|      0|    }
  172|  27.4k|    if (dest == src)
  ------------------
  |  Branch (172:9): [True: 0, False: 27.4k]
  ------------------
  173|      0|        return 1;
  174|       |
  175|  27.4k|    dest->libctx = src->libctx;
  176|  27.4k|    dest->curve_name = src->curve_name;
  177|       |
  178|       |    /* Copy precomputed */
  179|  27.4k|    dest->pre_comp_type = src->pre_comp_type;
  180|  27.4k|    switch (src->pre_comp_type) {
  ------------------
  |  Branch (180:13): [True: 0, False: 27.4k]
  ------------------
  181|  27.4k|    case PCT_none:
  ------------------
  |  Branch (181:5): [True: 27.4k, False: 0]
  ------------------
  182|  27.4k|        dest->pre_comp.ec = NULL;
  183|  27.4k|        break;
  184|      0|    case PCT_nistz256:
  ------------------
  |  Branch (184:5): [True: 0, False: 27.4k]
  ------------------
  185|      0|#ifdef ECP_NISTZ256_ASM
  186|      0|        dest->pre_comp.nistz256 = EC_nistz256_pre_comp_dup(src->pre_comp.nistz256);
  187|      0|#endif
  188|      0|        break;
  189|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  190|      0|    case PCT_nistp224:
  ------------------
  |  Branch (190:5): [True: 0, False: 27.4k]
  ------------------
  191|      0|        dest->pre_comp.nistp224 = EC_nistp224_pre_comp_dup(src->pre_comp.nistp224);
  192|      0|        break;
  193|      0|    case PCT_nistp256:
  ------------------
  |  Branch (193:5): [True: 0, False: 27.4k]
  ------------------
  194|      0|        dest->pre_comp.nistp256 = EC_nistp256_pre_comp_dup(src->pre_comp.nistp256);
  195|      0|        break;
  196|      0|    case PCT_nistp384:
  ------------------
  |  Branch (196:5): [True: 0, False: 27.4k]
  ------------------
  197|      0|        dest->pre_comp.nistp384 = ossl_ec_nistp384_pre_comp_dup(src->pre_comp.nistp384);
  198|      0|        break;
  199|      0|    case PCT_nistp521:
  ------------------
  |  Branch (199:5): [True: 0, False: 27.4k]
  ------------------
  200|      0|        dest->pre_comp.nistp521 = EC_nistp521_pre_comp_dup(src->pre_comp.nistp521);
  201|      0|        break;
  202|       |#else
  203|       |    case PCT_nistp224:
  204|       |    case PCT_nistp256:
  205|       |    case PCT_nistp384:
  206|       |    case PCT_nistp521:
  207|       |        break;
  208|       |#endif
  209|      0|    case PCT_ec:
  ------------------
  |  Branch (209:5): [True: 0, False: 27.4k]
  ------------------
  210|      0|        dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
  211|      0|        break;
  212|  27.4k|    }
  213|       |
  214|  27.4k|    if (src->mont_data != NULL) {
  ------------------
  |  Branch (214:9): [True: 27.4k, False: 0]
  ------------------
  215|  27.4k|        if (dest->mont_data == NULL) {
  ------------------
  |  Branch (215:13): [True: 27.4k, False: 0]
  ------------------
  216|  27.4k|            dest->mont_data = BN_MONT_CTX_new();
  217|  27.4k|            if (dest->mont_data == NULL)
  ------------------
  |  Branch (217:17): [True: 0, False: 27.4k]
  ------------------
  218|      0|                return 0;
  219|  27.4k|        }
  220|  27.4k|        if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data))
  ------------------
  |  Branch (220:13): [True: 0, False: 27.4k]
  ------------------
  221|      0|            return 0;
  222|  27.4k|    } else {
  223|       |        /* src->generator == NULL */
  224|      0|        BN_MONT_CTX_free(dest->mont_data);
  225|      0|        dest->mont_data = NULL;
  226|      0|    }
  227|       |
  228|  27.4k|    if (src->generator != NULL) {
  ------------------
  |  Branch (228:9): [True: 27.4k, False: 0]
  ------------------
  229|  27.4k|        if (dest->generator == NULL) {
  ------------------
  |  Branch (229:13): [True: 27.4k, False: 0]
  ------------------
  230|  27.4k|            dest->generator = EC_POINT_new(dest);
  231|  27.4k|            if (dest->generator == NULL)
  ------------------
  |  Branch (231:17): [True: 0, False: 27.4k]
  ------------------
  232|      0|                return 0;
  233|  27.4k|        }
  234|  27.4k|        if (!EC_POINT_copy(dest->generator, src->generator))
  ------------------
  |  Branch (234:13): [True: 0, False: 27.4k]
  ------------------
  235|      0|            return 0;
  236|  27.4k|    } else {
  237|       |        /* src->generator == NULL */
  238|      0|        EC_POINT_clear_free(dest->generator);
  239|      0|        dest->generator = NULL;
  240|      0|    }
  241|       |
  242|  27.4k|    if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  27.4k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (242:9): [True: 27.4k, False: 0]
  ------------------
  243|  27.4k|        if (!BN_copy(dest->order, src->order))
  ------------------
  |  Branch (243:13): [True: 0, False: 27.4k]
  ------------------
  244|      0|            return 0;
  245|  27.4k|        if (!BN_copy(dest->cofactor, src->cofactor))
  ------------------
  |  Branch (245:13): [True: 0, False: 27.4k]
  ------------------
  246|      0|            return 0;
  247|  27.4k|    }
  248|       |
  249|  27.4k|    dest->asn1_flag = src->asn1_flag;
  250|  27.4k|    dest->asn1_form = src->asn1_form;
  251|  27.4k|    dest->decoded_from_explicit_params = src->decoded_from_explicit_params;
  252|       |
  253|  27.4k|    if (src->seed) {
  ------------------
  |  Branch (253:9): [True: 16.6k, False: 10.7k]
  ------------------
  254|  16.6k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|  16.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  16.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  16.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|  16.6k|        if ((dest->seed = OPENSSL_malloc(src->seed_len)) == NULL)
  ------------------
  |  |  102|  16.6k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  16.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  16.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (255:13): [True: 0, False: 16.6k]
  ------------------
  256|      0|            return 0;
  257|  16.6k|        if (!memcpy(dest->seed, src->seed, src->seed_len))
  ------------------
  |  Branch (257:13): [True: 0, False: 16.6k]
  ------------------
  258|      0|            return 0;
  259|  16.6k|        dest->seed_len = src->seed_len;
  260|  16.6k|    } else {
  261|  10.7k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|  10.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  10.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  10.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  262|  10.7k|        dest->seed = NULL;
  263|  10.7k|        dest->seed_len = 0;
  264|  10.7k|    }
  265|       |
  266|  27.4k|    return dest->meth->group_copy(dest, src);
  267|  27.4k|}
EC_GROUP_dup:
  270|  27.4k|{
  271|  27.4k|    EC_GROUP *t = NULL;
  272|  27.4k|    int ok = 0;
  273|       |
  274|  27.4k|    if (a == NULL)
  ------------------
  |  Branch (274:9): [True: 0, False: 27.4k]
  ------------------
  275|      0|        return NULL;
  276|       |
  277|  27.4k|    if ((t = ossl_ec_group_new_ex(a->libctx, a->propq, a->meth)) == NULL)
  ------------------
  |  Branch (277:9): [True: 0, False: 27.4k]
  ------------------
  278|      0|        return NULL;
  279|  27.4k|    if (!EC_GROUP_copy(t, a))
  ------------------
  |  Branch (279:9): [True: 0, False: 27.4k]
  ------------------
  280|      0|        goto err;
  281|       |
  282|  27.4k|    ok = 1;
  283|       |
  284|  27.4k| err:
  285|  27.4k|    if (!ok) {
  ------------------
  |  Branch (285:9): [True: 0, False: 27.4k]
  ------------------
  286|      0|        EC_GROUP_free(t);
  287|      0|        return NULL;
  288|      0|    }
  289|  27.4k|        return t;
  290|  27.4k|}
EC_GROUP_set_generator:
  369|  26.4k|{
  370|  26.4k|    if (generator == NULL) {
  ------------------
  |  Branch (370:9): [True: 0, False: 26.4k]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        return 0;
  373|      0|    }
  374|       |
  375|       |    /* require group->field >= 1 */
  376|  26.4k|    if (group->field == NULL || BN_is_zero(group->field)
  ------------------
  |  Branch (376:9): [True: 0, False: 26.4k]
  |  Branch (376:33): [True: 0, False: 26.4k]
  ------------------
  377|  26.4k|        || BN_is_negative(group->field)) {
  ------------------
  |  Branch (377:12): [True: 0, False: 26.4k]
  ------------------
  378|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  379|      0|        return 0;
  380|      0|    }
  381|       |
  382|       |    /*-
  383|       |     * - require order >= 1
  384|       |     * - enforce upper bound due to Hasse thm: order can be no more than one bit
  385|       |     *   longer than field cardinality
  386|       |     */
  387|  26.4k|    if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
  ------------------
  |  Branch (387:9): [True: 0, False: 26.4k]
  |  Branch (387:26): [True: 0, False: 26.4k]
  |  Branch (387:47): [True: 0, False: 26.4k]
  ------------------
  388|  26.4k|        || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
  ------------------
  |  Branch (388:12): [True: 0, False: 26.4k]
  ------------------
  389|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  390|      0|        return 0;
  391|      0|    }
  392|       |
  393|       |    /*-
  394|       |     * Unfortunately the cofactor is an optional field in many standards.
  395|       |     * Internally, the lib uses 0 cofactor as a marker for "unknown cofactor".
  396|       |     * So accept cofactor == NULL or cofactor >= 0.
  397|       |     */
  398|  26.4k|    if (cofactor != NULL && BN_is_negative(cofactor)) {
  ------------------
  |  Branch (398:9): [True: 26.4k, False: 0]
  |  Branch (398:29): [True: 0, False: 26.4k]
  ------------------
  399|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  400|      0|        return 0;
  401|      0|    }
  402|       |
  403|  26.4k|    if (group->generator == NULL) {
  ------------------
  |  Branch (403:9): [True: 26.4k, False: 0]
  ------------------
  404|  26.4k|        group->generator = EC_POINT_new(group);
  405|  26.4k|        if (group->generator == NULL)
  ------------------
  |  Branch (405:13): [True: 0, False: 26.4k]
  ------------------
  406|      0|            return 0;
  407|  26.4k|    }
  408|  26.4k|    if (!EC_POINT_copy(group->generator, generator))
  ------------------
  |  Branch (408:9): [True: 0, False: 26.4k]
  ------------------
  409|      0|        return 0;
  410|       |
  411|  26.4k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (411:9): [True: 0, False: 26.4k]
  ------------------
  412|      0|        return 0;
  413|       |
  414|       |    /* Either take the provided positive cofactor, or try to compute it */
  415|  26.4k|    if (cofactor != NULL && !BN_is_zero(cofactor)) {
  ------------------
  |  Branch (415:9): [True: 26.4k, False: 0]
  |  Branch (415:29): [True: 26.4k, False: 0]
  ------------------
  416|  26.4k|        if (!BN_copy(group->cofactor, cofactor))
  ------------------
  |  Branch (416:13): [True: 0, False: 26.4k]
  ------------------
  417|      0|            return 0;
  418|  26.4k|    } else if (!ec_guess_cofactor(group)) {
  ------------------
  |  Branch (418:16): [True: 0, False: 0]
  ------------------
  419|      0|        BN_zero(group->cofactor);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  420|      0|        return 0;
  421|      0|    }
  422|       |
  423|       |    /*
  424|       |     * Some groups have an order with
  425|       |     * factors of two, which makes the Montgomery setup fail.
  426|       |     * |group->mont_data| will be NULL in this case.
  427|       |     */
  428|  26.4k|    if (BN_is_odd(group->order)) {
  ------------------
  |  Branch (428:9): [True: 26.4k, False: 0]
  ------------------
  429|  26.4k|        return ec_precompute_mont_data(group);
  430|  26.4k|    }
  431|       |
  432|      0|    BN_MONT_CTX_free(group->mont_data);
  433|      0|    group->mont_data = NULL;
  434|      0|    return 1;
  435|  26.4k|}
EC_GROUP_get0_generator:
  438|     10|{
  439|     10|    return group->generator;
  440|     10|}
EC_GROUP_get0_order:
  458|  12.4k|{
  459|  12.4k|    return group->order;
  460|  12.4k|}
EC_GROUP_order_bits:
  463|  24.8k|{
  464|  24.8k|    return group->meth->group_order_bits(group);
  465|  24.8k|}
EC_GROUP_set_curve_name:
  485|  27.4k|{
  486|  27.4k|    group->curve_name = nid;
  487|  27.4k|    group->asn1_flag =
  488|  27.4k|        (nid != NID_undef)
  ------------------
  |  |   18|  27.4k|#define NID_undef                       0
  ------------------
  |  Branch (488:9): [True: 27.4k, False: 0]
  ------------------
  489|  27.4k|        ? OPENSSL_EC_NAMED_CURVE
  ------------------
  |  |   31|  27.4k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  490|  27.4k|        : OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  27.4k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  491|  27.4k|}
EC_GROUP_get_curve_name:
  494|  64.6k|{
  495|  64.6k|    return group->curve_name;
  496|  64.6k|}
EC_GROUP_get_field_type:
  504|  39.7k|{
  505|  39.7k|    return group->meth->field_type;
  506|  39.7k|}
EC_GROUP_set_asn1_flag:
  509|  27.4k|{
  510|  27.4k|    group->asn1_flag = flag;
  511|  27.4k|}
EC_GROUP_get_asn1_flag:
  514|  38.8k|{
  515|  38.8k|    return group->asn1_flag;
  516|  38.8k|}
EC_GROUP_get_point_conversion_form:
  526|  12.4k|{
  527|  12.4k|    return group->asn1_form;
  528|  12.4k|}
EC_GROUP_set_seed:
  531|  16.6k|{
  532|  16.6k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  16.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  16.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  16.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  533|  16.6k|    group->seed = NULL;
  534|  16.6k|    group->seed_len = 0;
  535|       |
  536|  16.6k|    if (!len || !p)
  ------------------
  |  Branch (536:9): [True: 0, False: 16.6k]
  |  Branch (536:17): [True: 0, False: 16.6k]
  ------------------
  537|      0|        return 1;
  538|       |
  539|  16.6k|    if ((group->seed = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  16.6k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  16.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  16.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (539:9): [True: 0, False: 16.6k]
  ------------------
  540|      0|        return 0;
  541|  16.6k|    memcpy(group->seed, p, len);
  542|  16.6k|    group->seed_len = len;
  543|       |
  544|  16.6k|    return len;
  545|  16.6k|}
EC_GROUP_set_curve:
  559|  21.7k|{
  560|  21.7k|    if (group->meth->group_set_curve == 0) {
  ------------------
  |  Branch (560:9): [True: 0, False: 21.7k]
  ------------------
  561|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  562|      0|        return 0;
  563|      0|    }
  564|  21.7k|    return group->meth->group_set_curve(group, p, a, b, ctx);
  565|  21.7k|}
EC_GROUP_get_degree:
  606|  15.5k|{
  607|  15.5k|    if (group->meth->group_get_degree == 0) {
  ------------------
  |  Branch (607:9): [True: 0, False: 15.5k]
  ------------------
  608|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  609|      0|        return 0;
  610|      0|    }
  611|  15.5k|    return group->meth->group_get_degree(group);
  612|  15.5k|}
EC_POINT_new:
  718|   109k|{
  719|   109k|    EC_POINT *ret;
  720|       |
  721|   109k|    if (group == NULL) {
  ------------------
  |  Branch (721:9): [True: 0, False: 109k]
  ------------------
  722|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  723|      0|        return NULL;
  724|      0|    }
  725|   109k|    if (group->meth->point_init == NULL) {
  ------------------
  |  Branch (725:9): [True: 0, False: 109k]
  ------------------
  726|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|        return NULL;
  728|      0|    }
  729|       |
  730|   109k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   109k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   109k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   109k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  731|   109k|    if (ret == NULL)
  ------------------
  |  Branch (731:9): [True: 0, False: 109k]
  ------------------
  732|      0|        return NULL;
  733|       |
  734|   109k|    ret->meth = group->meth;
  735|   109k|    ret->curve_name = group->curve_name;
  736|       |
  737|   109k|    if (!ret->meth->point_init(ret)) {
  ------------------
  |  Branch (737:9): [True: 0, False: 109k]
  ------------------
  738|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  739|      0|        return NULL;
  740|      0|    }
  741|       |
  742|   109k|    return ret;
  743|   109k|}
EC_POINT_free:
  746|   115k|{
  747|   115k|    if (point == NULL)
  ------------------
  |  Branch (747:9): [True: 5.33k, False: 109k]
  ------------------
  748|  5.33k|        return;
  749|       |
  750|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
  751|       |    EC_POINT_clear_free(point);
  752|       |#else
  753|   109k|    if (point->meth->point_finish != 0)
  ------------------
  |  Branch (753:9): [True: 109k, False: 0]
  ------------------
  754|   109k|        point->meth->point_finish(point);
  755|   109k|    OPENSSL_free(point);
  ------------------
  |  |  115|   109k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   109k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   109k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  756|   109k|#endif
  757|   109k|}
EC_POINT_clear_free:
  760|    128|{
  761|    128|    if (point == NULL)
  ------------------
  |  Branch (761:9): [True: 0, False: 128]
  ------------------
  762|      0|        return;
  763|       |
  764|    128|    if (point->meth->point_clear_finish != 0)
  ------------------
  |  Branch (764:9): [True: 128, False: 0]
  ------------------
  765|    128|        point->meth->point_clear_finish(point);
  766|      0|    else if (point->meth->point_finish != 0)
  ------------------
  |  Branch (766:14): [True: 0, False: 0]
  ------------------
  767|      0|        point->meth->point_finish(point);
  768|    128|    OPENSSL_clear_free(point, sizeof(*point));
  ------------------
  |  |  113|    128|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    128|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    128|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  769|    128|}
EC_POINT_copy:
  772|  54.9k|{
  773|  54.9k|    if (dest->meth->point_copy == 0) {
  ------------------
  |  Branch (773:9): [True: 0, False: 54.9k]
  ------------------
  774|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  775|      0|        return 0;
  776|      0|    }
  777|  54.9k|    if (dest->meth != src->meth
  ------------------
  |  Branch (777:9): [True: 0, False: 54.9k]
  ------------------
  778|  54.9k|            || (dest->curve_name != src->curve_name
  ------------------
  |  Branch (778:17): [True: 933, False: 53.9k]
  ------------------
  779|  54.9k|                 && dest->curve_name != 0
  ------------------
  |  Branch (779:21): [True: 933, False: 0]
  ------------------
  780|  54.9k|                 && src->curve_name != 0)) {
  ------------------
  |  Branch (780:21): [True: 0, False: 933]
  ------------------
  781|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  782|      0|        return 0;
  783|      0|    }
  784|  54.9k|    if (dest == src)
  ------------------
  |  Branch (784:9): [True: 0, False: 54.9k]
  ------------------
  785|      0|        return 1;
  786|  54.9k|    return dest->meth->point_copy(dest, src);
  787|  54.9k|}
EC_POINT_set_to_infinity:
  816|  4.07k|{
  817|  4.07k|    if (group->meth->point_set_to_infinity == 0) {
  ------------------
  |  Branch (817:9): [True: 0, False: 4.07k]
  ------------------
  818|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  819|      0|        return 0;
  820|      0|    }
  821|  4.07k|    if (group->meth != point->meth) {
  ------------------
  |  Branch (821:9): [True: 0, False: 4.07k]
  ------------------
  822|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  823|      0|        return 0;
  824|      0|    }
  825|  4.07k|    return group->meth->point_set_to_infinity(group, point);
  826|  4.07k|}
EC_POINT_set_Jprojective_coordinates_GFp:
  833|  18.4k|{
  834|  18.4k|    if (group->meth->field_type != NID_X9_62_prime_field) {
  ------------------
  |  |  152|  18.4k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (834:9): [True: 0, False: 18.4k]
  ------------------
  835|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  836|      0|        return 0;
  837|      0|    }
  838|  18.4k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (838:9): [True: 0, False: 18.4k]
  ------------------
  839|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  840|      0|        return 0;
  841|      0|    }
  842|  18.4k|    return ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point,
  843|  18.4k|                                                              x, y, z, ctx);
  844|  18.4k|}
EC_POINT_set_affine_coordinates:
  867|  37.2k|{
  868|  37.2k|    if (group->meth->point_set_affine_coordinates == NULL) {
  ------------------
  |  Branch (868:9): [True: 0, False: 37.2k]
  ------------------
  869|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  870|      0|        return 0;
  871|      0|    }
  872|  37.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (872:9): [True: 0, False: 37.2k]
  ------------------
  873|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  874|      0|        return 0;
  875|      0|    }
  876|  37.2k|    if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (876:9): [True: 0, False: 37.2k]
  ------------------
  877|      0|        return 0;
  878|       |
  879|  37.2k|    if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
  ------------------
  |  Branch (879:9): [True: 1.43k, False: 35.8k]
  ------------------
  880|  1.43k|        ERR_raise(ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE);
  ------------------
  |  |  401|  1.43k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.43k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.43k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.43k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.43k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.43k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.43k|     ERR_set_error)
  |  |  ------------------
  ------------------
  881|  1.43k|        return 0;
  882|  1.43k|    }
  883|  35.8k|    return 1;
  884|  37.2k|}
EC_POINT_get_affine_coordinates:
  907|     74|{
  908|     74|    if (group->meth->point_get_affine_coordinates == NULL) {
  ------------------
  |  Branch (908:9): [True: 0, False: 74]
  ------------------
  909|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  910|      0|        return 0;
  911|      0|    }
  912|     74|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (912:9): [True: 0, False: 74]
  ------------------
  913|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  914|      0|        return 0;
  915|      0|    }
  916|     74|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (916:9): [True: 0, False: 74]
  ------------------
  917|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  918|      0|        return 0;
  919|      0|    }
  920|     74|    return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
  921|     74|}
EC_POINT_add:
  943|     64|{
  944|     64|    if (group->meth->add == 0) {
  ------------------
  |  Branch (944:9): [True: 0, False: 64]
  ------------------
  945|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  946|      0|        return 0;
  947|      0|    }
  948|     64|    if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group)
  ------------------
  |  Branch (948:9): [True: 0, False: 64]
  |  Branch (948:42): [True: 0, False: 64]
  ------------------
  949|     64|        || !ec_point_is_compat(b, group)) {
  ------------------
  |  Branch (949:12): [True: 0, False: 64]
  ------------------
  950|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  951|      0|        return 0;
  952|      0|    }
  953|     64|    return group->meth->add(group, r, a, b, ctx);
  954|     64|}
EC_POINT_is_at_infinity:
  984|  37.5k|{
  985|  37.5k|    if (group->meth->is_at_infinity == 0) {
  ------------------
  |  Branch (985:9): [True: 0, False: 37.5k]
  ------------------
  986|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  987|      0|        return 0;
  988|      0|    }
  989|  37.5k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (989:9): [True: 0, False: 37.5k]
  ------------------
  990|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  991|      0|        return 0;
  992|      0|    }
  993|  37.5k|    return group->meth->is_at_infinity(group, point);
  994|  37.5k|}
EC_POINT_is_on_curve:
 1005|  37.2k|{
 1006|  37.2k|    if (group->meth->is_on_curve == 0) {
  ------------------
  |  Branch (1006:9): [True: 0, False: 37.2k]
  ------------------
 1007|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1008|      0|        return 0;
 1009|      0|    }
 1010|  37.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (1010:9): [True: 0, False: 37.2k]
  ------------------
 1011|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1012|      0|        return 0;
 1013|      0|    }
 1014|  37.2k|    return group->meth->is_on_curve(group, point, ctx);
 1015|  37.2k|}
EC_POINT_mul:
 1120|     74|{
 1121|     74|    int ret = 0;
 1122|     74|    size_t num;
 1123|     74|#ifndef FIPS_MODULE
 1124|     74|    BN_CTX *new_ctx = NULL;
 1125|     74|#endif
 1126|       |
 1127|     74|    if (!ec_point_is_compat(r, group)
  ------------------
  |  Branch (1127:9): [True: 0, False: 74]
  ------------------
 1128|     74|        || (point != NULL && !ec_point_is_compat(point, group))) {
  ------------------
  |  Branch (1128:13): [True: 74, False: 0]
  |  Branch (1128:30): [True: 0, False: 74]
  ------------------
 1129|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1130|      0|        return 0;
 1131|      0|    }
 1132|       |
 1133|     74|    if (g_scalar == NULL && p_scalar == NULL)
  ------------------
  |  Branch (1133:9): [True: 0, False: 74]
  |  Branch (1133:29): [True: 0, False: 0]
  ------------------
 1134|      0|        return EC_POINT_set_to_infinity(group, r);
 1135|       |
 1136|     74|#ifndef FIPS_MODULE
 1137|     74|    if (ctx == NULL)
  ------------------
  |  Branch (1137:9): [True: 0, False: 74]
  ------------------
 1138|      0|        ctx = new_ctx = BN_CTX_secure_new();
 1139|     74|#endif
 1140|     74|    if (ctx == NULL) {
  ------------------
  |  Branch (1140:9): [True: 0, False: 74]
  ------------------
 1141|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        return 0;
 1143|      0|    }
 1144|       |
 1145|     74|    num = (point != NULL && p_scalar != NULL) ? 1 : 0;
  ------------------
  |  Branch (1145:12): [True: 74, False: 0]
  |  Branch (1145:29): [True: 74, False: 0]
  ------------------
 1146|     74|    if (group->meth->mul != NULL)
  ------------------
  |  Branch (1146:9): [True: 74, False: 0]
  ------------------
 1147|     74|        ret = group->meth->mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1148|      0|    else
 1149|       |        /* use default */
 1150|      0|        ret = ossl_ec_wNAF_mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1151|       |
 1152|     74|#ifndef FIPS_MODULE
 1153|     74|    BN_CTX_free(new_ctx);
 1154|     74|#endif
 1155|     74|    return ret;
 1156|     74|}
ossl_ec_group_simple_order_bits:
 1231|  24.8k|{
 1232|  24.8k|    if (group->order == NULL)
  ------------------
  |  Branch (1232:9): [True: 0, False: 24.8k]
  ------------------
 1233|      0|        return 0;
 1234|  24.8k|    return BN_num_bits(group->order);
 1235|  24.8k|}
ossl_ec_group_do_inverse_ord:
 1300|     74|{
 1301|     74|    if (group->meth->field_inverse_mod_ord != NULL)
  ------------------
  |  Branch (1301:9): [True: 10, False: 64]
  ------------------
 1302|     10|        return group->meth->field_inverse_mod_ord(group, res, x, ctx);
 1303|     64|    else
 1304|     64|        return ec_field_inverse_mod_ord(group, res, x, ctx);
 1305|     74|}
EC_GROUP_get_basis_type:
 1327|  7.46k|{
 1328|  7.46k|    int i;
 1329|       |
 1330|  7.46k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  7.46k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1330:9): [True: 0, False: 7.46k]
  ------------------
 1331|       |        /* everything else is currently not supported */
 1332|      0|        return 0;
 1333|       |
 1334|       |    /* Find the last non-zero element of group->poly[] */
 1335|  7.46k|    for (i = 0;
 1336|  33.6k|         i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
  ------------------
  |  |   14|  67.2k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1336:10): [True: 33.6k, False: 0]
  |  Branch (1336:46): [True: 26.1k, False: 7.46k]
  ------------------
 1337|  26.1k|         i++)
 1338|  26.1k|        continue;
 1339|       |
 1340|  7.46k|    if (i == 4)
  ------------------
  |  Branch (1340:9): [True: 5.60k, False: 1.86k]
  ------------------
 1341|  5.60k|        return NID_X9_62_ppBasis;
  ------------------
  |  |  172|  5.60k|#define NID_X9_62_ppBasis               683
  ------------------
 1342|  1.86k|    else if (i == 2)
  ------------------
  |  Branch (1342:14): [True: 1.86k, False: 0]
  ------------------
 1343|  1.86k|        return NID_X9_62_tpBasis;
  ------------------
  |  |  168|  1.86k|#define NID_X9_62_tpBasis               682
  ------------------
 1344|      0|    else
 1345|       |        /* everything else is currently not supported */
 1346|      0|        return 0;
 1347|  7.46k|}
EC_GROUP_get_trinomial_basis:
 1351|  1.86k|{
 1352|  1.86k|    if (group == NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 1.86k]
  ------------------
 1353|      0|        return 0;
 1354|       |
 1355|  1.86k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  3.73k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1355:9): [True: 0, False: 1.86k]
  ------------------
 1356|  1.86k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1356:14): [True: 1.86k, False: 0]
  |  Branch (1356:39): [True: 1.86k, False: 0]
  ------------------
 1357|  1.86k|             && (group->poly[2] == 0))) {
  ------------------
  |  Branch (1357:17): [True: 1.86k, False: 0]
  ------------------
 1358|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1359|      0|        return 0;
 1360|      0|    }
 1361|       |
 1362|  1.86k|    if (k)
  ------------------
  |  Branch (1362:9): [True: 1.86k, False: 0]
  ------------------
 1363|  1.86k|        *k = group->poly[1];
 1364|       |
 1365|  1.86k|    return 1;
 1366|  1.86k|}
EC_GROUP_get_pentanomial_basis:
 1370|  5.60k|{
 1371|  5.60k|    if (group == NULL)
  ------------------
  |  Branch (1371:9): [True: 0, False: 5.60k]
  ------------------
 1372|      0|        return 0;
 1373|       |
 1374|  5.60k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  11.2k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1374:9): [True: 0, False: 5.60k]
  ------------------
 1375|  5.60k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1375:14): [True: 5.60k, False: 0]
  |  Branch (1375:39): [True: 5.60k, False: 0]
  ------------------
 1376|  5.60k|             && (group->poly[2] != 0) && (group->poly[3] != 0)
  ------------------
  |  Branch (1376:17): [True: 5.60k, False: 0]
  |  Branch (1376:42): [True: 5.60k, False: 0]
  ------------------
 1377|  5.60k|             && (group->poly[4] == 0))) {
  ------------------
  |  Branch (1377:17): [True: 5.60k, False: 0]
  ------------------
 1378|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1379|      0|        return 0;
 1380|      0|    }
 1381|       |
 1382|  5.60k|    if (k1)
  ------------------
  |  Branch (1382:9): [True: 5.60k, False: 0]
  ------------------
 1383|  5.60k|        *k1 = group->poly[3];
 1384|  5.60k|    if (k2)
  ------------------
  |  Branch (1384:9): [True: 5.60k, False: 0]
  ------------------
 1385|  5.60k|        *k2 = group->poly[2];
 1386|  5.60k|    if (k3)
  ------------------
  |  Branch (1386:9): [True: 5.60k, False: 0]
  ------------------
 1387|  5.60k|        *k3 = group->poly[1];
 1388|       |
 1389|  5.60k|    return 1;
 1390|  5.60k|}
ec_lib.c:ec_precompute_mont_data:
 1190|  26.4k|{
 1191|  26.4k|    BN_CTX *ctx = BN_CTX_new_ex(group->libctx);
 1192|  26.4k|    int ret = 0;
 1193|       |
 1194|  26.4k|    BN_MONT_CTX_free(group->mont_data);
 1195|  26.4k|    group->mont_data = NULL;
 1196|       |
 1197|  26.4k|    if (ctx == NULL)
  ------------------
  |  Branch (1197:9): [True: 0, False: 26.4k]
  ------------------
 1198|      0|        goto err;
 1199|       |
 1200|  26.4k|    group->mont_data = BN_MONT_CTX_new();
 1201|  26.4k|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1201:9): [True: 0, False: 26.4k]
  ------------------
 1202|      0|        goto err;
 1203|       |
 1204|  26.4k|    if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
  ------------------
  |  Branch (1204:9): [True: 0, False: 26.4k]
  ------------------
 1205|      0|        BN_MONT_CTX_free(group->mont_data);
 1206|      0|        group->mont_data = NULL;
 1207|      0|        goto err;
 1208|      0|    }
 1209|       |
 1210|  26.4k|    ret = 1;
 1211|       |
 1212|  26.4k| err:
 1213|       |
 1214|  26.4k|    BN_CTX_free(ctx);
 1215|  26.4k|    return ret;
 1216|  26.4k|}
ec_lib.c:ec_field_inverse_mod_ord:
 1239|     64|{
 1240|     64|    BIGNUM *e = NULL;
 1241|     64|    int ret = 0;
 1242|     64|#ifndef FIPS_MODULE
 1243|     64|    BN_CTX *new_ctx = NULL;
 1244|     64|#endif
 1245|       |
 1246|     64|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1246:9): [True: 0, False: 64]
  ------------------
 1247|      0|        return 0;
 1248|       |
 1249|     64|#ifndef FIPS_MODULE
 1250|     64|    if (ctx == NULL)
  ------------------
  |  Branch (1250:9): [True: 0, False: 64]
  ------------------
 1251|      0|        ctx = new_ctx = BN_CTX_secure_new();
 1252|     64|#endif
 1253|     64|    if (ctx == NULL)
  ------------------
  |  Branch (1253:9): [True: 0, False: 64]
  ------------------
 1254|      0|        return 0;
 1255|       |
 1256|     64|    BN_CTX_start(ctx);
 1257|     64|    if ((e = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (1257:9): [True: 0, False: 64]
  ------------------
 1258|      0|        goto err;
 1259|       |
 1260|       |    /*-
 1261|       |     * We want inverse in constant time, therefore we utilize the fact
 1262|       |     * order must be prime and use Fermats Little Theorem instead.
 1263|       |     */
 1264|     64|    if (!BN_set_word(e, 2))
  ------------------
  |  Branch (1264:9): [True: 0, False: 64]
  ------------------
 1265|      0|        goto err;
 1266|     64|    if (!BN_sub(e, group->order, e))
  ------------------
  |  Branch (1266:9): [True: 0, False: 64]
  ------------------
 1267|      0|        goto err;
 1268|       |    /*-
 1269|       |     * Although the exponent is public we want the result to be
 1270|       |     * fixed top.
 1271|       |     */
 1272|     64|    if (!bn_mod_exp_mont_fixed_top(r, x, e, group->order, ctx, group->mont_data))
  ------------------
  |  Branch (1272:9): [True: 0, False: 64]
  ------------------
 1273|      0|        goto err;
 1274|       |
 1275|     64|    ret = 1;
 1276|       |
 1277|     64| err:
 1278|     64|    BN_CTX_end(ctx);
 1279|     64|#ifndef FIPS_MODULE
 1280|     64|    BN_CTX_free(new_ctx);
 1281|     64|#endif
 1282|     64|    return ret;
 1283|     64|}

ec_lib.c:ec_point_is_compat:
  329|   130k|{
  330|   130k|    return group->meth == point->meth
  ------------------
  |  Branch (330:12): [True: 130k, False: 0]
  ------------------
  331|   130k|           && (group->curve_name == 0
  ------------------
  |  Branch (331:16): [True: 3.73k, False: 127k]
  ------------------
  332|   130k|               || point->curve_name == 0
  ------------------
  |  Branch (332:19): [True: 0, False: 127k]
  ------------------
  333|   130k|               || group->curve_name == point->curve_name);
  ------------------
  |  Branch (333:19): [True: 127k, False: 0]
  ------------------
  334|   130k|}
ec_mult.c:ec_point_ladder_pre:
  769|    128|{
  770|    128|    if (group->meth->ladder_pre != NULL)
  ------------------
  |  Branch (770:9): [True: 128, False: 0]
  ------------------
  771|    128|        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|  45.9k|{
  784|  45.9k|    if (group->meth->ladder_step != NULL)
  ------------------
  |  Branch (784:9): [True: 45.9k, False: 0]
  ------------------
  785|  45.9k|        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|    128|{
  799|    128|    if (group->meth->ladder_post != NULL)
  ------------------
  |  Branch (799:9): [True: 128, False: 0]
  ------------------
  800|    128|        return group->meth->ladder_post(group, r, s, p, ctx);
  801|       |
  802|      0|    return 1;
  803|    128|}
ec_oct.c:ec_point_is_compat:
  329|  39.7k|{
  330|  39.7k|    return group->meth == point->meth
  ------------------
  |  Branch (330:12): [True: 39.7k, False: 0]
  ------------------
  331|  39.7k|           && (group->curve_name == 0
  ------------------
  |  Branch (331:16): [True: 0, False: 39.7k]
  ------------------
  332|  39.7k|               || point->curve_name == 0
  ------------------
  |  Branch (332:19): [True: 0, False: 39.7k]
  ------------------
  333|  39.7k|               || group->curve_name == point->curve_name);
  ------------------
  |  Branch (333:19): [True: 39.7k, False: 0]
  ------------------
  334|  39.7k|}

ossl_ec_scalar_mul_ladder:
  142|    128|{
  143|    128|    int i, cardinality_bits, group_top, kbit, pbit, Z_is_one;
  144|    128|    EC_POINT *p = NULL;
  145|    128|    EC_POINT *s = NULL;
  146|    128|    BIGNUM *k = NULL;
  147|    128|    BIGNUM *lambda = NULL;
  148|    128|    BIGNUM *cardinality = NULL;
  149|    128|    int ret = 0;
  150|       |
  151|       |    /* early exit if the input point is the point at infinity */
  152|    128|    if (point != NULL && EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (152:9): [True: 64, False: 64]
  |  Branch (152:26): [True: 0, False: 64]
  ------------------
  153|      0|        return EC_POINT_set_to_infinity(group, r);
  154|       |
  155|    128|    if (BN_is_zero(group->order)) {
  ------------------
  |  Branch (155:9): [True: 0, False: 128]
  ------------------
  156|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  157|      0|        return 0;
  158|      0|    }
  159|    128|    if (BN_is_zero(group->cofactor)) {
  ------------------
  |  Branch (159:9): [True: 0, False: 128]
  ------------------
  160|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        return 0;
  162|      0|    }
  163|       |
  164|    128|    BN_CTX_start(ctx);
  165|       |
  166|    128|    if (((p = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 128]
  ------------------
  167|    128|        || ((s = EC_POINT_new(group)) == NULL)) {
  ------------------
  |  Branch (167:12): [True: 0, False: 128]
  ------------------
  168|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|        goto err;
  170|      0|    }
  171|       |
  172|    128|    if (point == NULL) {
  ------------------
  |  Branch (172:9): [True: 64, False: 64]
  ------------------
  173|     64|        if (!EC_POINT_copy(p, group->generator)) {
  ------------------
  |  Branch (173:13): [True: 0, False: 64]
  ------------------
  174|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  175|      0|            goto err;
  176|      0|        }
  177|     64|    } else {
  178|     64|        if (!EC_POINT_copy(p, point)) {
  ------------------
  |  Branch (178:13): [True: 0, False: 64]
  ------------------
  179|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|            goto err;
  181|      0|        }
  182|     64|    }
  183|       |
  184|    128|    EC_POINT_BN_set_flags(p, BN_FLG_CONSTTIME);
  ------------------
  |  |  104|    128|#define EC_POINT_BN_set_flags(P, flags) do { \
  |  |  105|    128|    BN_set_flags((P)->X, (flags)); \
  |  |  106|    128|    BN_set_flags((P)->Y, (flags)); \
  |  |  107|    128|    BN_set_flags((P)->Z, (flags)); \
  |  |  108|    128|} while(0)
  |  |  ------------------
  |  |  |  Branch (108:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  185|    128|    EC_POINT_BN_set_flags(r, BN_FLG_CONSTTIME);
  ------------------
  |  |  104|    128|#define EC_POINT_BN_set_flags(P, flags) do { \
  |  |  105|    128|    BN_set_flags((P)->X, (flags)); \
  |  |  106|    128|    BN_set_flags((P)->Y, (flags)); \
  |  |  107|    128|    BN_set_flags((P)->Z, (flags)); \
  |  |  108|    128|} while(0)
  |  |  ------------------
  |  |  |  Branch (108:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  186|    128|    EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME);
  ------------------
  |  |  104|    128|#define EC_POINT_BN_set_flags(P, flags) do { \
  |  |  105|    128|    BN_set_flags((P)->X, (flags)); \
  |  |  106|    128|    BN_set_flags((P)->Y, (flags)); \
  |  |  107|    128|    BN_set_flags((P)->Z, (flags)); \
  |  |  108|    128|} while(0)
  |  |  ------------------
  |  |  |  Branch (108:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  187|       |
  188|    128|    cardinality = BN_CTX_get(ctx);
  189|    128|    lambda = BN_CTX_get(ctx);
  190|    128|    k = BN_CTX_get(ctx);
  191|    128|    if (k == NULL) {
  ------------------
  |  Branch (191:9): [True: 0, False: 128]
  ------------------
  192|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|        goto err;
  194|      0|    }
  195|       |
  196|    128|    if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) {
  ------------------
  |  Branch (196:9): [True: 0, False: 128]
  ------------------
  197|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  198|      0|        goto err;
  199|      0|    }
  200|       |
  201|       |    /*
  202|       |     * Group cardinalities are often on a word boundary.
  203|       |     * So when we pad the scalar, some timing diff might
  204|       |     * pop if it needs to be expanded due to carries.
  205|       |     * So expand ahead of time.
  206|       |     */
  207|    128|    cardinality_bits = BN_num_bits(cardinality);
  208|    128|    group_top = bn_get_top(cardinality);
  209|    128|    if ((bn_wexpand(k, group_top + 2) == NULL)
  ------------------
  |  Branch (209:9): [True: 0, False: 128]
  ------------------
  210|    128|        || (bn_wexpand(lambda, group_top + 2) == NULL)) {
  ------------------
  |  Branch (210:12): [True: 0, False: 128]
  ------------------
  211|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|        goto err;
  213|      0|    }
  214|       |
  215|    128|    if (!BN_copy(k, scalar)) {
  ------------------
  |  Branch (215:9): [True: 0, False: 128]
  ------------------
  216|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  217|      0|        goto err;
  218|      0|    }
  219|       |
  220|    128|    BN_set_flags(k, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|    128|# define BN_FLG_CONSTTIME        0x04
  ------------------
  221|       |
  222|    128|    if ((BN_num_bits(k) > cardinality_bits) || (BN_is_negative(k))) {
  ------------------
  |  Branch (222:9): [True: 0, False: 128]
  |  Branch (222:48): [True: 0, False: 128]
  ------------------
  223|       |        /*-
  224|       |         * this is an unusual input, and we don't guarantee
  225|       |         * constant-timeness
  226|       |         */
  227|      0|        if (!BN_nnmod(k, k, cardinality, ctx)) {
  ------------------
  |  Branch (227:13): [True: 0, False: 0]
  ------------------
  228|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|            goto err;
  230|      0|        }
  231|      0|    }
  232|       |
  233|    128|    if (!BN_add(lambda, k, cardinality)) {
  ------------------
  |  Branch (233:9): [True: 0, False: 128]
  ------------------
  234|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|        goto err;
  236|      0|    }
  237|    128|    BN_set_flags(lambda, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|    128|# define BN_FLG_CONSTTIME        0x04
  ------------------
  238|    128|    if (!BN_add(k, lambda, cardinality)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 128]
  ------------------
  239|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  240|      0|        goto err;
  241|      0|    }
  242|       |    /*
  243|       |     * lambda := scalar + cardinality
  244|       |     * k := scalar + 2*cardinality
  245|       |     */
  246|    128|    kbit = BN_is_bit_set(lambda, cardinality_bits);
  247|    128|    BN_consttime_swap(kbit, k, lambda, group_top + 2);
  248|       |
  249|    128|    group_top = bn_get_top(group->field);
  250|    128|    if ((bn_wexpand(s->X, group_top) == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 128]
  ------------------
  251|    128|        || (bn_wexpand(s->Y, group_top) == NULL)
  ------------------
  |  Branch (251:12): [True: 0, False: 128]
  ------------------
  252|    128|        || (bn_wexpand(s->Z, group_top) == NULL)
  ------------------
  |  Branch (252:12): [True: 0, False: 128]
  ------------------
  253|    128|        || (bn_wexpand(r->X, group_top) == NULL)
  ------------------
  |  Branch (253:12): [True: 0, False: 128]
  ------------------
  254|    128|        || (bn_wexpand(r->Y, group_top) == NULL)
  ------------------
  |  Branch (254:12): [True: 0, False: 128]
  ------------------
  255|    128|        || (bn_wexpand(r->Z, group_top) == NULL)
  ------------------
  |  Branch (255:12): [True: 0, False: 128]
  ------------------
  256|    128|        || (bn_wexpand(p->X, group_top) == NULL)
  ------------------
  |  Branch (256:12): [True: 0, False: 128]
  ------------------
  257|    128|        || (bn_wexpand(p->Y, group_top) == NULL)
  ------------------
  |  Branch (257:12): [True: 0, False: 128]
  ------------------
  258|    128|        || (bn_wexpand(p->Z, group_top) == NULL)) {
  ------------------
  |  Branch (258:12): [True: 0, False: 128]
  ------------------
  259|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|        goto err;
  261|      0|    }
  262|       |
  263|       |    /* ensure input point is in affine coords for ladder step efficiency */
  264|    128|    if (!p->Z_is_one && (group->meth->make_affine == NULL
  ------------------
  |  Branch (264:9): [True: 0, False: 128]
  |  Branch (264:26): [True: 0, False: 0]
  ------------------
  265|      0|                         || !group->meth->make_affine(group, p, ctx))) {
  ------------------
  |  Branch (265:29): [True: 0, False: 0]
  ------------------
  266|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  267|      0|            goto err;
  268|      0|    }
  269|       |
  270|       |    /* Initialize the Montgomery ladder */
  271|    128|    if (!ec_point_ladder_pre(group, r, s, p, ctx)) {
  ------------------
  |  Branch (271:9): [True: 0, False: 128]
  ------------------
  272|      0|        ERR_raise(ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|        goto err;
  274|      0|    }
  275|       |
  276|       |    /* top bit is a 1, in a fixed pos */
  277|    128|    pbit = 1;
  278|       |
  279|    128|#define EC_POINT_CSWAP(c, a, b, w, t) do {         \
  280|    128|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  281|    128|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  282|    128|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  283|    128|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  284|    128|        (a)->Z_is_one ^= (t);                      \
  285|    128|        (b)->Z_is_one ^= (t);                      \
  286|    128|} 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|  46.0k|    for (i = cardinality_bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (346:36): [True: 45.9k, False: 128]
  ------------------
  347|  45.9k|        kbit = BN_is_bit_set(k, i) ^ pbit;
  348|  45.9k|        EC_POINT_CSWAP(kbit, r, s, group_top, Z_is_one);
  ------------------
  |  |  279|  45.9k|#define EC_POINT_CSWAP(c, a, b, w, t) do {         \
  |  |  280|  45.9k|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  |  |  281|  45.9k|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  |  |  282|  45.9k|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  |  |  283|  45.9k|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  |  |  284|  45.9k|        (a)->Z_is_one ^= (t);                      \
  |  |  285|  45.9k|        (b)->Z_is_one ^= (t);                      \
  |  |  286|  45.9k|} while(0)
  |  |  ------------------
  |  |  |  Branch (286:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  349|       |
  350|       |        /* Perform a single step of the Montgomery ladder */
  351|  45.9k|        if (!ec_point_ladder_step(group, r, s, p, ctx)) {
  ------------------
  |  Branch (351:13): [True: 0, False: 45.9k]
  ------------------
  352|      0|            ERR_raise(ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|            goto err;
  354|      0|        }
  355|       |        /*
  356|       |         * pbit logic merges this cswap with that of the
  357|       |         * next iteration
  358|       |         */
  359|  45.9k|        pbit ^= kbit;
  360|  45.9k|    }
  361|       |    /* one final cswap to move the right value into r */
  362|    128|    EC_POINT_CSWAP(pbit, r, s, group_top, Z_is_one);
  ------------------
  |  |  279|    128|#define EC_POINT_CSWAP(c, a, b, w, t) do {         \
  |  |  280|    128|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  |  |  281|    128|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  |  |  282|    128|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  |  |  283|    128|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  |  |  284|    128|        (a)->Z_is_one ^= (t);                      \
  |  |  285|    128|        (b)->Z_is_one ^= (t);                      \
  |  |  286|    128|} while(0)
  |  |  ------------------
  |  |  |  Branch (286:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  363|    128|#undef EC_POINT_CSWAP
  364|       |
  365|       |    /* Finalize ladder (and recover full point coordinates) */
  366|    128|    if (!ec_point_ladder_post(group, r, s, p, ctx)) {
  ------------------
  |  Branch (366:9): [True: 0, False: 128]
  ------------------
  367|      0|        ERR_raise(ERR_LIB_EC, EC_R_LADDER_POST_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|        goto err;
  369|      0|    }
  370|       |
  371|    128|    ret = 1;
  372|       |
  373|    128| err:
  374|    128|    EC_POINT_free(p);
  375|    128|    EC_POINT_clear_free(s);
  376|    128|    BN_CTX_end(ctx);
  377|       |
  378|    128|    return ret;
  379|    128|}

EC_POINT_set_compressed_coordinates:
   26|  12.3k|{
   27|  12.3k|    if (group->meth->point_set_compressed_coordinates == NULL
  ------------------
  |  Branch (27:9): [True: 12.3k, False: 0]
  ------------------
   28|  12.3k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  12.3k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (28:12): [True: 0, False: 12.3k]
  ------------------
   29|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   30|      0|        return 0;
   31|      0|    }
   32|  12.3k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (32:9): [True: 0, False: 12.3k]
  ------------------
   33|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   34|      0|        return 0;
   35|      0|    }
   36|  12.3k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  12.3k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (36:9): [True: 12.3k, False: 0]
  ------------------
   37|  12.3k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  12.3k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (37:13): [True: 5.52k, False: 6.79k]
  ------------------
   38|  5.52k|            return ossl_ec_GFp_simple_set_compressed_coordinates(group, point, x,
   39|  5.52k|                                                                 y_bit, ctx);
   40|  6.79k|        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|  6.79k|            return ossl_ec_GF2m_simple_set_compressed_coordinates(group, point,
   48|  6.79k|                                                                  x, y_bit, ctx);
   49|  12.3k|#endif
   50|  12.3k|    }
   51|      0|    return group->meth->point_set_compressed_coordinates(group, point, x,
   52|      0|                                                         y_bit, ctx);
   53|  12.3k|}
EC_POINT_oct2point:
  111|  27.4k|{
  112|  27.4k|    if (group->meth->oct2point == 0
  ------------------
  |  Branch (112:9): [True: 27.4k, False: 0]
  ------------------
  113|  27.4k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  27.4k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (113:12): [True: 0, False: 27.4k]
  ------------------
  114|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  27.4k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (117:9): [True: 0, False: 27.4k]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        return 0;
  120|      0|    }
  121|  27.4k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  27.4k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (121:9): [True: 27.4k, False: 0]
  ------------------
  122|  27.4k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  27.4k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (122:13): [True: 13.7k, False: 13.6k]
  ------------------
  123|  13.7k|            return ossl_ec_GFp_simple_oct2point(group, point, buf, len, ctx);
  124|  13.6k|        else
  125|       |#ifdef OPENSSL_NO_EC2M
  126|       |        {
  127|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  128|       |            return 0;
  129|       |        }
  130|       |#else
  131|  13.6k|            return ossl_ec_GF2m_simple_oct2point(group, point, buf, len, ctx);
  132|  27.4k|#endif
  133|  27.4k|    }
  134|      0|    return group->meth->oct2point(group, point, buf, len, ctx);
  135|  27.4k|}

ossl_ecdsa_verify_sig:
   65|     77|{
   66|     77|    if (eckey->group->meth->ecdsa_verify_sig == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 77]
  ------------------
   67|      0|        ERR_raise(ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   68|      0|        return 0;
   69|      0|    }
   70|       |
   71|     77|    return eckey->group->meth->ecdsa_verify_sig(dgst, dgst_len, sig, eckey);
   72|     77|}
ossl_ecdsa_verify:
  421|    160|{
  422|    160|    ECDSA_SIG *s;
  423|    160|    const unsigned char *p = sigbuf;
  424|    160|    unsigned char *der = NULL;
  425|    160|    int derlen = -1;
  426|    160|    int ret = -1;
  427|       |
  428|    160|    s = ECDSA_SIG_new();
  429|    160|    if (s == NULL)
  ------------------
  |  Branch (429:9): [True: 0, False: 160]
  ------------------
  430|      0|        return ret;
  431|    160|    if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL)
  ------------------
  |  Branch (431:9): [True: 78, False: 82]
  ------------------
  432|     78|        goto err;
  433|       |    /* Ensure signature uses DER and doesn't have trailing garbage */
  434|     82|    derlen = i2d_ECDSA_SIG(s, &der);
  435|     82|    if (derlen != sig_len || memcmp(sigbuf, der, derlen) != 0)
  ------------------
  |  Branch (435:9): [True: 5, False: 77]
  |  Branch (435:30): [True: 0, False: 77]
  ------------------
  436|      5|        goto err;
  437|     77|    ret = ECDSA_do_verify(dgst, dgst_len, s, eckey);
  438|    160| err:
  439|    160|    OPENSSL_free(der);
  ------------------
  |  |  115|    160|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  440|    160|    ECDSA_SIG_free(s);
  441|    160|    return ret;
  442|     77|}
ossl_ecdsa_simple_verify_sig:
  446|     77|{
  447|     77|    int ret = -1, i;
  448|     77|    BN_CTX *ctx;
  449|     77|    const BIGNUM *order;
  450|     77|    BIGNUM *u1, *u2, *m, *X;
  451|     77|    EC_POINT *point = NULL;
  452|     77|    const EC_GROUP *group;
  453|     77|    const EC_POINT *pub_key;
  454|       |
  455|       |    /* check input values */
  456|     77|    if (eckey == NULL || (group = EC_KEY_get0_group(eckey)) == NULL ||
  ------------------
  |  Branch (456:9): [True: 0, False: 77]
  |  Branch (456:26): [True: 0, False: 77]
  ------------------
  457|     77|        (pub_key = EC_KEY_get0_public_key(eckey)) == NULL || sig == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 77]
  |  Branch (457:62): [True: 0, False: 77]
  ------------------
  458|      0|        ERR_raise(ERR_LIB_EC, EC_R_MISSING_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  459|      0|        return -1;
  460|      0|    }
  461|       |
  462|     77|    if (!EC_KEY_can_sign(eckey)) {
  ------------------
  |  Branch (462:9): [True: 0, False: 77]
  ------------------
  463|      0|        ERR_raise(ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  464|      0|        return -1;
  465|      0|    }
  466|       |
  467|     77|    ctx = BN_CTX_new_ex(eckey->libctx);
  468|     77|    if (ctx == NULL) {
  ------------------
  |  Branch (468:9): [True: 0, False: 77]
  ------------------
  469|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  470|      0|        return -1;
  471|      0|    }
  472|     77|    BN_CTX_start(ctx);
  473|     77|    u1 = BN_CTX_get(ctx);
  474|     77|    u2 = BN_CTX_get(ctx);
  475|     77|    m = BN_CTX_get(ctx);
  476|     77|    X = BN_CTX_get(ctx);
  477|     77|    if (X == NULL) {
  ------------------
  |  Branch (477:9): [True: 0, False: 77]
  ------------------
  478|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  479|      0|        goto err;
  480|      0|    }
  481|       |
  482|     77|    order = EC_GROUP_get0_order(group);
  483|     77|    if (order == NULL) {
  ------------------
  |  Branch (483:9): [True: 0, False: 77]
  ------------------
  484|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  485|      0|        goto err;
  486|      0|    }
  487|       |
  488|     77|    if (BN_is_zero(sig->r) || BN_is_negative(sig->r) ||
  ------------------
  |  Branch (488:9): [True: 1, False: 76]
  |  Branch (488:31): [True: 0, False: 76]
  ------------------
  489|     77|        BN_ucmp(sig->r, order) >= 0 || BN_is_zero(sig->s) ||
  ------------------
  |  Branch (489:9): [True: 1, False: 75]
  |  Branch (489:40): [True: 0, False: 75]
  ------------------
  490|     77|        BN_is_negative(sig->s) || BN_ucmp(sig->s, order) >= 0) {
  ------------------
  |  Branch (490:9): [True: 0, False: 75]
  |  Branch (490:35): [True: 1, False: 74]
  ------------------
  491|      3|        ERR_raise(ERR_LIB_EC, EC_R_BAD_SIGNATURE);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  492|      3|        ret = 0;                /* signature is invalid */
  493|      3|        goto err;
  494|      3|    }
  495|       |    /* calculate tmp1 = inv(S) mod order */
  496|     74|    if (!ossl_ec_group_do_inverse_ord(group, u2, sig->s, ctx)) {
  ------------------
  |  Branch (496:9): [True: 0, False: 74]
  ------------------
  497|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  498|      0|        goto err;
  499|      0|    }
  500|       |    /* digest -> m */
  501|     74|    i = BN_num_bits(order);
  502|       |    /*
  503|       |     * Need to truncate digest if it is too long: first truncate whole bytes.
  504|       |     */
  505|     74|    if (8 * dgst_len > i)
  ------------------
  |  Branch (505:9): [True: 62, False: 12]
  ------------------
  506|     62|        dgst_len = (i + 7) / 8;
  507|     74|    if (!BN_bin2bn(dgst, dgst_len, m)) {
  ------------------
  |  Branch (507:9): [True: 0, False: 74]
  ------------------
  508|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|        goto err;
  510|      0|    }
  511|       |    /* If still too long truncate remaining bits with a shift */
  512|     74|    if ((8 * dgst_len > i) && !BN_rshift(m, m, 8 - (i & 0x7))) {
  ------------------
  |  Branch (512:9): [True: 58, False: 16]
  |  Branch (512:31): [True: 0, False: 58]
  ------------------
  513|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  514|      0|        goto err;
  515|      0|    }
  516|       |    /* u1 = m * tmp mod order */
  517|     74|    if (!BN_mod_mul(u1, m, u2, order, ctx)) {
  ------------------
  |  Branch (517:9): [True: 0, False: 74]
  ------------------
  518|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  519|      0|        goto err;
  520|      0|    }
  521|       |    /* u2 = r * w mod q */
  522|     74|    if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) {
  ------------------
  |  Branch (522:9): [True: 0, False: 74]
  ------------------
  523|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  524|      0|        goto err;
  525|      0|    }
  526|       |
  527|     74|    if ((point = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (527:9): [True: 0, False: 74]
  ------------------
  528|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  529|      0|        goto err;
  530|      0|    }
  531|     74|    if (!EC_POINT_mul(group, point, u1, pub_key, u2, ctx)) {
  ------------------
  |  Branch (531:9): [True: 0, False: 74]
  ------------------
  532|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  533|      0|        goto err;
  534|      0|    }
  535|       |
  536|     74|    if (!EC_POINT_get_affine_coordinates(group, point, X, NULL, ctx)) {
  ------------------
  |  Branch (536:9): [True: 0, False: 74]
  ------------------
  537|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|      0|        goto err;
  539|      0|    }
  540|       |
  541|     74|    if (!BN_nnmod(u1, X, order, ctx)) {
  ------------------
  |  Branch (541:9): [True: 0, False: 74]
  ------------------
  542|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  543|      0|        goto err;
  544|      0|    }
  545|       |    /*  if the signature is correct u1 is equal to sig->r */
  546|     74|    ret = (BN_ucmp(u1, sig->r) == 0);
  547|     77| err:
  548|     77|    BN_CTX_end(ctx);
  549|     77|    BN_CTX_free(ctx);
  550|     77|    EC_POINT_free(point);
  551|     77|    return ret;
  552|     74|}

ECDSA_do_verify:
   28|     77|{
   29|     77|    if (eckey->meth->verify_sig != NULL)
  ------------------
  |  Branch (29:9): [True: 77, False: 0]
  ------------------
   30|     77|        return eckey->meth->verify_sig(dgst, dgst_len, sig, eckey);
   31|     77|    ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   32|      0|    return -1;
   33|     77|}
ECDSA_verify:
   43|    160|{
   44|    160|    if (eckey->meth->verify != NULL)
  ------------------
  |  Branch (44:9): [True: 160, False: 0]
  ------------------
   45|    160|        return eckey->meth->verify(type, dgst, dgst_len, sigbuf, sig_len,
   46|    160|                                   eckey);
   47|    160|    ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   48|      0|    return -1;
   49|    160|}

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

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

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

ossl_ec_GFp_nistp384_method:
 1500|  1.61k|{
 1501|  1.61k|    static const EC_METHOD ret = {
 1502|  1.61k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  1.61k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1503|  1.61k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  1.61k|#define NID_X9_62_prime_field           406
  ------------------
 1504|  1.61k|        ossl_ec_GFp_nistp384_group_init,
 1505|  1.61k|        ossl_ec_GFp_simple_group_finish,
 1506|  1.61k|        ossl_ec_GFp_simple_group_clear_finish,
 1507|  1.61k|        ossl_ec_GFp_nist_group_copy,
 1508|  1.61k|        ossl_ec_GFp_nistp384_group_set_curve,
 1509|  1.61k|        ossl_ec_GFp_simple_group_get_curve,
 1510|  1.61k|        ossl_ec_GFp_simple_group_get_degree,
 1511|  1.61k|        ossl_ec_group_simple_order_bits,
 1512|  1.61k|        ossl_ec_GFp_simple_group_check_discriminant,
 1513|  1.61k|        ossl_ec_GFp_simple_point_init,
 1514|  1.61k|        ossl_ec_GFp_simple_point_finish,
 1515|  1.61k|        ossl_ec_GFp_simple_point_clear_finish,
 1516|  1.61k|        ossl_ec_GFp_simple_point_copy,
 1517|  1.61k|        ossl_ec_GFp_simple_point_set_to_infinity,
 1518|  1.61k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1519|  1.61k|        ossl_ec_GFp_nistp384_point_get_affine_coordinates,
 1520|  1.61k|        0, /* point_set_compressed_coordinates */
 1521|  1.61k|        0, /* point2oct */
 1522|  1.61k|        0, /* oct2point */
 1523|  1.61k|        ossl_ec_GFp_simple_add,
 1524|  1.61k|        ossl_ec_GFp_simple_dbl,
 1525|  1.61k|        ossl_ec_GFp_simple_invert,
 1526|  1.61k|        ossl_ec_GFp_simple_is_at_infinity,
 1527|  1.61k|        ossl_ec_GFp_simple_is_on_curve,
 1528|  1.61k|        ossl_ec_GFp_simple_cmp,
 1529|  1.61k|        ossl_ec_GFp_simple_make_affine,
 1530|  1.61k|        ossl_ec_GFp_simple_points_make_affine,
 1531|  1.61k|        ossl_ec_GFp_nistp384_points_mul,
 1532|  1.61k|        ossl_ec_GFp_nistp384_precompute_mult,
 1533|  1.61k|        ossl_ec_GFp_nistp384_have_precompute_mult,
 1534|  1.61k|        ossl_ec_GFp_nist_field_mul,
 1535|  1.61k|        ossl_ec_GFp_nist_field_sqr,
 1536|  1.61k|        0, /* field_div */
 1537|  1.61k|        ossl_ec_GFp_simple_field_inv,
 1538|  1.61k|        0, /* field_encode */
 1539|  1.61k|        0, /* field_decode */
 1540|  1.61k|        0, /* field_set_to_one */
 1541|  1.61k|        ossl_ec_key_simple_priv2oct,
 1542|  1.61k|        ossl_ec_key_simple_oct2priv,
 1543|  1.61k|        0, /* set private */
 1544|  1.61k|        ossl_ec_key_simple_generate_key,
 1545|  1.61k|        ossl_ec_key_simple_check_key,
 1546|  1.61k|        ossl_ec_key_simple_generate_public_key,
 1547|  1.61k|        0, /* keycopy */
 1548|  1.61k|        0, /* keyfinish */
 1549|  1.61k|        ossl_ecdh_simple_compute_key,
 1550|  1.61k|        ossl_ecdsa_simple_sign_setup,
 1551|  1.61k|        ossl_ecdsa_simple_sign_sig,
 1552|  1.61k|        ossl_ecdsa_simple_verify_sig,
 1553|  1.61k|        0, /* field_inverse_mod_ord */
 1554|  1.61k|        0, /* blind_coordinates */
 1555|  1.61k|        0, /* ladder_pre */
 1556|  1.61k|        0, /* ladder_step */
 1557|  1.61k|        0  /* ladder_post */
 1558|  1.61k|    };
 1559|       |
 1560|  1.61k|    return &ret;
 1561|  1.61k|}
ossl_ec_GFp_nistp384_group_init:
 1614|  3.23k|{
 1615|  3.23k|    int ret;
 1616|       |
 1617|  3.23k|    ret = ossl_ec_GFp_simple_group_init(group);
 1618|  3.23k|    group->a_is_minus3 = 1;
 1619|  3.23k|    return ret;
 1620|  3.23k|}
ossl_ec_GFp_nistp384_group_set_curve:
 1625|  1.61k|{
 1626|  1.61k|    int ret = 0;
 1627|  1.61k|    BIGNUM *curve_p, *curve_a, *curve_b;
 1628|  1.61k|#ifndef FIPS_MODULE
 1629|  1.61k|    BN_CTX *new_ctx = NULL;
 1630|       |
 1631|  1.61k|    if (ctx == NULL)
  ------------------
  |  Branch (1631:9): [True: 0, False: 1.61k]
  ------------------
 1632|      0|        ctx = new_ctx = BN_CTX_new();
 1633|  1.61k|#endif
 1634|  1.61k|    if (ctx == NULL)
  ------------------
  |  Branch (1634:9): [True: 0, False: 1.61k]
  ------------------
 1635|      0|        return 0;
 1636|       |
 1637|  1.61k|    BN_CTX_start(ctx);
 1638|  1.61k|    curve_p = BN_CTX_get(ctx);
 1639|  1.61k|    curve_a = BN_CTX_get(ctx);
 1640|  1.61k|    curve_b = BN_CTX_get(ctx);
 1641|  1.61k|    if (curve_b == NULL)
  ------------------
  |  Branch (1641:9): [True: 0, False: 1.61k]
  ------------------
 1642|      0|        goto err;
 1643|  1.61k|    BN_bin2bn(nistp384_curve_params[0], sizeof(felem_bytearray), curve_p);
 1644|  1.61k|    BN_bin2bn(nistp384_curve_params[1], sizeof(felem_bytearray), curve_a);
 1645|  1.61k|    BN_bin2bn(nistp384_curve_params[2], sizeof(felem_bytearray), curve_b);
 1646|  1.61k|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1646:9): [True: 0, False: 1.61k]
  |  Branch (1646:33): [True: 0, False: 1.61k]
  |  Branch (1646:57): [True: 0, False: 1.61k]
  ------------------
 1647|      0|        ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1648|      0|        goto err;
 1649|      0|    }
 1650|  1.61k|    group->field_mod_func = BN_nist_mod_384;
 1651|  1.61k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1652|  1.61k| err:
 1653|  1.61k|    BN_CTX_end(ctx);
 1654|  1.61k|#ifndef FIPS_MODULE
 1655|  1.61k|    BN_CTX_free(new_ctx);
 1656|  1.61k|#endif
 1657|  1.61k|    return ret;
 1658|  1.61k|}

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

EC_GFp_nistz256_method:
 1574|    933|{
 1575|    933|    static const EC_METHOD ret = {
 1576|    933|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|    933|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1577|    933|        NID_X9_62_prime_field,
  ------------------
  |  |  152|    933|#define NID_X9_62_prime_field           406
  ------------------
 1578|    933|        ossl_ec_GFp_mont_group_init,
 1579|    933|        ossl_ec_GFp_mont_group_finish,
 1580|    933|        ossl_ec_GFp_mont_group_clear_finish,
 1581|    933|        ossl_ec_GFp_mont_group_copy,
 1582|    933|        ossl_ec_GFp_mont_group_set_curve,
 1583|    933|        ossl_ec_GFp_simple_group_get_curve,
 1584|    933|        ossl_ec_GFp_simple_group_get_degree,
 1585|    933|        ossl_ec_group_simple_order_bits,
 1586|    933|        ossl_ec_GFp_simple_group_check_discriminant,
 1587|    933|        ossl_ec_GFp_simple_point_init,
 1588|    933|        ossl_ec_GFp_simple_point_finish,
 1589|    933|        ossl_ec_GFp_simple_point_clear_finish,
 1590|    933|        ossl_ec_GFp_simple_point_copy,
 1591|    933|        ossl_ec_GFp_simple_point_set_to_infinity,
 1592|    933|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1593|    933|        ecp_nistz256_get_affine,
 1594|    933|        0, 0, 0,
 1595|    933|        ossl_ec_GFp_simple_add,
 1596|    933|        ossl_ec_GFp_simple_dbl,
 1597|    933|        ossl_ec_GFp_simple_invert,
 1598|    933|        ossl_ec_GFp_simple_is_at_infinity,
 1599|    933|        ossl_ec_GFp_simple_is_on_curve,
 1600|    933|        ossl_ec_GFp_simple_cmp,
 1601|    933|        ossl_ec_GFp_simple_make_affine,
 1602|    933|        ossl_ec_GFp_simple_points_make_affine,
 1603|    933|        ecp_nistz256_points_mul,                    /* mul */
 1604|    933|        ecp_nistz256_mult_precompute,               /* precompute_mult */
 1605|    933|        ecp_nistz256_window_have_precompute_mult,   /* have_precompute_mult */
 1606|    933|        ossl_ec_GFp_mont_field_mul,
 1607|    933|        ossl_ec_GFp_mont_field_sqr,
 1608|    933|        0,                                          /* field_div */
 1609|    933|        ossl_ec_GFp_mont_field_inv,
 1610|    933|        ossl_ec_GFp_mont_field_encode,
 1611|    933|        ossl_ec_GFp_mont_field_decode,
 1612|    933|        ossl_ec_GFp_mont_field_set_to_one,
 1613|    933|        ossl_ec_key_simple_priv2oct,
 1614|    933|        ossl_ec_key_simple_oct2priv,
 1615|    933|        0, /* set private */
 1616|    933|        ossl_ec_key_simple_generate_key,
 1617|    933|        ossl_ec_key_simple_check_key,
 1618|    933|        ossl_ec_key_simple_generate_public_key,
 1619|    933|        0, /* keycopy */
 1620|    933|        0, /* keyfinish */
 1621|    933|        ossl_ecdh_simple_compute_key,
 1622|    933|        ossl_ecdsa_simple_sign_setup,
 1623|    933|        ossl_ecdsa_simple_sign_sig,
 1624|    933|        ossl_ecdsa_simple_verify_sig,
 1625|    933|        ecp_nistz256_inv_mod_ord,                   /* can be #define-d NULL */
 1626|    933|        0,                                          /* blind_coordinates */
 1627|    933|        0,                                          /* ladder_pre */
 1628|    933|        0,                                          /* ladder_step */
 1629|    933|        0,                                          /* ladder_post */
 1630|    933|        ecp_nistz256group_full_init
 1631|    933|    };
 1632|       |
 1633|    933|    return &ret;
 1634|    933|}
ecp_nistz256.c:ecp_nistz256_get_affine:
 1162|     10|{
 1163|     10|    BN_ULONG z_inv2[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1164|     10|    BN_ULONG z_inv3[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1165|     10|    BN_ULONG x_aff[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1166|     10|    BN_ULONG y_aff[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1167|     10|    BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1168|     10|    BN_ULONG x_ret[P256_LIMBS], y_ret[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1169|       |
 1170|     10|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1170:9): [True: 0, False: 10]
  ------------------
 1171|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1172|      0|        return 0;
 1173|      0|    }
 1174|       |
 1175|     10|    if (!ecp_nistz256_bignum_to_field_elem(point_x, point->X) ||
  ------------------
  |  Branch (1175:9): [True: 0, False: 10]
  ------------------
 1176|     10|        !ecp_nistz256_bignum_to_field_elem(point_y, point->Y) ||
  ------------------
  |  Branch (1176:9): [True: 0, False: 10]
  ------------------
 1177|     10|        !ecp_nistz256_bignum_to_field_elem(point_z, point->Z)) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 10]
  ------------------
 1178|      0|        ERR_raise(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1179|      0|        return 0;
 1180|      0|    }
 1181|       |
 1182|     10|    ecp_nistz256_mod_inverse(z_inv3, point_z);
 1183|     10|    ecp_nistz256_sqr_mont(z_inv2, z_inv3);
 1184|     10|    ecp_nistz256_mul_mont(x_aff, z_inv2, point_x);
 1185|       |
 1186|     10|    if (x != NULL) {
  ------------------
  |  Branch (1186:9): [True: 10, False: 0]
  ------------------
 1187|     10|        ecp_nistz256_from_mont(x_ret, x_aff);
 1188|     10|        if (!bn_set_words(x, x_ret, P256_LIMBS))
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1188:13): [True: 0, False: 10]
  ------------------
 1189|      0|            return 0;
 1190|     10|    }
 1191|       |
 1192|     10|    if (y != NULL) {
  ------------------
  |  Branch (1192:9): [True: 0, False: 10]
  ------------------
 1193|      0|        ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2);
 1194|      0|        ecp_nistz256_mul_mont(y_aff, z_inv3, point_y);
 1195|      0|        ecp_nistz256_from_mont(y_ret, y_aff);
 1196|      0|        if (!bn_set_words(y, y_ret, P256_LIMBS))
  ------------------
  |  |   41|      0|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|      0|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1196:13): [True: 0, False: 0]
  ------------------
 1197|      0|            return 0;
 1198|      0|    }
 1199|       |
 1200|     10|    return 1;
 1201|     10|}
ecp_nistz256.c:ecp_nistz256_bignum_to_field_elem:
  602|     70|{
  603|     70|    return bn_copy_words(out, in, P256_LIMBS);
  ------------------
  |  |   41|     70|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     70|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     70|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|     70|}
ecp_nistz256.c:ecp_nistz256_mod_inverse:
  522|     10|{
  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|     10|    BN_ULONG p2[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
  528|     10|    BN_ULONG p4[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
  529|     10|    BN_ULONG p8[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
  530|     10|    BN_ULONG p16[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
  531|     10|    BN_ULONG p32[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
  532|     10|    BN_ULONG res[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
  533|     10|    int i;
  534|       |
  535|     10|    ecp_nistz256_sqr_mont(res, in);
  536|     10|    ecp_nistz256_mul_mont(p2, res, in);         /* 3*p */
  537|       |
  538|     10|    ecp_nistz256_sqr_mont(res, p2);
  539|     10|    ecp_nistz256_sqr_mont(res, res);
  540|     10|    ecp_nistz256_mul_mont(p4, res, p2);         /* f*p */
  541|       |
  542|     10|    ecp_nistz256_sqr_mont(res, p4);
  543|     10|    ecp_nistz256_sqr_mont(res, res);
  544|     10|    ecp_nistz256_sqr_mont(res, res);
  545|     10|    ecp_nistz256_sqr_mont(res, res);
  546|     10|    ecp_nistz256_mul_mont(p8, res, p4);         /* ff*p */
  547|       |
  548|     10|    ecp_nistz256_sqr_mont(res, p8);
  549|     80|    for (i = 0; i < 7; i++)
  ------------------
  |  Branch (549:17): [True: 70, False: 10]
  ------------------
  550|     70|        ecp_nistz256_sqr_mont(res, res);
  551|     10|    ecp_nistz256_mul_mont(p16, res, p8);        /* ffff*p */
  552|       |
  553|     10|    ecp_nistz256_sqr_mont(res, p16);
  554|    160|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (554:17): [True: 150, False: 10]
  ------------------
  555|    150|        ecp_nistz256_sqr_mont(res, res);
  556|     10|    ecp_nistz256_mul_mont(p32, res, p16);       /* ffffffff*p */
  557|       |
  558|     10|    ecp_nistz256_sqr_mont(res, p32);
  559|    320|    for (i = 0; i < 31; i++)
  ------------------
  |  Branch (559:17): [True: 310, False: 10]
  ------------------
  560|    310|        ecp_nistz256_sqr_mont(res, res);
  561|     10|    ecp_nistz256_mul_mont(res, res, in);
  562|       |
  563|  1.29k|    for (i = 0; i < 32 * 4; i++)
  ------------------
  |  Branch (563:17): [True: 1.28k, False: 10]
  ------------------
  564|  1.28k|        ecp_nistz256_sqr_mont(res, res);
  565|     10|    ecp_nistz256_mul_mont(res, res, p32);
  566|       |
  567|    330|    for (i = 0; i < 32; i++)
  ------------------
  |  Branch (567:17): [True: 320, False: 10]
  ------------------
  568|    320|        ecp_nistz256_sqr_mont(res, res);
  569|     10|    ecp_nistz256_mul_mont(res, res, p32);
  570|       |
  571|    170|    for (i = 0; i < 16; i++)
  ------------------
  |  Branch (571:17): [True: 160, False: 10]
  ------------------
  572|    160|        ecp_nistz256_sqr_mont(res, res);
  573|     10|    ecp_nistz256_mul_mont(res, res, p16);
  574|       |
  575|     90|    for (i = 0; i < 8; i++)
  ------------------
  |  Branch (575:17): [True: 80, False: 10]
  ------------------
  576|     80|        ecp_nistz256_sqr_mont(res, res);
  577|     10|    ecp_nistz256_mul_mont(res, res, p8);
  578|       |
  579|     10|    ecp_nistz256_sqr_mont(res, res);
  580|     10|    ecp_nistz256_sqr_mont(res, res);
  581|     10|    ecp_nistz256_sqr_mont(res, res);
  582|     10|    ecp_nistz256_sqr_mont(res, res);
  583|     10|    ecp_nistz256_mul_mont(res, res, p4);
  584|       |
  585|     10|    ecp_nistz256_sqr_mont(res, res);
  586|     10|    ecp_nistz256_sqr_mont(res, res);
  587|     10|    ecp_nistz256_mul_mont(res, res, p2);
  588|       |
  589|     10|    ecp_nistz256_sqr_mont(res, res);
  590|     10|    ecp_nistz256_sqr_mont(res, res);
  591|     10|    ecp_nistz256_mul_mont(res, res, in);
  592|       |
  593|     10|    memcpy(r, res, sizeof(res));
  594|     10|}
ecp_nistz256.c:ecp_nistz256_points_mul:
  945|     10|{
  946|     10|    int i = 0, ret = 0, no_precomp_for_generator = 0, p_is_infinity = 0;
  947|     10|    unsigned char p_str[33] = { 0 };
  948|     10|    const PRECOMP256_ROW *preComputedTable = NULL;
  949|     10|    const NISTZ256_PRE_COMP *pre_comp = NULL;
  950|     10|    const EC_POINT *generator = NULL;
  951|     10|    const BIGNUM **new_scalars = NULL;
  952|     10|    const EC_POINT **new_points = NULL;
  953|     10|    unsigned int idx = 0;
  954|     10|    const unsigned int window_size = 7;
  955|     10|    const unsigned int mask = (1 << (window_size + 1)) - 1;
  956|     10|    unsigned int wvalue;
  957|     10|    ALIGN32 union {
  ------------------
  |  |   30|     10|#  define ALIGN32       __attribute((aligned(32)))
  ------------------
  958|     10|        P256_POINT p;
  959|     10|        P256_POINT_AFFINE a;
  960|     10|    } t, p;
  961|     10|    BIGNUM *tmp_scalar;
  962|       |
  963|     10|    if ((num + 1) == 0 || (num + 1) > OPENSSL_MALLOC_MAX_NELEMS(void *)) {
  ------------------
  |  |  148|     10|# define OPENSSL_MALLOC_MAX_NELEMS(type)  (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
  ------------------
  |  Branch (963:9): [True: 0, False: 10]
  |  Branch (963:27): [True: 0, False: 10]
  ------------------
  964|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  965|      0|        return 0;
  966|      0|    }
  967|       |
  968|     10|    memset(&p, 0, sizeof(p));
  969|     10|    BN_CTX_start(ctx);
  970|       |
  971|     10|    if (scalar) {
  ------------------
  |  Branch (971:9): [True: 10, False: 0]
  ------------------
  972|     10|        generator = EC_GROUP_get0_generator(group);
  973|     10|        if (generator == NULL) {
  ------------------
  |  Branch (973:13): [True: 0, False: 10]
  ------------------
  974|      0|            ERR_raise(ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  975|      0|            goto err;
  976|      0|        }
  977|       |
  978|       |        /* look if we can use precomputed multiples of generator */
  979|     10|        pre_comp = group->pre_comp.nistz256;
  980|       |
  981|     10|        if (pre_comp) {
  ------------------
  |  Branch (981:13): [True: 0, False: 10]
  ------------------
  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|     10|        if (preComputedTable == NULL && ecp_nistz256_is_affine_G(generator)) {
  ------------------
  |  Branch (1003:13): [True: 10, False: 0]
  |  Branch (1003:41): [True: 10, 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|     10|            preComputedTable = ecp_nistz256_precomputed;
 1011|     10|        }
 1012|       |
 1013|     10|        if (preComputedTable) {
  ------------------
  |  Branch (1013:13): [True: 10, False: 0]
  ------------------
 1014|     10|            BN_ULONG infty;
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1015|       |
 1016|     10|            if ((BN_num_bits(scalar) > 256)
  ------------------
  |  Branch (1016:17): [True: 0, False: 10]
  ------------------
 1017|     10|                || BN_is_negative(scalar)) {
  ------------------
  |  Branch (1017:20): [True: 0, False: 10]
  ------------------
 1018|      0|                if ((tmp_scalar = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (1018:21): [True: 0, False: 0]
  ------------------
 1019|      0|                    goto err;
 1020|       |
 1021|      0|                if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1021:21): [True: 0, False: 0]
  ------------------
 1022|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1023|      0|                    goto err;
 1024|      0|                }
 1025|      0|                scalar = tmp_scalar;
 1026|      0|            }
 1027|       |
 1028|     50|            for (i = 0; i < bn_get_top(scalar) * BN_BYTES; i += BN_BYTES) {
  ------------------
  |  |   38|     50|#  define BN_BYTES        8
  ------------------
                          for (i = 0; i < bn_get_top(scalar) * BN_BYTES; i += BN_BYTES) {
  ------------------
  |  |   38|     40|#  define BN_BYTES        8
  ------------------
  |  Branch (1028:25): [True: 40, False: 10]
  ------------------
 1029|     40|                BN_ULONG d = bn_get_words(scalar)[i / BN_BYTES];
  ------------------
  |  |   37|     40|#  define BN_ULONG        unsigned long
  ------------------
                              BN_ULONG d = bn_get_words(scalar)[i / BN_BYTES];
  ------------------
  |  |   38|     40|#  define BN_BYTES        8
  ------------------
 1030|       |
 1031|     40|                p_str[i + 0] = (unsigned char)d;
 1032|     40|                p_str[i + 1] = (unsigned char)(d >> 8);
 1033|     40|                p_str[i + 2] = (unsigned char)(d >> 16);
 1034|     40|                p_str[i + 3] = (unsigned char)(d >>= 24);
 1035|     40|                if (BN_BYTES == 8) {
  ------------------
  |  |   38|     40|#  define BN_BYTES        8
  ------------------
  |  Branch (1035:21): [Folded - Ignored]
  ------------------
 1036|     40|                    d >>= 8;
 1037|     40|                    p_str[i + 4] = (unsigned char)d;
 1038|     40|                    p_str[i + 5] = (unsigned char)(d >> 8);
 1039|     40|                    p_str[i + 6] = (unsigned char)(d >> 16);
 1040|     40|                    p_str[i + 7] = (unsigned char)(d >> 24);
 1041|     40|                }
 1042|     40|            }
 1043|       |
 1044|     20|            for (; i < 33; i++)
  ------------------
  |  Branch (1044:20): [True: 10, False: 10]
  ------------------
 1045|     10|                p_str[i] = 0;
 1046|       |
 1047|       |            /* First window */
 1048|     10|            wvalue = (p_str[0] << 1) & mask;
 1049|     10|            idx += window_size;
 1050|       |
 1051|     10|            wvalue = _booth_recode_w7(wvalue);
 1052|       |
 1053|     10|            ecp_nistz256_gather_w7(&p.a, preComputedTable[0],
 1054|     10|                                   wvalue >> 1);
 1055|       |
 1056|     10|            ecp_nistz256_neg(p.p.Z, p.p.Y);
 1057|     10|            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|     10|            infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] |
 1065|     10|                     p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
 1066|     10|            if (P256_LIMBS == 8)
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  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|     10|            infty = 0 - is_zero(infty);
 1071|     10|            infty = ~infty;
 1072|       |
 1073|     10|            p.p.Z[0] = ONE[0] & infty;
 1074|     10|            p.p.Z[1] = ONE[1] & infty;
 1075|     10|            p.p.Z[2] = ONE[2] & infty;
 1076|     10|            p.p.Z[3] = ONE[3] & infty;
 1077|     10|            if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  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|    370|            for (i = 1; i < 37; i++) {
  ------------------
  |  Branch (1084:25): [True: 360, False: 10]
  ------------------
 1085|    360|                unsigned int off = (idx - 1) / 8;
 1086|    360|                wvalue = p_str[off] | p_str[off + 1] << 8;
 1087|    360|                wvalue = (wvalue >> ((idx - 1) % 8)) & mask;
 1088|    360|                idx += window_size;
 1089|       |
 1090|    360|                wvalue = _booth_recode_w7(wvalue);
 1091|       |
 1092|    360|                ecp_nistz256_gather_w7(&t.a,
 1093|    360|                                       preComputedTable[i], wvalue >> 1);
 1094|       |
 1095|    360|                ecp_nistz256_neg(t.p.Z, t.a.Y);
 1096|    360|                copy_conditional(t.a.Y, t.p.Z, wvalue & 1);
 1097|       |
 1098|    360|                ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a);
 1099|    360|            }
 1100|     10|        } else {
 1101|      0|            p_is_infinity = 1;
 1102|      0|            no_precomp_for_generator = 1;
 1103|      0|        }
 1104|     10|    } else
 1105|      0|        p_is_infinity = 1;
 1106|       |
 1107|     10|    if (no_precomp_for_generator) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 10]
  ------------------
 1108|       |        /*
 1109|       |         * Without a precomputed table for the generator, it has to be
 1110|       |         * handled like a normal point.
 1111|       |         */
 1112|      0|        new_scalars = OPENSSL_malloc((num + 1) * sizeof(BIGNUM *));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1113|      0|        if (new_scalars == NULL)
  ------------------
  |  Branch (1113:13): [True: 0, False: 0]
  ------------------
 1114|      0|            goto err;
 1115|       |
 1116|      0|        new_points = OPENSSL_malloc((num + 1) * sizeof(EC_POINT *));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1117|      0|        if (new_points == NULL)
  ------------------
  |  Branch (1117:13): [True: 0, False: 0]
  ------------------
 1118|      0|            goto err;
 1119|       |
 1120|      0|        memcpy(new_scalars, scalars, num * sizeof(BIGNUM *));
 1121|      0|        new_scalars[num] = scalar;
 1122|      0|        memcpy(new_points, points, num * sizeof(EC_POINT *));
 1123|      0|        new_points[num] = generator;
 1124|       |
 1125|      0|        scalars = new_scalars;
 1126|      0|        points = new_points;
 1127|      0|        num++;
 1128|      0|    }
 1129|       |
 1130|     10|    if (num) {
  ------------------
  |  Branch (1130:9): [True: 10, False: 0]
  ------------------
 1131|     10|        P256_POINT *out = &t.p;
 1132|     10|        if (p_is_infinity)
  ------------------
  |  Branch (1132:13): [True: 0, False: 10]
  ------------------
 1133|      0|            out = &p.p;
 1134|       |
 1135|     10|        if (!ecp_nistz256_windowed_mul(group, out, scalars, points, num, ctx))
  ------------------
  |  Branch (1135:13): [True: 0, False: 10]
  ------------------
 1136|      0|            goto err;
 1137|       |
 1138|     10|        if (!p_is_infinity)
  ------------------
  |  Branch (1138:13): [True: 10, False: 0]
  ------------------
 1139|     10|            ecp_nistz256_point_add(&p.p, &p.p, out);
 1140|     10|    }
 1141|       |
 1142|       |    /* Not constant-time, but we're only operating on the public output. */
 1143|     10|    if (!bn_set_words(r->X, p.p.X, P256_LIMBS) ||
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1143:9): [True: 0, False: 10]
  ------------------
 1144|     10|        !bn_set_words(r->Y, p.p.Y, P256_LIMBS) ||
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1144:9): [True: 0, False: 10]
  ------------------
 1145|     10|        !bn_set_words(r->Z, p.p.Z, P256_LIMBS)) {
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1145:9): [True: 0, False: 10]
  ------------------
 1146|      0|        goto err;
 1147|      0|    }
 1148|     10|    r->Z_is_one = is_one(r->Z) & 1;
 1149|       |
 1150|     10|    ret = 1;
 1151|       |
 1152|     10|err:
 1153|     10|    BN_CTX_end(ctx);
 1154|     10|    OPENSSL_free(new_points);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1155|     10|    OPENSSL_free(new_scalars);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1156|     10|    return ret;
 1157|     10|}
ecp_nistz256.c:ecp_nistz256_is_affine_G:
  794|     10|{
  795|     10|    return (bn_get_top(generator->X) == P256_LIMBS) &&
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (795:12): [True: 10, False: 0]
  ------------------
  796|     10|        (bn_get_top(generator->Y) == P256_LIMBS) &&
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (796:9): [True: 10, False: 0]
  ------------------
  797|     10|        is_equal(bn_get_words(generator->X), def_xG) &&
  ------------------
  |  Branch (797:9): [True: 10, False: 0]
  ------------------
  798|     10|        is_equal(bn_get_words(generator->Y), def_yG) &&
  ------------------
  |  Branch (798:9): [True: 10, False: 0]
  ------------------
  799|     10|        is_one(generator->Z);
  ------------------
  |  Branch (799:9): [True: 10, False: 0]
  ------------------
  800|     10|}
ecp_nistz256.c:is_equal:
  196|     20|{
  197|     20|    BN_ULONG res;
  ------------------
  |  |   37|     20|#  define BN_ULONG        unsigned long
  ------------------
  198|       |
  199|     20|    res = a[0] ^ b[0];
  200|     20|    res |= a[1] ^ b[1];
  201|     20|    res |= a[2] ^ b[2];
  202|     20|    res |= a[3] ^ b[3];
  203|     20|    if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     20|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     20|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     20|#  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|     20|    return is_zero(res);
  211|     20|}
ecp_nistz256.c:_booth_recode_w7:
  157|    370|{
  158|    370|    unsigned int s, d;
  159|       |
  160|    370|    s = ~((in >> 7) - 1);
  161|    370|    d = (1 << 8) - in - 1;
  162|    370|    d = (d & s) | (in & ~s);
  163|    370|    d = (d >> 1) + (d & 1);
  164|       |
  165|    370|    return (d << 1) + (s & 1);
  166|    370|}
ecp_nistz256.c:copy_conditional:
  170|    880|{
  171|    880|    BN_ULONG mask1 = 0-move;
  ------------------
  |  |   37|    880|#  define BN_ULONG        unsigned long
  ------------------
  172|    880|    BN_ULONG mask2 = ~mask1;
  ------------------
  |  |   37|    880|#  define BN_ULONG        unsigned long
  ------------------
  173|       |
  174|    880|    dst[0] = (src[0] & mask1) ^ (dst[0] & mask2);
  175|    880|    dst[1] = (src[1] & mask1) ^ (dst[1] & mask2);
  176|    880|    dst[2] = (src[2] & mask1) ^ (dst[2] & mask2);
  177|    880|    dst[3] = (src[3] & mask1) ^ (dst[3] & mask2);
  178|    880|    if (P256_LIMBS == 8) {
  ------------------
  |  |   41|    880|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    880|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    880|#  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|    880|}
ecp_nistz256.c:is_zero:
  187|     50|{
  188|     50|    in |= (0 - in);
  189|     50|    in = ~in;
  190|     50|    in >>= BN_BITS2 - 1;
  ------------------
  |  |   54|     50|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     50|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  191|     50|    return in;
  192|     50|}
ecp_nistz256.c:ecp_nistz256_windowed_mul:
  612|     10|{
  613|     10|    size_t i;
  614|     10|    int j, ret = 0;
  615|     10|    unsigned int idx;
  616|     10|    unsigned char (*p_str)[33] = NULL;
  617|     10|    const unsigned int window_size = 5;
  618|     10|    const unsigned int mask = (1 << (window_size + 1)) - 1;
  619|     10|    unsigned int wvalue;
  620|     10|    P256_POINT *temp;           /* place for 5 temporary points */
  621|     10|    const BIGNUM **scalars = NULL;
  622|     10|    P256_POINT (*table)[16] = NULL;
  623|     10|    void *table_storage = NULL;
  624|       |
  625|     10|    if ((num * 16 + 6) > OPENSSL_MALLOC_MAX_NELEMS(P256_POINT)
  ------------------
  |  |  148|     20|# define OPENSSL_MALLOC_MAX_NELEMS(type)  (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
  ------------------
  |  Branch (625:9): [True: 0, False: 10]
  ------------------
  626|     10|        || (table_storage =
  ------------------
  |  Branch (626:12): [True: 0, False: 10]
  ------------------
  627|     10|            OPENSSL_malloc((num * 16 + 5) * sizeof(P256_POINT) + 64)) == NULL
  ------------------
  |  |  102|     10|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  628|     10|        || (p_str =
  ------------------
  |  Branch (628:12): [True: 0, False: 10]
  ------------------
  629|     10|            OPENSSL_malloc(num * 33 * sizeof(unsigned char))) == NULL
  ------------------
  |  |  102|     10|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  630|     10|        || (scalars = OPENSSL_malloc(num * sizeof(BIGNUM *))) == NULL)
  ------------------
  |  |  102|     10|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (630:12): [True: 0, False: 10]
  ------------------
  631|      0|        goto err;
  632|       |
  633|     10|    table = (void *)ALIGNPTR(table_storage, 64);
  ------------------
  |  |   40|     10|#define ALIGNPTR(p,N)   ((unsigned char *)p+N-(size_t)p%N)
  ------------------
  634|     10|    temp = (P256_POINT *)(table + num);
  635|       |
  636|     20|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (636:17): [True: 10, False: 10]
  ------------------
  637|     10|        P256_POINT *row = table[i];
  638|       |
  639|       |        /* This is an unusual input, we don't guarantee constant-timeness. */
  640|     10|        if ((BN_num_bits(scalar[i]) > 256) || BN_is_negative(scalar[i])) {
  ------------------
  |  Branch (640:13): [True: 0, False: 10]
  |  Branch (640:47): [True: 0, False: 10]
  ------------------
  641|      0|            BIGNUM *mod;
  642|       |
  643|      0|            if ((mod = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (643:17): [True: 0, False: 0]
  ------------------
  644|      0|                goto err;
  645|      0|            if (!BN_nnmod(mod, scalar[i], group->order, ctx)) {
  ------------------
  |  Branch (645:17): [True: 0, False: 0]
  ------------------
  646|      0|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  647|      0|                goto err;
  648|      0|            }
  649|      0|            scalars[i] = mod;
  650|      0|        } else
  651|     10|            scalars[i] = scalar[i];
  652|       |
  653|     50|        for (j = 0; j < bn_get_top(scalars[i]) * BN_BYTES; j += BN_BYTES) {
  ------------------
  |  |   38|     50|#  define BN_BYTES        8
  ------------------
                      for (j = 0; j < bn_get_top(scalars[i]) * BN_BYTES; j += BN_BYTES) {
  ------------------
  |  |   38|     40|#  define BN_BYTES        8
  ------------------
  |  Branch (653:21): [True: 40, False: 10]
  ------------------
  654|     40|            BN_ULONG d = bn_get_words(scalars[i])[j / BN_BYTES];
  ------------------
  |  |   37|     40|#  define BN_ULONG        unsigned long
  ------------------
                          BN_ULONG d = bn_get_words(scalars[i])[j / BN_BYTES];
  ------------------
  |  |   38|     40|#  define BN_BYTES        8
  ------------------
  655|       |
  656|     40|            p_str[i][j + 0] = (unsigned char)d;
  657|     40|            p_str[i][j + 1] = (unsigned char)(d >> 8);
  658|     40|            p_str[i][j + 2] = (unsigned char)(d >> 16);
  659|     40|            p_str[i][j + 3] = (unsigned char)(d >>= 24);
  660|     40|            if (BN_BYTES == 8) {
  ------------------
  |  |   38|     40|#  define BN_BYTES        8
  ------------------
  |  Branch (660:17): [Folded - Ignored]
  ------------------
  661|     40|                d >>= 8;
  662|     40|                p_str[i][j + 4] = (unsigned char)d;
  663|     40|                p_str[i][j + 5] = (unsigned char)(d >> 8);
  664|     40|                p_str[i][j + 6] = (unsigned char)(d >> 16);
  665|     40|                p_str[i][j + 7] = (unsigned char)(d >> 24);
  666|     40|            }
  667|     40|        }
  668|     20|        for (; j < 33; j++)
  ------------------
  |  Branch (668:16): [True: 10, False: 10]
  ------------------
  669|     10|            p_str[i][j] = 0;
  670|       |
  671|     10|        if (!ecp_nistz256_bignum_to_field_elem(temp[0].X, point[i]->X)
  ------------------
  |  Branch (671:13): [True: 0, False: 10]
  ------------------
  672|     10|            || !ecp_nistz256_bignum_to_field_elem(temp[0].Y, point[i]->Y)
  ------------------
  |  Branch (672:16): [True: 0, False: 10]
  ------------------
  673|     10|            || !ecp_nistz256_bignum_to_field_elem(temp[0].Z, point[i]->Z)) {
  ------------------
  |  Branch (673:16): [True: 0, False: 10]
  ------------------
  674|      0|            ERR_raise(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  675|      0|            goto err;
  676|      0|        }
  677|       |
  678|       |        /*
  679|       |         * row[0] is implicitly (0,0,0) (the point at infinity), therefore it
  680|       |         * is not stored. All other values are actually stored with an offset
  681|       |         * of -1 in table.
  682|       |         */
  683|       |
  684|     10|        ecp_nistz256_scatter_w5  (row, &temp[0], 1);
  685|     10|        ecp_nistz256_point_double(&temp[1], &temp[0]);              /*1+1=2  */
  686|     10|        ecp_nistz256_scatter_w5  (row, &temp[1], 2);
  687|     10|        ecp_nistz256_point_add   (&temp[2], &temp[1], &temp[0]);    /*2+1=3  */
  688|     10|        ecp_nistz256_scatter_w5  (row, &temp[2], 3);
  689|     10|        ecp_nistz256_point_double(&temp[1], &temp[1]);              /*2*2=4  */
  690|     10|        ecp_nistz256_scatter_w5  (row, &temp[1], 4);
  691|     10|        ecp_nistz256_point_double(&temp[2], &temp[2]);              /*2*3=6  */
  692|     10|        ecp_nistz256_scatter_w5  (row, &temp[2], 6);
  693|     10|        ecp_nistz256_point_add   (&temp[3], &temp[1], &temp[0]);    /*4+1=5  */
  694|     10|        ecp_nistz256_scatter_w5  (row, &temp[3], 5);
  695|     10|        ecp_nistz256_point_add   (&temp[4], &temp[2], &temp[0]);    /*6+1=7  */
  696|     10|        ecp_nistz256_scatter_w5  (row, &temp[4], 7);
  697|     10|        ecp_nistz256_point_double(&temp[1], &temp[1]);              /*2*4=8  */
  698|     10|        ecp_nistz256_scatter_w5  (row, &temp[1], 8);
  699|     10|        ecp_nistz256_point_double(&temp[2], &temp[2]);              /*2*6=12 */
  700|     10|        ecp_nistz256_scatter_w5  (row, &temp[2], 12);
  701|     10|        ecp_nistz256_point_double(&temp[3], &temp[3]);              /*2*5=10 */
  702|     10|        ecp_nistz256_scatter_w5  (row, &temp[3], 10);
  703|     10|        ecp_nistz256_point_double(&temp[4], &temp[4]);              /*2*7=14 */
  704|     10|        ecp_nistz256_scatter_w5  (row, &temp[4], 14);
  705|     10|        ecp_nistz256_point_add   (&temp[2], &temp[2], &temp[0]);    /*12+1=13*/
  706|     10|        ecp_nistz256_scatter_w5  (row, &temp[2], 13);
  707|     10|        ecp_nistz256_point_add   (&temp[3], &temp[3], &temp[0]);    /*10+1=11*/
  708|     10|        ecp_nistz256_scatter_w5  (row, &temp[3], 11);
  709|     10|        ecp_nistz256_point_add   (&temp[4], &temp[4], &temp[0]);    /*14+1=15*/
  710|     10|        ecp_nistz256_scatter_w5  (row, &temp[4], 15);
  711|     10|        ecp_nistz256_point_add   (&temp[2], &temp[1], &temp[0]);    /*8+1=9  */
  712|     10|        ecp_nistz256_scatter_w5  (row, &temp[2], 9);
  713|     10|        ecp_nistz256_point_double(&temp[1], &temp[1]);              /*2*8=16 */
  714|     10|        ecp_nistz256_scatter_w5  (row, &temp[1], 16);
  715|     10|    }
  716|       |
  717|     10|    idx = 255;
  718|       |
  719|     10|    wvalue = p_str[0][(idx - 1) / 8];
  720|     10|    wvalue = (wvalue >> ((idx - 1) % 8)) & mask;
  721|       |
  722|       |    /*
  723|       |     * We gather to temp[0], because we know it's position relative
  724|       |     * to table
  725|       |     */
  726|     10|    ecp_nistz256_gather_w5(&temp[0], table[0], _booth_recode_w5(wvalue) >> 1);
  727|     10|    memcpy(r, &temp[0], sizeof(temp[0]));
  728|       |
  729|    520|    while (idx >= 5) {
  ------------------
  |  Branch (729:12): [True: 510, False: 10]
  ------------------
  730|  1.01k|        for (i = (idx == 255 ? 1 : 0); i < num; i++) {
  ------------------
  |  Branch (730:19): [True: 10, False: 500]
  |  Branch (730:40): [True: 500, False: 510]
  ------------------
  731|    500|            unsigned int off = (idx - 1) / 8;
  732|       |
  733|    500|            wvalue = p_str[i][off] | p_str[i][off + 1] << 8;
  734|    500|            wvalue = (wvalue >> ((idx - 1) % 8)) & mask;
  735|       |
  736|    500|            wvalue = _booth_recode_w5(wvalue);
  737|       |
  738|    500|            ecp_nistz256_gather_w5(&temp[0], table[i], wvalue >> 1);
  739|       |
  740|    500|            ecp_nistz256_neg(temp[1].Y, temp[0].Y);
  741|    500|            copy_conditional(temp[0].Y, temp[1].Y, (wvalue & 1));
  742|       |
  743|    500|            ecp_nistz256_point_add(r, r, &temp[0]);
  744|    500|        }
  745|       |
  746|    510|        idx -= window_size;
  747|       |
  748|    510|        ecp_nistz256_point_double(r, r);
  749|    510|        ecp_nistz256_point_double(r, r);
  750|    510|        ecp_nistz256_point_double(r, r);
  751|    510|        ecp_nistz256_point_double(r, r);
  752|    510|        ecp_nistz256_point_double(r, r);
  753|    510|    }
  754|       |
  755|       |    /* Final window */
  756|     20|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (756:17): [True: 10, False: 10]
  ------------------
  757|     10|        wvalue = p_str[i][0];
  758|     10|        wvalue = (wvalue << 1) & mask;
  759|       |
  760|     10|        wvalue = _booth_recode_w5(wvalue);
  761|       |
  762|     10|        ecp_nistz256_gather_w5(&temp[0], table[i], wvalue >> 1);
  763|       |
  764|     10|        ecp_nistz256_neg(temp[1].Y, temp[0].Y);
  765|     10|        copy_conditional(temp[0].Y, temp[1].Y, wvalue & 1);
  766|       |
  767|     10|        ecp_nistz256_point_add(r, r, &temp[0]);
  768|     10|    }
  769|       |
  770|     10|    ret = 1;
  771|     10| err:
  772|     10|    OPENSSL_free(table_storage);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  773|     10|    OPENSSL_free(p_str);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  774|     10|    OPENSSL_free(scalars);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  775|     10|    return ret;
  776|     10|}
ecp_nistz256.c:_booth_recode_w5:
  145|    520|{
  146|    520|    unsigned int s, d;
  147|       |
  148|    520|    s = ~((in >> 5) - 1);
  149|    520|    d = (1 << 6) - in - 1;
  150|    520|    d = (d & s) | (in & ~s);
  151|    520|    d = (d >> 1) + (d & 1);
  152|       |
  153|    520|    return (d << 1) + (s & 1);
  154|    520|}
ecp_nistz256.c:is_one:
  214|     20|{
  215|     20|    BN_ULONG res = 0;
  ------------------
  |  |   37|     20|#  define BN_ULONG        unsigned long
  ------------------
  216|     20|    BN_ULONG *a = bn_get_words(z);
  ------------------
  |  |   37|     20|#  define BN_ULONG        unsigned long
  ------------------
  217|       |
  218|     20|    if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) {
  ------------------
  |  |   41|     20|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     20|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     20|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) {
  ------------------
  |  |   41|     20|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     20|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     20|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (218:9): [True: 20, False: 0]
  ------------------
  219|     20|        res = a[0] ^ ONE[0];
  220|     20|        res |= a[1] ^ ONE[1];
  221|     20|        res |= a[2] ^ ONE[2];
  222|     20|        res |= a[3] ^ ONE[3];
  223|     20|        if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     20|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     20|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     20|#  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|     20|        res = is_zero(res);
  233|     20|    }
  234|       |
  235|     20|    return res;
  236|     20|}
ecp_nistz256.c:ecp_nistz256_inv_mod_ord:
 1281|     10|{
 1282|       |    /* RR = 2^512 mod ord(p256) */
 1283|     10|    static const BN_ULONG RR[P256_LIMBS]  = {
 1284|     10|        TOBN(0x83244c95,0xbe79eea2), TOBN(0x4699799c,0x49bd6fa6),
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
                      TOBN(0x83244c95,0xbe79eea2), TOBN(0x4699799c,0x49bd6fa6),
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
 1285|     10|        TOBN(0x2845b239,0x2b6bec59), TOBN(0x66e12d94,0xf3d95620)
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
                      TOBN(0x2845b239,0x2b6bec59), TOBN(0x66e12d94,0xf3d95620)
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
 1286|     10|    };
 1287|       |    /* The constant 1 (unlike ONE that is one in Montgomery representation) */
 1288|     10|    static const BN_ULONG one[P256_LIMBS] = {
 1289|     10|        TOBN(0,1), TOBN(0,0), TOBN(0,0), TOBN(0,0)
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
                      TOBN(0,1), TOBN(0,0), TOBN(0,0), TOBN(0,0)
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
                      TOBN(0,1), TOBN(0,0), TOBN(0,0), TOBN(0,0)
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
                      TOBN(0,1), TOBN(0,0), TOBN(0,0), TOBN(0,0)
  ------------------
  |  |   37|     10|# define TOBN(hi,lo)    ((BN_ULONG)hi<<32|lo)
  ------------------
 1290|     10|    };
 1291|       |    /*
 1292|       |     * We don't use entry 0 in the table, so we omit it and address
 1293|       |     * with -1 offset.
 1294|       |     */
 1295|     10|    BN_ULONG table[15][P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1296|     10|    BN_ULONG out[P256_LIMBS], t[P256_LIMBS];
  ------------------
  |  |   37|     10|#  define BN_ULONG        unsigned long
  ------------------
 1297|     10|    int i, ret = 0;
 1298|     10|    enum {
 1299|     10|        i_1 = 0, i_10,     i_11,     i_101, i_111, i_1010, i_1111,
 1300|     10|        i_10101, i_101010, i_101111, i_x6,  i_x8,  i_x16,  i_x32
 1301|     10|    };
 1302|       |
 1303|       |    /*
 1304|       |     * Catch allocation failure early.
 1305|       |     */
 1306|     10|    if (bn_wexpand(r, P256_LIMBS) == NULL) {
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1306:9): [True: 0, False: 10]
  ------------------
 1307|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1308|      0|        goto err;
 1309|      0|    }
 1310|       |
 1311|     10|    if ((BN_num_bits(x) > 256) || BN_is_negative(x)) {
  ------------------
  |  Branch (1311:9): [True: 0, False: 10]
  |  Branch (1311:35): [True: 0, False: 10]
  ------------------
 1312|      0|        BIGNUM *tmp;
 1313|       |
 1314|      0|        if ((tmp = BN_CTX_get(ctx)) == NULL
  ------------------
  |  Branch (1314:13): [True: 0, False: 0]
  ------------------
 1315|      0|            || !BN_nnmod(tmp, x, group->order, ctx)) {
  ------------------
  |  Branch (1315:16): [True: 0, False: 0]
  ------------------
 1316|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1317|      0|            goto err;
 1318|      0|        }
 1319|      0|        x = tmp;
 1320|      0|    }
 1321|       |
 1322|     10|    if (!ecp_nistz256_bignum_to_field_elem(t, x)) {
  ------------------
  |  Branch (1322:9): [True: 0, False: 10]
  ------------------
 1323|      0|        ERR_raise(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1324|      0|        goto err;
 1325|      0|    }
 1326|       |
 1327|     10|    ecp_nistz256_ord_mul_mont(table[0], t, RR);
 1328|       |#if 0
 1329|       |    /*
 1330|       |     * Original sparse-then-fixed-window algorithm, retained for reference.
 1331|       |     */
 1332|       |    for (i = 2; i < 16; i += 2) {
 1333|       |        ecp_nistz256_ord_sqr_mont(table[i-1], table[i/2-1], 1);
 1334|       |        ecp_nistz256_ord_mul_mont(table[i], table[i-1], table[0]);
 1335|       |    }
 1336|       |
 1337|       |    /*
 1338|       |     * The top 128bit of the exponent are highly redudndant, so we
 1339|       |     * perform an optimized flow
 1340|       |     */
 1341|       |    ecp_nistz256_ord_sqr_mont(t, table[15-1], 4);   /* f0 */
 1342|       |    ecp_nistz256_ord_mul_mont(t, t, table[15-1]);   /* ff */
 1343|       |
 1344|       |    ecp_nistz256_ord_sqr_mont(out, t, 8);           /* ff00 */
 1345|       |    ecp_nistz256_ord_mul_mont(out, out, t);         /* ffff */
 1346|       |
 1347|       |    ecp_nistz256_ord_sqr_mont(t, out, 16);          /* ffff0000 */
 1348|       |    ecp_nistz256_ord_mul_mont(t, t, out);           /* ffffffff */
 1349|       |
 1350|       |    ecp_nistz256_ord_sqr_mont(out, t, 64);          /* ffffffff0000000000000000 */
 1351|       |    ecp_nistz256_ord_mul_mont(out, out, t);         /* ffffffff00000000ffffffff */
 1352|       |
 1353|       |    ecp_nistz256_ord_sqr_mont(out, out, 32);        /* ffffffff00000000ffffffff00000000 */
 1354|       |    ecp_nistz256_ord_mul_mont(out, out, t);         /* ffffffff00000000ffffffffffffffff */
 1355|       |
 1356|       |    /*
 1357|       |     * The bottom 128 bit of the exponent are processed with fixed 4-bit window
 1358|       |     */
 1359|       |    for (i = 0; i < 32; i++) {
 1360|       |        /* expLo - the low 128 bits of the exponent we use (ord(p256) - 2),
 1361|       |         * split into nibbles */
 1362|       |        static const unsigned char expLo[32]  = {
 1363|       |            0xb,0xc,0xe,0x6,0xf,0xa,0xa,0xd,0xa,0x7,0x1,0x7,0x9,0xe,0x8,0x4,
 1364|       |            0xf,0x3,0xb,0x9,0xc,0xa,0xc,0x2,0xf,0xc,0x6,0x3,0x2,0x5,0x4,0xf
 1365|       |        };
 1366|       |
 1367|       |        ecp_nistz256_ord_sqr_mont(out, out, 4);
 1368|       |        /* The exponent is public, no need in constant-time access */
 1369|       |        ecp_nistz256_ord_mul_mont(out, out, table[expLo[i]-1]);
 1370|       |    }
 1371|       |#else
 1372|       |    /*
 1373|       |     * https://briansmith.org/ecc-inversion-addition-chains-01#p256_scalar_inversion
 1374|       |     *
 1375|       |     * Even though this code path spares 12 squarings, 4.5%, and 13
 1376|       |     * multiplications, 25%, on grand scale sign operation is not that
 1377|       |     * much faster, not more that 2%...
 1378|       |     */
 1379|       |
 1380|       |    /* pre-calculate powers */
 1381|     10|    ecp_nistz256_ord_sqr_mont(table[i_10], table[i_1], 1);
 1382|       |
 1383|     10|    ecp_nistz256_ord_mul_mont(table[i_11], table[i_1], table[i_10]);
 1384|       |
 1385|     10|    ecp_nistz256_ord_mul_mont(table[i_101], table[i_11], table[i_10]);
 1386|       |
 1387|     10|    ecp_nistz256_ord_mul_mont(table[i_111], table[i_101], table[i_10]);
 1388|       |
 1389|     10|    ecp_nistz256_ord_sqr_mont(table[i_1010], table[i_101], 1);
 1390|       |
 1391|     10|    ecp_nistz256_ord_mul_mont(table[i_1111], table[i_1010], table[i_101]);
 1392|       |
 1393|     10|    ecp_nistz256_ord_sqr_mont(table[i_10101], table[i_1010], 1);
 1394|     10|    ecp_nistz256_ord_mul_mont(table[i_10101], table[i_10101], table[i_1]);
 1395|       |
 1396|     10|    ecp_nistz256_ord_sqr_mont(table[i_101010], table[i_10101], 1);
 1397|       |
 1398|     10|    ecp_nistz256_ord_mul_mont(table[i_101111], table[i_101010], table[i_101]);
 1399|       |
 1400|     10|    ecp_nistz256_ord_mul_mont(table[i_x6], table[i_101010], table[i_10101]);
 1401|       |
 1402|     10|    ecp_nistz256_ord_sqr_mont(table[i_x8], table[i_x6], 2);
 1403|     10|    ecp_nistz256_ord_mul_mont(table[i_x8], table[i_x8], table[i_11]);
 1404|       |
 1405|     10|    ecp_nistz256_ord_sqr_mont(table[i_x16], table[i_x8], 8);
 1406|     10|    ecp_nistz256_ord_mul_mont(table[i_x16], table[i_x16], table[i_x8]);
 1407|       |
 1408|     10|    ecp_nistz256_ord_sqr_mont(table[i_x32], table[i_x16], 16);
 1409|     10|    ecp_nistz256_ord_mul_mont(table[i_x32], table[i_x32], table[i_x16]);
 1410|       |
 1411|       |    /* calculations */
 1412|     10|    ecp_nistz256_ord_sqr_mont(out, table[i_x32], 64);
 1413|     10|    ecp_nistz256_ord_mul_mont(out, out, table[i_x32]);
 1414|       |
 1415|    280|    for (i = 0; i < 27; i++) {
  ------------------
  |  Branch (1415:17): [True: 270, False: 10]
  ------------------
 1416|    270|        static const struct { unsigned char p, i; } chain[27] = {
 1417|    270|            { 32, i_x32 }, { 6,  i_101111 }, { 5,  i_111    },
 1418|    270|            { 4,  i_11  }, { 5,  i_1111   }, { 5,  i_10101  },
 1419|    270|            { 4,  i_101 }, { 3,  i_101    }, { 3,  i_101    },
 1420|    270|            { 5,  i_111 }, { 9,  i_101111 }, { 6,  i_1111   },
 1421|    270|            { 2,  i_1   }, { 5,  i_1      }, { 6,  i_1111   },
 1422|    270|            { 5,  i_111 }, { 4,  i_111    }, { 5,  i_111    },
 1423|    270|            { 5,  i_101 }, { 3,  i_11     }, { 10, i_101111 },
 1424|    270|            { 2,  i_11  }, { 5,  i_11     }, { 5,  i_11     },
 1425|    270|            { 3,  i_1   }, { 7,  i_10101  }, { 6,  i_1111   }
 1426|    270|        };
 1427|       |
 1428|    270|        ecp_nistz256_ord_sqr_mont(out, out, chain[i].p);
 1429|    270|        ecp_nistz256_ord_mul_mont(out, out, table[chain[i].i]);
 1430|    270|    }
 1431|     10|#endif
 1432|     10|    ecp_nistz256_ord_mul_mont(out, out, one);
 1433|       |
 1434|       |    /*
 1435|       |     * Can't fail, but check return code to be consistent anyway.
 1436|       |     */
 1437|     10|    if (!bn_set_words(r, out, P256_LIMBS))
  ------------------
  |  |   41|     10|#define P256_LIMBS      (256/BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     10|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     10|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1437:9): [True: 0, False: 10]
  ------------------
 1438|      0|        goto err;
 1439|       |
 1440|     10|    ret = 1;
 1441|     10|err:
 1442|     10|    return ret;
 1443|     10|}
ecp_nistz256.c:ecp_nistz256group_full_init:
 1449|    933|                                       const unsigned char *params) {
 1450|    933|    BN_CTX *ctx = NULL;
 1451|    933|    BN_MONT_CTX *mont = NULL, *ordmont = NULL;
 1452|    933|    const int param_len = 32;
 1453|    933|    const int seed_len = 20;
 1454|    933|    int ok = 0;
 1455|    933|    uint32_t hi_order_n = 0xccd1c8aa;
 1456|    933|    uint32_t lo_order_n = 0xee00bc4f;
 1457|    933|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *one = NULL,
 1458|    933|        *order = NULL;
 1459|    933|    EC_POINT *P = NULL;
 1460|       |
 1461|    933|    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL) {
  ------------------
  |  Branch (1461:9): [True: 0, False: 933]
  ------------------
 1462|      0|        ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1463|      0|        return 0;
 1464|      0|    }
 1465|       |
 1466|    933|    if (!EC_GROUP_set_seed(group, params, seed_len)) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 933]
  ------------------
 1467|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1468|      0|        goto err;
 1469|      0|    }
 1470|    933|    params += seed_len;
 1471|       |
 1472|    933|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1472:9): [True: 0, False: 933]
  ------------------
 1473|    933|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1473:12): [True: 0, False: 933]
  ------------------
 1474|    933|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1474:12): [True: 0, False: 933]
  ------------------
 1475|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1476|      0|        goto err;
 1477|      0|    }
 1478|       |
 1479|       |    /*
 1480|       |     * Set up curve params and montgomery for field
 1481|       |     * Start by setting up montgomery and one
 1482|       |     */
 1483|    933|    mont = BN_MONT_CTX_new();
 1484|    933|    if (mont == NULL)
  ------------------
  |  Branch (1484:9): [True: 0, False: 933]
  ------------------
 1485|      0|        goto err;
 1486|       |
 1487|    933|    if (!ossl_bn_mont_ctx_set(mont, p, 256, params + 6 * param_len, param_len,
  ------------------
  |  Branch (1487:9): [True: 0, False: 933]
  ------------------
 1488|    933|                              1, 0))
 1489|      0|        goto err;
 1490|       |
 1491|    933|    one = BN_new();
 1492|    933|    if (one == NULL) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 933]
  ------------------
 1493|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1494|      0|        goto err;
 1495|      0|    }
 1496|    933|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)){
  ------------------
  |  Branch (1496:9): [True: 0, False: 933]
  ------------------
 1497|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1498|      0|        goto err;
 1499|      0|    }
 1500|    933|    group->field_data1 = mont;
 1501|    933|    mont = NULL;
 1502|    933|    group->field_data2 = one;
 1503|    933|    one = NULL;
 1504|       |
 1505|    933|    if (!ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx)) {
  ------------------
  |  Branch (1505:9): [True: 0, False: 933]
  ------------------
 1506|      0|         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1507|      0|        goto err;
 1508|      0|    }
 1509|       |
 1510|    933|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (1510:9): [True: 0, False: 933]
  ------------------
 1511|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1512|      0|        goto err;
 1513|      0|    }
 1514|       |
 1515|    933|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1515:9): [True: 0, False: 933]
  ------------------
 1516|    933|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1516:12): [True: 0, False: 933]
  ------------------
 1517|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1518|      0|        goto err;
 1519|      0|    }
 1520|    933|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (1520:9): [True: 0, False: 933]
  ------------------
 1521|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1522|      0|        goto err;
 1523|      0|    }
 1524|    933|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1524:9): [True: 0, False: 933]
  ------------------
 1525|    933|        || !BN_set_word(x, (BN_ULONG)1)) { /* cofactor is 1 */
  ------------------
  |  Branch (1525:12): [True: 0, False: 933]
  ------------------
 1526|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1527|      0|        goto err;
 1528|      0|    }
 1529|       |
 1530|       |    /*
 1531|       |     * Set up generator and order and montgomery data
 1532|       |     */
 1533|    933|    group->generator = EC_POINT_new(group);
 1534|    933|    if (group->generator == NULL){
  ------------------
  |  Branch (1534:9): [True: 0, False: 933]
  ------------------
 1535|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1536|      0|        goto err;
 1537|      0|    }
 1538|    933|    if (!EC_POINT_copy(group->generator, P))
  ------------------
  |  Branch (1538:9): [True: 0, False: 933]
  ------------------
 1539|      0|        goto err;
 1540|    933|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (1540:9): [True: 0, False: 933]
  ------------------
 1541|      0|        goto err;
 1542|    933|    if (!BN_set_word(group->cofactor, 1))
  ------------------
  |  Branch (1542:9): [True: 0, False: 933]
  ------------------
 1543|      0|        goto err;
 1544|       |
 1545|    933|    ordmont = BN_MONT_CTX_new();
 1546|    933|    if (ordmont  == NULL)
  ------------------
  |  Branch (1546:9): [True: 0, False: 933]
  ------------------
 1547|      0|        goto err;
 1548|    933|    if (!ossl_bn_mont_ctx_set(ordmont, order, 256, params + 7 * param_len,
  ------------------
  |  Branch (1548:9): [True: 0, False: 933]
  ------------------
 1549|    933|                              param_len, lo_order_n, hi_order_n))
 1550|      0|        goto err;
 1551|       |
 1552|    933|    group->mont_data = ordmont;
 1553|    933|    ordmont = NULL;
 1554|       |
 1555|    933|    ok = 1;
 1556|       |
 1557|    933| err:
 1558|    933|    EC_POINT_free(P);
 1559|    933|    BN_CTX_free(ctx);
 1560|    933|    BN_MONT_CTX_free(mont);
 1561|    933|    BN_MONT_CTX_free(ordmont);
 1562|    933|    BN_free(p);
 1563|    933|    BN_free(one);
 1564|    933|    BN_free(a);
 1565|    933|    BN_free(b);
 1566|    933|    BN_free(order);
 1567|    933|    BN_free(x);
 1568|    933|    BN_free(y);
 1569|       |
 1570|    933|    return ok;
 1571|    933|}

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

ossl_ec_GFp_simple_group_init:
   99|  27.4k|{
  100|  27.4k|    group->field = BN_new();
  101|  27.4k|    group->a = BN_new();
  102|  27.4k|    group->b = BN_new();
  103|  27.4k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 27.4k]
  |  Branch (103:33): [True: 0, False: 27.4k]
  |  Branch (103:53): [True: 0, False: 27.4k]
  ------------------
  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|  27.4k|    group->a_is_minus3 = 0;
  110|  27.4k|    return 1;
  111|  27.4k|}
ossl_ec_GFp_simple_group_finish:
  114|  27.4k|{
  115|  27.4k|    BN_free(group->field);
  116|  27.4k|    BN_free(group->a);
  117|  27.4k|    BN_free(group->b);
  118|  27.4k|}
ossl_ec_GFp_simple_group_copy:
  128|  13.7k|{
  129|  13.7k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (129:9): [True: 0, False: 13.7k]
  ------------------
  130|      0|        return 0;
  131|  13.7k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (131:9): [True: 0, False: 13.7k]
  ------------------
  132|      0|        return 0;
  133|  13.7k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (133:9): [True: 0, False: 13.7k]
  ------------------
  134|      0|        return 0;
  135|       |
  136|  13.7k|    dest->a_is_minus3 = src->a_is_minus3;
  137|       |
  138|  13.7k|    return 1;
  139|  13.7k|}
ossl_ec_GFp_simple_group_set_curve:
  144|  13.7k|{
  145|  13.7k|    int ret = 0;
  146|  13.7k|    BN_CTX *new_ctx = NULL;
  147|  13.7k|    BIGNUM *tmp_a;
  148|       |
  149|       |    /* p must be a prime > 3 */
  150|  13.7k|    if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) {
  ------------------
  |  Branch (150:9): [True: 0, False: 13.7k]
  |  Branch (150:32): [True: 0, False: 13.7k]
  ------------------
  151|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  152|      0|        return 0;
  153|      0|    }
  154|       |
  155|  13.7k|    if (ctx == NULL) {
  ------------------
  |  Branch (155:9): [True: 0, False: 13.7k]
  ------------------
  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|  13.7k|    BN_CTX_start(ctx);
  162|  13.7k|    tmp_a = BN_CTX_get(ctx);
  163|  13.7k|    if (tmp_a == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 13.7k]
  ------------------
  164|      0|        goto err;
  165|       |
  166|       |    /* group->field */
  167|  13.7k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (167:9): [True: 0, False: 13.7k]
  ------------------
  168|      0|        goto err;
  169|  13.7k|    BN_set_negative(group->field, 0);
  170|       |
  171|       |    /* group->a */
  172|  13.7k|    if (!BN_nnmod(tmp_a, a, p, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 13.7k]
  ------------------
  173|      0|        goto err;
  174|  13.7k|    if (group->meth->field_encode != NULL) {
  ------------------
  |  Branch (174:9): [True: 9.04k, False: 4.69k]
  ------------------
  175|  9.04k|        if (!group->meth->field_encode(group, group->a, tmp_a, ctx))
  ------------------
  |  Branch (175:13): [True: 0, False: 9.04k]
  ------------------
  176|      0|            goto err;
  177|  9.04k|    } else if (!BN_copy(group->a, tmp_a))
  ------------------
  |  Branch (177:16): [True: 0, False: 4.69k]
  ------------------
  178|      0|        goto err;
  179|       |
  180|       |    /* group->b */
  181|  13.7k|    if (!BN_nnmod(group->b, b, p, ctx))
  ------------------
  |  Branch (181:9): [True: 0, False: 13.7k]
  ------------------
  182|      0|        goto err;
  183|  13.7k|    if (group->meth->field_encode != NULL)
  ------------------
  |  Branch (183:9): [True: 9.04k, False: 4.69k]
  ------------------
  184|  9.04k|        if (!group->meth->field_encode(group, group->b, group->b, ctx))
  ------------------
  |  Branch (184:13): [True: 0, False: 9.04k]
  ------------------
  185|      0|            goto err;
  186|       |
  187|       |    /* group->a_is_minus3 */
  188|  13.7k|    if (!BN_add_word(tmp_a, 3))
  ------------------
  |  Branch (188:9): [True: 0, False: 13.7k]
  ------------------
  189|      0|        goto err;
  190|  13.7k|    group->a_is_minus3 = (0 == BN_cmp(tmp_a, group->field));
  191|       |
  192|  13.7k|    ret = 1;
  193|       |
  194|  13.7k| err:
  195|  13.7k|    BN_CTX_end(ctx);
  196|  13.7k|    BN_CTX_free(new_ctx);
  197|  13.7k|    return ret;
  198|  13.7k|}
ossl_ec_GFp_simple_point_init:
  323|  54.9k|{
  324|  54.9k|    point->X = BN_new();
  325|  54.9k|    point->Y = BN_new();
  326|  54.9k|    point->Z = BN_new();
  327|  54.9k|    point->Z_is_one = 0;
  328|       |
  329|  54.9k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (329:9): [True: 0, False: 54.9k]
  |  Branch (329:29): [True: 0, False: 54.9k]
  |  Branch (329:49): [True: 0, False: 54.9k]
  ------------------
  330|      0|        BN_free(point->X);
  331|      0|        BN_free(point->Y);
  332|      0|        BN_free(point->Z);
  333|      0|        return 0;
  334|      0|    }
  335|  54.9k|    return 1;
  336|  54.9k|}
ossl_ec_GFp_simple_point_finish:
  339|  54.9k|{
  340|  54.9k|    BN_free(point->X);
  341|  54.9k|    BN_free(point->Y);
  342|  54.9k|    BN_free(point->Z);
  343|  54.9k|}
ossl_ec_GFp_simple_point_copy:
  354|  27.4k|{
  355|  27.4k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (355:9): [True: 0, False: 27.4k]
  ------------------
  356|      0|        return 0;
  357|  27.4k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (357:9): [True: 0, False: 27.4k]
  ------------------
  358|      0|        return 0;
  359|  27.4k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (359:9): [True: 0, False: 27.4k]
  ------------------
  360|      0|        return 0;
  361|  27.4k|    dest->Z_is_one = src->Z_is_one;
  362|  27.4k|    dest->curve_name = src->curve_name;
  363|       |
  364|  27.4k|    return 1;
  365|  27.4k|}
ossl_ec_GFp_simple_point_set_to_infinity:
  369|  1.11k|{
  370|  1.11k|    point->Z_is_one = 0;
  371|  1.11k|    BN_zero(point->Z);
  ------------------
  |  |  202|  1.11k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  372|  1.11k|    return 1;
  373|  1.11k|}
ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp:
  381|  18.4k|{
  382|  18.4k|    BN_CTX *new_ctx = NULL;
  383|  18.4k|    int ret = 0;
  384|       |
  385|  18.4k|    if (ctx == NULL) {
  ------------------
  |  Branch (385:9): [True: 0, False: 18.4k]
  ------------------
  386|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  387|      0|        if (ctx == NULL)
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            return 0;
  389|      0|    }
  390|       |
  391|  18.4k|    if (x != NULL) {
  ------------------
  |  Branch (391:9): [True: 18.4k, False: 0]
  ------------------
  392|  18.4k|        if (!BN_nnmod(point->X, x, group->field, ctx))
  ------------------
  |  Branch (392:13): [True: 0, False: 18.4k]
  ------------------
  393|      0|            goto err;
  394|  18.4k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (394:13): [True: 12.8k, False: 5.59k]
  ------------------
  395|  12.8k|            if (!group->meth->field_encode(group, point->X, point->X, ctx))
  ------------------
  |  Branch (395:17): [True: 0, False: 12.8k]
  ------------------
  396|      0|                goto err;
  397|  12.8k|        }
  398|  18.4k|    }
  399|       |
  400|  18.4k|    if (y != NULL) {
  ------------------
  |  Branch (400:9): [True: 18.4k, False: 0]
  ------------------
  401|  18.4k|        if (!BN_nnmod(point->Y, y, group->field, ctx))
  ------------------
  |  Branch (401:13): [True: 0, False: 18.4k]
  ------------------
  402|      0|            goto err;
  403|  18.4k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (403:13): [True: 12.8k, False: 5.59k]
  ------------------
  404|  12.8k|            if (!group->meth->field_encode(group, point->Y, point->Y, ctx))
  ------------------
  |  Branch (404:17): [True: 0, False: 12.8k]
  ------------------
  405|      0|                goto err;
  406|  12.8k|        }
  407|  18.4k|    }
  408|       |
  409|  18.4k|    if (z != NULL) {
  ------------------
  |  Branch (409:9): [True: 18.4k, False: 0]
  ------------------
  410|  18.4k|        int Z_is_one;
  411|       |
  412|  18.4k|        if (!BN_nnmod(point->Z, z, group->field, ctx))
  ------------------
  |  Branch (412:13): [True: 0, False: 18.4k]
  ------------------
  413|      0|            goto err;
  414|  18.4k|        Z_is_one = BN_is_one(point->Z);
  415|  18.4k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (415:13): [True: 12.8k, False: 5.59k]
  ------------------
  416|  12.8k|            if (Z_is_one && (group->meth->field_set_to_one != 0)) {
  ------------------
  |  Branch (416:17): [True: 12.8k, False: 0]
  |  Branch (416:29): [True: 12.8k, False: 0]
  ------------------
  417|  12.8k|                if (!group->meth->field_set_to_one(group, point->Z, ctx))
  ------------------
  |  Branch (417:21): [True: 0, False: 12.8k]
  ------------------
  418|      0|                    goto err;
  419|  12.8k|            } 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|  12.8k|        }
  425|  18.4k|        point->Z_is_one = Z_is_one;
  426|  18.4k|    }
  427|       |
  428|  18.4k|    ret = 1;
  429|       |
  430|  18.4k| err:
  431|  18.4k|    BN_CTX_free(new_ctx);
  432|  18.4k|    return ret;
  433|  18.4k|}
ossl_ec_GFp_simple_point_set_affine_coordinates:
  488|  18.4k|{
  489|  18.4k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (489:9): [True: 0, False: 18.4k]
  |  Branch (489:22): [True: 0, False: 18.4k]
  ------------------
  490|       |        /*
  491|       |         * unlike for projective coordinates, we do not tolerate this
  492|       |         */
  493|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  494|      0|        return 0;
  495|      0|    }
  496|       |
  497|  18.4k|    return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y,
  498|  18.4k|                                                    BN_value_one(), ctx);
  499|  18.4k|}
ossl_ec_GFp_simple_is_at_infinity:
  952|  18.5k|{
  953|  18.5k|    return BN_is_zero(point->Z);
  954|  18.5k|}
ossl_ec_GFp_simple_is_on_curve:
  958|  18.4k|{
  959|  18.4k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  960|  18.4k|                      const BIGNUM *, BN_CTX *);
  961|  18.4k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  962|  18.4k|    const BIGNUM *p;
  963|  18.4k|    BN_CTX *new_ctx = NULL;
  964|  18.4k|    BIGNUM *rh, *tmp, *Z4, *Z6;
  965|  18.4k|    int ret = -1;
  966|       |
  967|  18.4k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (967:9): [True: 0, False: 18.4k]
  ------------------
  968|      0|        return 1;
  969|       |
  970|  18.4k|    field_mul = group->meth->field_mul;
  971|  18.4k|    field_sqr = group->meth->field_sqr;
  972|  18.4k|    p = group->field;
  973|       |
  974|  18.4k|    if (ctx == NULL) {
  ------------------
  |  Branch (974:9): [True: 0, False: 18.4k]
  ------------------
  975|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  976|      0|        if (ctx == NULL)
  ------------------
  |  Branch (976:13): [True: 0, False: 0]
  ------------------
  977|      0|            return -1;
  978|      0|    }
  979|       |
  980|  18.4k|    BN_CTX_start(ctx);
  981|  18.4k|    rh = BN_CTX_get(ctx);
  982|  18.4k|    tmp = BN_CTX_get(ctx);
  983|  18.4k|    Z4 = BN_CTX_get(ctx);
  984|  18.4k|    Z6 = BN_CTX_get(ctx);
  985|  18.4k|    if (Z6 == NULL)
  ------------------
  |  Branch (985:9): [True: 0, False: 18.4k]
  ------------------
  986|      0|        goto err;
  987|       |
  988|       |    /*-
  989|       |     * We have a curve defined by a Weierstrass equation
  990|       |     *      y^2 = x^3 + a*x + b.
  991|       |     * The point to consider is given in Jacobian projective coordinates
  992|       |     * where  (X, Y, Z)  represents  (x, y) = (X/Z^2, Y/Z^3).
  993|       |     * Substituting this and multiplying by  Z^6  transforms the above equation into
  994|       |     *      Y^2 = X^3 + a*X*Z^4 + b*Z^6.
  995|       |     * To test this, we add up the right-hand side in 'rh'.
  996|       |     */
  997|       |
  998|       |    /* rh := X^2 */
  999|  18.4k|    if (!field_sqr(group, rh, point->X, ctx))
  ------------------
  |  Branch (999:9): [True: 0, False: 18.4k]
  ------------------
 1000|      0|        goto err;
 1001|       |
 1002|  18.4k|    if (!point->Z_is_one) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 18.4k]
  ------------------
 1003|      0|        if (!field_sqr(group, tmp, point->Z, ctx))
  ------------------
  |  Branch (1003:13): [True: 0, False: 0]
  ------------------
 1004|      0|            goto err;
 1005|      0|        if (!field_sqr(group, Z4, tmp, ctx))
  ------------------
  |  Branch (1005:13): [True: 0, False: 0]
  ------------------
 1006|      0|            goto err;
 1007|      0|        if (!field_mul(group, Z6, Z4, tmp, ctx))
  ------------------
  |  Branch (1007:13): [True: 0, False: 0]
  ------------------
 1008|      0|            goto err;
 1009|       |
 1010|       |        /* rh := (rh + a*Z^4)*X */
 1011|      0|        if (group->a_is_minus3) {
  ------------------
  |  Branch (1011:13): [True: 0, False: 0]
  ------------------
 1012|      0|            if (!BN_mod_lshift1_quick(tmp, Z4, p))
  ------------------
  |  Branch (1012:17): [True: 0, False: 0]
  ------------------
 1013|      0|                goto err;
 1014|      0|            if (!BN_mod_add_quick(tmp, tmp, Z4, p))
  ------------------
  |  Branch (1014:17): [True: 0, False: 0]
  ------------------
 1015|      0|                goto err;
 1016|      0|            if (!BN_mod_sub_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1016:17): [True: 0, False: 0]
  ------------------
 1017|      0|                goto err;
 1018|      0|            if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1018:17): [True: 0, False: 0]
  ------------------
 1019|      0|                goto err;
 1020|      0|        } else {
 1021|      0|            if (!field_mul(group, tmp, Z4, group->a, ctx))
  ------------------
  |  Branch (1021:17): [True: 0, False: 0]
  ------------------
 1022|      0|                goto err;
 1023|      0|            if (!BN_mod_add_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1023:17): [True: 0, False: 0]
  ------------------
 1024|      0|                goto err;
 1025|      0|            if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1025:17): [True: 0, False: 0]
  ------------------
 1026|      0|                goto err;
 1027|      0|        }
 1028|       |
 1029|       |        /* rh := rh + b*Z^6 */
 1030|      0|        if (!field_mul(group, tmp, group->b, Z6, ctx))
  ------------------
  |  Branch (1030:13): [True: 0, False: 0]
  ------------------
 1031|      0|            goto err;
 1032|      0|        if (!BN_mod_add_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1032:13): [True: 0, False: 0]
  ------------------
 1033|      0|            goto err;
 1034|  18.4k|    } else {
 1035|       |        /* point->Z_is_one */
 1036|       |
 1037|       |        /* rh := (rh + a)*X */
 1038|  18.4k|        if (!BN_mod_add_quick(rh, rh, group->a, p))
  ------------------
  |  Branch (1038:13): [True: 0, False: 18.4k]
  ------------------
 1039|      0|            goto err;
 1040|  18.4k|        if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1040:13): [True: 0, False: 18.4k]
  ------------------
 1041|      0|            goto err;
 1042|       |        /* rh := rh + b */
 1043|  18.4k|        if (!BN_mod_add_quick(rh, rh, group->b, p))
  ------------------
  |  Branch (1043:13): [True: 0, False: 18.4k]
  ------------------
 1044|      0|            goto err;
 1045|  18.4k|    }
 1046|       |
 1047|       |    /* 'lh' := Y^2 */
 1048|  18.4k|    if (!field_sqr(group, tmp, point->Y, ctx))
  ------------------
  |  Branch (1048:9): [True: 0, False: 18.4k]
  ------------------
 1049|      0|        goto err;
 1050|       |
 1051|  18.4k|    ret = (0 == BN_ucmp(tmp, rh));
 1052|       |
 1053|  18.4k| err:
 1054|  18.4k|    BN_CTX_end(ctx);
 1055|  18.4k|    BN_CTX_free(new_ctx);
 1056|  18.4k|    return ret;
 1057|  18.4k|}

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

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

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

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

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

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

ossl_encoder_store_cache_flush:
  451|      2|{
  452|      2|    OSSL_METHOD_STORE *store = get_encoder_store(libctx);
  453|       |
  454|      2|    if (store != NULL)
  ------------------
  |  Branch (454:9): [True: 2, False: 0]
  ------------------
  455|      2|        return ossl_method_store_cache_flush_all(store);
  456|      0|    return 1;
  457|      2|}
encoder_meth.c:get_encoder_store:
  112|      2|{
  113|      2|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX);
  ------------------
  |  |  110|      2|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  114|      2|}

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

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

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

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

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

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

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

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

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

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

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

OSSL_ERR_STATE_free:
  202|      2|{
  203|      2|    int i;
  204|       |
  205|      2|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        return;
  207|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 32, False: 2]
  ------------------
  208|     32|        err_clear(state, i, 1);
  209|     32|    }
  210|      2|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      2|}
err_cleanup:
  233|      2|{
  234|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  ------------------
  235|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      2|    err_string_lock = NULL;
  238|      2|#ifndef OPENSSL_NO_ERR
  239|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      2|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      2|    int_error_hash = NULL;
  241|      2|#endif
  242|      2|}
ossl_err_load_ERR_strings:
  272|     70|{
  273|     70|#ifndef OPENSSL_NO_ERR
  274|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 70]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     70|    err_load_strings(ERR_str_libraries);
  278|     70|    err_load_strings(ERR_str_reasons);
  279|     70|#endif
  280|     70|    return 1;
  281|     70|}
ERR_load_strings_const:
  297|     68|{
  298|     68|#ifndef OPENSSL_NO_ERR
  299|     68|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 68]
  ------------------
  300|      0|        return 0;
  301|     68|    err_load_strings(str);
  302|     68|#endif
  303|       |
  304|     68|    return 1;
  305|     68|}
ERR_clear_error:
  335|  10.4k|{
  336|  10.4k|    int i;
  337|  10.4k|    ERR_STATE *es;
  338|       |
  339|  10.4k|    es = ossl_err_get_state_int();
  340|  10.4k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 10.4k]
  ------------------
  341|      0|        return;
  342|       |
  343|   177k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|   177k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 167k, False: 10.4k]
  ------------------
  344|   167k|        err_clear(es, i, 0);
  345|   167k|    }
  346|  10.4k|    es->top = es->bottom = 0;
  347|  10.4k|}
ERR_get_error_all:
  357|  48.9k|{
  358|  48.9k|    return get_error_values(EV_POP, file, line, func, data, flags);
  359|  48.9k|}
ERR_peek_error_data:
  390|  6.94k|{
  391|  6.94k|    return get_error_values(EV_PEEK, NULL, NULL, NULL, data, flags);
  392|  6.94k|}
ERR_peek_last_error:
  410|   609k|{
  411|   609k|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|   609k|}
ERR_peek_last_error_all:
  432|  2.60k|{
  433|  2.60k|    return get_error_values(EV_PEEK_LAST, file, line, func, data, flags);
  434|  2.60k|}
ERR_lib_error_string:
  587|  48.2k|{
  588|  48.2k|#ifndef OPENSSL_NO_ERR
  589|  48.2k|    ERR_STRING_DATA d, *p;
  590|  48.2k|    unsigned long l;
  591|       |
  592|  48.2k|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|  48.2k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 48.2k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (592:9): [True: 0, False: 48.2k]
  ------------------
  593|      0|        return NULL;
  594|      0|    }
  595|       |
  596|  48.2k|    l = ERR_GET_LIB(e);
  597|  48.2k|    d.error = ERR_PACK(l, 0, 0);
  ------------------
  |  |  279|  48.2k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  48.2k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  48.2k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  48.2k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  48.2k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  598|  48.2k|    p = int_err_get_item(&d);
  599|  48.2k|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (599:13): [True: 0, False: 48.2k]
  ------------------
  600|       |#else
  601|       |    return NULL;
  602|       |#endif
  603|  48.2k|}
ERR_reason_error_string:
  613|  55.2k|{
  614|  55.2k|#ifndef OPENSSL_NO_ERR
  615|  55.2k|    ERR_STRING_DATA d, *p = NULL;
  616|  55.2k|    unsigned long l, r;
  617|       |
  618|  55.2k|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|  55.2k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 55.2k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 55.2k]
  ------------------
  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|  55.2k|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|  55.2k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  55.2k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 55.2k]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|  55.2k|    l = ERR_GET_LIB(e);
  631|  55.2k|    r = ERR_GET_REASON(e);
  632|  55.2k|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|  55.2k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  55.2k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  55.2k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  55.2k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  55.2k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|  55.2k|    p = int_err_get_item(&d);
  634|  55.2k|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 2.99k, False: 52.2k]
  ------------------
  635|  2.99k|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|  2.99k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  2.99k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  2.99k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  2.99k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  2.99k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|  2.99k|        p = int_err_get_item(&d);
  637|  2.99k|    }
  638|  55.2k|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 218, False: 55.0k]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|  55.2k|}
ossl_err_get_state_int:
  673|  4.55M|{
  674|  4.55M|    ERR_STATE *state;
  675|  4.55M|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  4.55M|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  4.55M|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  4.55M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 4.55M]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  4.55M|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  4.55M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.55M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 4.55M]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  4.55M|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  4.55M|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 4.55M]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  4.55M|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 4.55M]
  ------------------
  688|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 2]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      2|        state = OSSL_ERR_STATE_new();
  692|      2|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 2]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      2|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 2]
  ------------------
  698|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 2]
  ------------------
  699|      0|            OSSL_ERR_STATE_free(state);
  700|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  701|      0|            return NULL;
  702|      0|        }
  703|       |
  704|       |        /* Ignore failures from these */
  705|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  4.55M|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  4.55M|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  4.55M|    return state;
  710|  4.55M|}
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|  34.4k|{
  814|  34.4k|    va_list args;
  815|  34.4k|    va_start(args, num);
  816|  34.4k|    ERR_add_error_vdata(num, args);
  817|  34.4k|    va_end(args);
  818|  34.4k|}
ERR_add_error_vdata:
  821|  34.4k|{
  822|  34.4k|    int i, len, size;
  823|  34.4k|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  34.4k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  34.4k|# define ERR_TXT_STRING          0x02
  ------------------
  824|  34.4k|    char *str, *arg;
  825|  34.4k|    ERR_STATE *es;
  826|       |
  827|       |    /* Get the current error data; if an allocated string get it. */
  828|  34.4k|    es = ossl_err_get_state_int();
  829|  34.4k|    if (es == NULL)
  ------------------
  |  Branch (829:9): [True: 0, False: 34.4k]
  ------------------
  830|      0|        return;
  831|  34.4k|    i = es->top;
  832|       |
  833|       |    /*
  834|       |     * If err_data is allocated already, reuse the space.
  835|       |     * Otherwise, allocate a small new buffer.
  836|       |     */
  837|  34.4k|    if ((es->err_data_flags[i] & flags) == flags
  ------------------
  |  Branch (837:9): [True: 1.23k, False: 33.2k]
  ------------------
  838|  34.4k|            && ossl_assert(es->err_data[i] != NULL)) {
  ------------------
  |  |   52|  1.23k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:26): [True: 1.23k, False: 0]
  |  |  ------------------
  |  |   53|  1.23k|                                         __FILE__, __LINE__)
  ------------------
  839|  1.23k|        str = es->err_data[i];
  840|  1.23k|        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|  1.23k|        es->err_data[i] = NULL;
  850|  1.23k|        es->err_data_flags[i] = 0;
  851|  33.2k|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |  102|  33.2k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  33.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  33.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (851:16): [True: 0, False: 33.2k]
  ------------------
  852|      0|        return;
  853|  33.2k|    } else {
  854|  33.2k|        str[0] = '\0';
  855|  33.2k|    }
  856|  34.4k|    len = strlen(str);
  857|       |
  858|   152k|    while (--num >= 0) {
  ------------------
  |  Branch (858:12): [True: 117k, False: 34.4k]
  ------------------
  859|   117k|        arg = va_arg(args, char *);
  860|   117k|        if (arg == NULL)
  ------------------
  |  Branch (860:13): [True: 0, False: 117k]
  ------------------
  861|      0|            arg = "<NULL>";
  862|   117k|        len += strlen(arg);
  863|   117k|        if (len >= size) {
  ------------------
  |  Branch (863:13): [True: 1.15k, False: 116k]
  ------------------
  864|  1.15k|            char *p;
  865|       |
  866|  1.15k|            size = len + 20;
  867|  1.15k|            p = OPENSSL_realloc(str, size);
  ------------------
  |  |  109|  1.15k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|  1.15k|            if (p == NULL) {
  ------------------
  |  Branch (868:17): [True: 0, False: 1.15k]
  ------------------
  869|      0|                OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  870|      0|                return;
  871|      0|            }
  872|  1.15k|            str = p;
  873|  1.15k|        }
  874|   117k|        OPENSSL_strlcat(str, arg, (size_t)size);
  875|   117k|    }
  876|  34.4k|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (876:9): [True: 0, False: 34.4k]
  ------------------
  877|      0|        OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  878|  34.4k|}
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|   115k|{
  173|   115k|    unsigned long ret, l;
  174|       |
  175|   115k|    l = a->error;
  176|   115k|    ret = l ^ ERR_GET_LIB(l);
  177|   115k|    return (ret ^ ret % 19 * 13);
  178|   115k|}
err.c:err_string_data_cmp:
  182|   111k|{
  183|   111k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 108k, False: 2.85k]
  ------------------
  184|   108k|        return 0;
  185|  2.85k|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 1.39k, False: 1.45k]
  ------------------
  186|   111k|}
err.c:err_load_strings:
  260|    208|{
  261|    208|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 208]
  ------------------
  262|      0|        return 0;
  263|  8.83k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 8.62k, False: 208]
  ------------------
  264|  8.62k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.83k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  265|    208|                                       (ERR_STRING_DATA *)str);
  266|    208|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    208|    return 1;
  268|    208|}
err.c:get_error_values:
  448|   668k|{
  449|   668k|    int i = 0;
  450|   668k|    ERR_STATE *es;
  451|   668k|    unsigned long ret;
  452|       |
  453|   668k|    es = ossl_err_get_state_int();
  454|   668k|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 668k]
  ------------------
  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|   668k|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 565k, False: 102k]
  ------------------
  462|   565k|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|   565k|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 565k]
  ------------------
  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|   565k|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|   565k|#  define ERR_NUM_ERRORS  16
  ------------------
  468|   565k|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|   565k|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 565k]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|   565k|        break;
  474|   565k|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|   668k|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 102k, False: 565k]
  ------------------
  478|   102k|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|   565k|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 517k, False: 48.2k]
  ------------------
  482|   517k|        i = es->top;
  483|  48.2k|    else
  484|  48.2k|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  48.2k|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|   565k|    ret = es->err_buffer[i];
  487|   565k|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 41.3k, False: 524k]
  ------------------
  488|  41.3k|        es->bottom = i;
  489|  41.3k|        es->err_buffer[i] = 0;
  490|  41.3k|    }
  491|       |
  492|   565k|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 43.9k, False: 522k]
  ------------------
  493|  43.9k|        *file = es->err_file[i];
  494|  43.9k|        if (*file == NULL)
  ------------------
  |  Branch (494:13): [True: 0, False: 43.9k]
  ------------------
  495|      0|            *file = "";
  496|  43.9k|    }
  497|   565k|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 43.9k, False: 522k]
  ------------------
  498|  43.9k|        *line = es->err_line[i];
  499|   565k|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 43.9k, False: 522k]
  ------------------
  500|  43.9k|        *func = es->err_func[i];
  501|  43.9k|        if (*func == NULL)
  ------------------
  |  Branch (501:13): [True: 0, False: 43.9k]
  ------------------
  502|      0|            *func = "";
  503|  43.9k|    }
  504|   565k|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 50.8k, False: 515k]
  ------------------
  505|  50.8k|        *flags = es->err_data_flags[i];
  506|   565k|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 515k, False: 50.8k]
  ------------------
  507|   515k|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 515k]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|   515k|    } else {
  511|  50.8k|        *data = es->err_data[i];
  512|  50.8k|        if (*data == NULL) {
  ------------------
  |  Branch (512:13): [True: 16, False: 50.8k]
  ------------------
  513|     16|            *data = "";
  514|     16|            if (flags != NULL)
  ------------------
  |  Branch (514:17): [True: 16, False: 0]
  ------------------
  515|     16|                *flags = 0;
  516|     16|        }
  517|  50.8k|    }
  518|   565k|    return ret;
  519|   668k|}
err.c:int_err_get_item:
  189|   106k|{
  190|   106k|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|   106k|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 106k]
  ------------------
  193|      0|        return NULL;
  194|   106k|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|   106k|#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|   106k|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|   106k|    return p;
  198|   106k|}
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|  34.4k|{
  781|  34.4k|    ERR_STATE *es;
  782|       |
  783|  34.4k|    es = ossl_err_get_state_int();
  784|  34.4k|    if (es == NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 34.4k]
  ------------------
  785|      0|        return 0;
  786|       |
  787|  34.4k|    err_clear_data(es, es->top, deallocate);
  788|  34.4k|    err_set_data(es, es->top, data, size, flags);
  789|       |
  790|  34.4k|    return 1;
  791|  34.4k|}

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

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

ERR_set_mark:
   16|   496k|{
   17|   496k|    ERR_STATE *es;
   18|       |
   19|   496k|    es = ossl_err_get_state_int();
   20|   496k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 496k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|   496k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 481k, False: 15.1k]
  ------------------
   24|   481k|        return 0;
   25|  15.1k|    es->err_marks[es->top]++;
   26|  15.1k|    return 1;
   27|   496k|}
ERR_pop_to_mark:
   43|   795k|{
   44|   795k|    ERR_STATE *es;
   45|       |
   46|   795k|    es = ossl_err_get_state_int();
   47|   795k|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 795k]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  1.53M|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 754k, False: 783k]
  ------------------
   51|  1.53M|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 741k, False: 12.3k]
  ------------------
   52|   741k|        err_clear(es, es->top, 0);
   53|   741k|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|     47|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 741k, False: 47]
  ------------------
   54|   741k|    }
   55|       |
   56|   795k|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 783k, False: 12.3k]
  ------------------
   57|   783k|        return 0;
   58|  12.3k|    es->err_marks[es->top]--;
   59|  12.3k|    return 1;
   60|   795k|}
ERR_clear_last_mark:
   82|  85.3k|{
   83|  85.3k|    ERR_STATE *es;
   84|  85.3k|    int top;
   85|       |
   86|  85.3k|    es = ossl_err_get_state_int();
   87|  85.3k|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 85.3k]
  ------------------
   88|      0|        return 0;
   89|       |
   90|  85.3k|    top = es->top;
   91|   126k|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 44.0k, False: 82.5k]
  ------------------
   92|   126k|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:15): [True: 41.2k, False: 2.82k]
  ------------------
   93|  41.2k|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|     14|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (93:15): [True: 41.2k, False: 14]
  ------------------
   94|  41.2k|    }
   95|       |
   96|  85.3k|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 82.5k, False: 2.82k]
  ------------------
   97|  82.5k|        return 0;
   98|  2.82k|    es->err_marks[top]--;
   99|  2.82k|    return 1;
  100|  85.3k|}

ERR_add_error_txt:
   61|  2.60k|{
   62|  2.60k|    const char *file = NULL;
   63|  2.60k|    int line;
   64|  2.60k|    const char *func = NULL;
   65|  2.60k|    const char *data = NULL;
   66|  2.60k|    int flags;
   67|  2.60k|    unsigned long err = ERR_peek_last_error();
   68|       |
   69|  2.60k|    if (separator == NULL)
  ------------------
  |  Branch (69:9): [True: 1.56k, False: 1.03k]
  ------------------
   70|  1.56k|        separator = "";
   71|  2.60k|    if (err == 0)
  ------------------
  |  Branch (71:9): [True: 0, False: 2.60k]
  ------------------
   72|      0|        put_error(ERR_LIB_NONE, NULL, 0, "", 0);
  ------------------
  |  |   71|      0|# define ERR_LIB_NONE            1
  ------------------
   73|       |
   74|  2.60k|    do {
   75|  2.60k|        size_t available_len, data_len;
   76|  2.60k|        const char *curr = txt, *next = txt;
   77|  2.60k|        const char *leading_separator = separator;
   78|  2.60k|        int trailing_separator = 0;
   79|  2.60k|        char *tmp;
   80|       |
   81|  2.60k|        ERR_peek_last_error_all(&file, &line, &func, &data, &flags);
   82|  2.60k|        if ((flags & ERR_TXT_STRING) == 0) {
  ------------------
  |  |   49|  2.60k|# define ERR_TXT_STRING          0x02
  ------------------
  |  Branch (82:13): [True: 1.37k, False: 1.22k]
  ------------------
   83|  1.37k|            data = "";
   84|  1.37k|            leading_separator = "";
   85|  1.37k|        }
   86|  2.60k|        data_len = strlen(data);
   87|       |
   88|       |        /* workaround for limit of ERR_print_errors_cb() */
   89|  2.60k|        if (data_len >= MAX_DATA_LEN
  ------------------
  |  |   59|  5.20k|#define MAX_DATA_LEN (ERR_PRINT_BUF_SIZE - TYPICAL_MAX_OUTPUT_BEFORE_DATA)
  |  |  ------------------
  |  |  |  |   19|  2.60k|#define ERR_PRINT_BUF_SIZE 4096
  |  |  ------------------
  |  |               #define MAX_DATA_LEN (ERR_PRINT_BUF_SIZE - TYPICAL_MAX_OUTPUT_BEFORE_DATA)
  |  |  ------------------
  |  |  |  |   58|  2.60k|#define TYPICAL_MAX_OUTPUT_BEFORE_DATA 100
  |  |  ------------------
  ------------------
  |  Branch (89:13): [True: 0, False: 2.60k]
  ------------------
   90|  2.60k|                || strlen(separator) >= (size_t)(MAX_DATA_LEN - data_len))
  ------------------
  |  |   59|  2.60k|#define MAX_DATA_LEN (ERR_PRINT_BUF_SIZE - TYPICAL_MAX_OUTPUT_BEFORE_DATA)
  |  |  ------------------
  |  |  |  |   19|  2.60k|#define ERR_PRINT_BUF_SIZE 4096
  |  |  ------------------
  |  |               #define MAX_DATA_LEN (ERR_PRINT_BUF_SIZE - TYPICAL_MAX_OUTPUT_BEFORE_DATA)
  |  |  ------------------
  |  |  |  |   58|  2.60k|#define TYPICAL_MAX_OUTPUT_BEFORE_DATA 100
  |  |  ------------------
  ------------------
  |  Branch (90:20): [True: 0, False: 2.60k]
  ------------------
   91|      0|            available_len = 0;
   92|  2.60k|        else
   93|  2.60k|            available_len = MAX_DATA_LEN - data_len - strlen(separator) - 1;
  ------------------
  |  |   59|  2.60k|#define MAX_DATA_LEN (ERR_PRINT_BUF_SIZE - TYPICAL_MAX_OUTPUT_BEFORE_DATA)
  |  |  ------------------
  |  |  |  |   19|  2.60k|#define ERR_PRINT_BUF_SIZE 4096
  |  |  ------------------
  |  |               #define MAX_DATA_LEN (ERR_PRINT_BUF_SIZE - TYPICAL_MAX_OUTPUT_BEFORE_DATA)
  |  |  ------------------
  |  |  |  |   58|  2.60k|#define TYPICAL_MAX_OUTPUT_BEFORE_DATA 100
  |  |  ------------------
  ------------------
   94|       |        /* MAX_DATA_LEN > available_len >= 0 */
   95|       |
   96|  2.60k|        if (*separator == '\0') {
  ------------------
  |  Branch (96:13): [True: 1.56k, False: 1.03k]
  ------------------
   97|  1.56k|            const size_t len_next = strlen(next);
   98|       |
   99|  1.56k|            if (len_next <= available_len) {
  ------------------
  |  Branch (99:17): [True: 1.56k, False: 0]
  ------------------
  100|  1.56k|                next += len_next;
  101|  1.56k|                curr = NULL; /* no need to split */
  102|  1.56k|            } else {
  103|      0|                next += available_len;
  104|      0|                curr = next; /* will split at this point */
  105|      0|            }
  106|  1.56k|        } else {
  107|  15.7k|            while (*next != '\0' && (size_t)(next - txt) <= available_len) {
  ------------------
  |  Branch (107:20): [True: 14.6k, False: 1.03k]
  |  Branch (107:37): [True: 14.6k, False: 0]
  ------------------
  108|  14.6k|                curr = next;
  109|  14.6k|                next = strstr(curr, separator);
  110|  14.6k|                if (next != NULL) {
  ------------------
  |  Branch (110:21): [True: 14.3k, False: 295]
  ------------------
  111|  14.3k|                    next += strlen(separator);
  112|  14.3k|                    trailing_separator = *next == '\0';
  113|  14.3k|                } else {
  114|    295|                    next = curr + strlen(curr);
  115|    295|                }
  116|  14.6k|            }
  117|  1.03k|            if ((size_t)(next - txt) <= available_len)
  ------------------
  |  Branch (117:17): [True: 1.03k, False: 0]
  ------------------
  118|  1.03k|                curr = NULL; /* the above loop implies *next == '\0' */
  119|  1.03k|        }
  120|  2.60k|        if (curr != NULL) {
  ------------------
  |  Branch (120:13): [True: 0, False: 2.60k]
  ------------------
  121|       |            /* split error msg at curr since error data would get too long */
  122|      0|            if (curr != txt) {
  ------------------
  |  Branch (122:17): [True: 0, False: 0]
  ------------------
  123|      0|                tmp = OPENSSL_strndup(txt, curr - txt);
  ------------------
  |  |  121|      0|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  124|      0|                if (tmp == NULL)
  ------------------
  |  Branch (124:21): [True: 0, False: 0]
  ------------------
  125|      0|                    return;
  126|      0|                ERR_add_error_data(2, separator, tmp);
  127|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|      0|            }
  129|      0|            put_error(ERR_GET_LIB(err), func, err, file, line);
  130|      0|            txt = curr;
  131|  2.60k|        } else {
  132|  2.60k|            if (trailing_separator) {
  ------------------
  |  Branch (132:17): [True: 742, False: 1.86k]
  ------------------
  133|    742|                tmp = OPENSSL_strndup(txt, next - strlen(separator) - txt);
  ------------------
  |  |  121|    742|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    742|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    742|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  134|    742|                if (tmp == NULL)
  ------------------
  |  Branch (134:21): [True: 0, False: 742]
  ------------------
  135|      0|                    return;
  136|       |                /* output txt without the trailing separator */
  137|    742|                ERR_add_error_data(2, leading_separator, tmp);
  138|    742|                OPENSSL_free(tmp);
  ------------------
  |  |  115|    742|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    742|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    742|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|  1.86k|            } else {
  140|  1.86k|                ERR_add_error_data(2, leading_separator, txt);
  141|  1.86k|            }
  142|  2.60k|            txt = next; /* finished */
  143|  2.60k|        }
  144|  2.60k|    } while (*txt != '\0');
  ------------------
  |  Branch (144:14): [True: 0, False: 2.60k]
  ------------------
  145|  2.60k|}
ERR_add_error_mem_bio:
  148|    742|{
  149|    742|    if (bio != NULL) {
  ------------------
  |  Branch (149:9): [True: 742, False: 0]
  ------------------
  150|    742|        char *str;
  151|    742|        long len = BIO_get_mem_data(bio, &str);
  ------------------
  |  |  612|    742|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   90|    742|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  152|       |
  153|    742|        if (len > 0) {
  ------------------
  |  Branch (153:13): [True: 742, False: 0]
  ------------------
  154|    742|            if (str[len - 1] != '\0') {
  ------------------
  |  Branch (154:17): [True: 742, False: 0]
  ------------------
  155|    742|                if (BIO_write(bio, "", 1) <= 0)
  ------------------
  |  Branch (155:21): [True: 0, False: 742]
  ------------------
  156|      0|                    return;
  157|       |
  158|    742|                len = BIO_get_mem_data(bio, &str);
  ------------------
  |  |  612|    742|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   90|    742|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  159|    742|            }
  160|    742|            if (len > 1)
  ------------------
  |  Branch (160:17): [True: 742, False: 0]
  ------------------
  161|    742|                ERR_add_error_txt(separator, str);
  162|    742|        }
  163|    742|    }
  164|    742|}

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

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

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

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

evp_pkey_ctx_ctrl_to_param:
 2713|  1.49k|{
 2714|  1.49k|    struct translation_ctx_st ctx = { 0, };
 2715|  1.49k|    struct translation_st tmpl = { 0, };
 2716|  1.49k|    const struct translation_st *translation = NULL;
 2717|  1.49k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.49k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.49k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 2718|  1.49k|    int ret;
 2719|  1.49k|    fixup_args_fn *fixup = default_fixup_args;
 2720|       |
 2721|  1.49k|    if (keytype == -1)
  ------------------
  |  Branch (2721:9): [True: 1.49k, False: 0]
  ------------------
 2722|  1.49k|        keytype = pctx->legacy_keytype;
 2723|  1.49k|    tmpl.ctrl_num = cmd;
 2724|  1.49k|    tmpl.keytype1 = tmpl.keytype2 = keytype;
 2725|  1.49k|    tmpl.optype = optype;
 2726|  1.49k|    translation = lookup_evp_pkey_ctx_translation(&tmpl);
 2727|       |
 2728|  1.49k|    if (translation == NULL) {
  ------------------
  |  Branch (2728:9): [True: 0, False: 1.49k]
  ------------------
 2729|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2730|      0|        return -2;
 2731|      0|    }
 2732|       |
 2733|  1.49k|    if (pctx->pmeth != NULL
  ------------------
  |  Branch (2733:9): [True: 0, False: 1.49k]
  ------------------
 2734|  1.49k|        && pctx->pmeth->pkey_id != translation->keytype1
  ------------------
  |  Branch (2734:12): [True: 0, False: 0]
  ------------------
 2735|  1.49k|        && pctx->pmeth->pkey_id != translation->keytype2)
  ------------------
  |  Branch (2735:12): [True: 0, False: 0]
  ------------------
 2736|      0|        return -1;
 2737|       |
 2738|  1.49k|    if (translation->fixup_args != NULL)
  ------------------
  |  Branch (2738:9): [True: 1.49k, False: 0]
  ------------------
 2739|  1.49k|        fixup = translation->fixup_args;
 2740|  1.49k|    ctx.action_type = translation->action_type;
 2741|  1.49k|    ctx.ctrl_cmd = cmd;
 2742|  1.49k|    ctx.p1 = p1;
 2743|  1.49k|    ctx.p2 = p2;
 2744|  1.49k|    ctx.pctx = pctx;
 2745|  1.49k|    ctx.params = params;
 2746|       |
 2747|  1.49k|    ret = fixup(PRE_CTRL_TO_PARAMS, translation, &ctx);
 2748|       |
 2749|  1.49k|    if (ret > 0) {
  ------------------
  |  Branch (2749:9): [True: 1.49k, False: 0]
  ------------------
 2750|  1.49k|        switch (ctx.action_type) {
 2751|      0|        default:
  ------------------
  |  Branch (2751:9): [True: 0, False: 1.49k]
  ------------------
 2752|       |            /* fixup_args is expected to make sure this is dead code */
 2753|      0|            break;
 2754|      0|        case OSSL_ACTION_GET:
  ------------------
  |  Branch (2754:9): [True: 0, False: 1.49k]
  ------------------
 2755|      0|            ret = evp_pkey_ctx_get_params_strict(pctx, ctx.params);
 2756|      0|            break;
 2757|  1.49k|        case OSSL_ACTION_SET:
  ------------------
  |  Branch (2757:9): [True: 1.49k, False: 0]
  ------------------
 2758|  1.49k|            ret = evp_pkey_ctx_set_params_strict(pctx, ctx.params);
 2759|  1.49k|            break;
 2760|  1.49k|        }
 2761|  1.49k|    }
 2762|       |
 2763|       |    /*
 2764|       |     * In POST, we pass the return value as p1, allowing the fixup_args
 2765|       |     * function to affect it by changing its value.
 2766|       |     */
 2767|  1.49k|    if (ret > 0) {
  ------------------
  |  Branch (2767:9): [True: 1.49k, False: 0]
  ------------------
 2768|  1.49k|        ctx.p1 = ret;
 2769|  1.49k|        fixup(POST_CTRL_TO_PARAMS, translation, &ctx);
 2770|  1.49k|        ret = ctx.p1;
 2771|  1.49k|    }
 2772|       |
 2773|  1.49k|    cleanup_translation_ctx(POST_CTRL_TO_PARAMS, translation, &ctx);
 2774|       |
 2775|  1.49k|    return ret;
 2776|  1.49k|}
ctrl_params_translate.c:default_fixup_args:
  390|  2.49k|{
  391|  2.49k|    int ret;
  392|       |
  393|  2.49k|    if ((ret = default_check(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (393:9): [True: 0, False: 2.49k]
  ------------------
  394|      0|        return ret;
  395|       |
  396|  2.49k|    switch (state) {
  397|      0|    default:
  ------------------
  |  Branch (397:5): [True: 0, False: 2.49k]
  ------------------
  398|       |        /* For states this function should never have been called with */
  399|      0|        ERR_raise_data(ERR_LIB_EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
  ------------------
  |  |  352|      0|# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED       (257|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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|      0|                       "[action:%d, state:%d]", ctx->action_type, state);
  401|      0|        return 0;
  402|       |
  403|       |    /*
  404|       |     * PRE_CTRL_TO_PARAMS and POST_CTRL_TO_PARAMS handle ctrl to params
  405|       |     * translations.  PRE_CTRL_TO_PARAMS is responsible for preparing
  406|       |     * |*params|, and POST_CTRL_TO_PARAMS is responsible for bringing the
  407|       |     * result back to |*p2| and the return value.
  408|       |     */
  409|    996|    case PRE_CTRL_TO_PARAMS:
  ------------------
  |  Branch (409:5): [True: 996, False: 1.49k]
  ------------------
  410|       |        /* This is ctrl to params translation, so we need an OSSL_PARAM key */
  411|    996|        if (ctx->action_type == OSSL_ACTION_NONE) {
  ------------------
  |  Branch (411:13): [True: 0, False: 996]
  ------------------
  412|       |            /*
  413|       |             * No action type is an error here.  That's a case for a
  414|       |             * special fixup function.
  415|       |             */
  416|      0|            ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  417|      0|                           "[action:%d, state:%d]", ctx->action_type, state);
  418|      0|            return 0;
  419|      0|        }
  420|       |
  421|    996|        if (translation->optype != 0) {
  ------------------
  |  Branch (421:13): [True: 996, False: 0]
  ------------------
  422|    996|            if ((EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|  1.99k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|    996|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|    996|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|    996|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|    996|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|    996|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|    996|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|    996|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|    996|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|    996|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|    996|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|    996|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 996, False: 0]
  |  |  ------------------
  ------------------
  423|    996|                 && ctx->pctx->op.sig.algctx == NULL)
  ------------------
  |  Branch (423:21): [True: 0, False: 996]
  ------------------
  424|    996|                || (EVP_PKEY_CTX_IS_DERIVE_OP(ctx->pctx)
  ------------------
  |  |  744|  1.99k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|    996|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|    996|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 996]
  |  |  ------------------
  ------------------
  425|    996|                    && ctx->pctx->op.kex.algctx == NULL)
  ------------------
  |  Branch (425:24): [True: 0, False: 0]
  ------------------
  426|    996|                || (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx->pctx)
  ------------------
  |  |  747|  1.99k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|    996|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|    996|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|    996|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 996]
  |  |  ------------------
  ------------------
  427|    996|                    && ctx->pctx->op.ciph.algctx == NULL)
  ------------------
  |  Branch (427:24): [True: 0, False: 0]
  ------------------
  428|    996|                || (EVP_PKEY_CTX_IS_KEM_OP(ctx->pctx)
  ------------------
  |  |  756|  1.99k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|    996|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|    996|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|    996|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 996]
  |  |  ------------------
  ------------------
  429|    996|                    && ctx->pctx->op.encap.algctx == NULL)
  ------------------
  |  Branch (429:24): [True: 0, False: 0]
  ------------------
  430|       |                /*
  431|       |                 * The following may be unnecessary, but we have them
  432|       |                 * for good measure...
  433|       |                 */
  434|    996|                || (EVP_PKEY_CTX_IS_GEN_OP(ctx->pctx)
  ------------------
  |  |  750|  1.99k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|    996|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|    996|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|    996|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 996]
  |  |  ------------------
  ------------------
  435|    996|                    && ctx->pctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (435:24): [True: 0, False: 0]
  ------------------
  436|    996|                || (EVP_PKEY_CTX_IS_FROMDATA_OP(ctx->pctx)
  ------------------
  |  |  753|  1.99k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DATA) != 0)
  |  |  ------------------
  |  |  |  | 1776|    996|    (EVP_PKEY_OP_FROMDATA)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1747|    996|# define EVP_PKEY_OP_FROMDATA            (1 << 3)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (753:5): [True: 0, False: 996]
  |  |  ------------------
  ------------------
  437|    996|                    && ctx->pctx->op.keymgmt.genctx == NULL)) {
  ------------------
  |  Branch (437:24): [True: 0, False: 0]
  ------------------
  438|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  439|       |                /* Uses the same return values as EVP_PKEY_CTX_ctrl */
  440|      0|                return -2;
  441|      0|            }
  442|    996|        }
  443|       |
  444|       |        /*
  445|       |         * OSSL_PARAM_construct_TYPE() works equally well for OSSL_ACTION_SET and OSSL_ACTION_GET.
  446|       |         */
  447|    996|        switch (translation->param_data_type) {
  ------------------
  |  Branch (447:17): [True: 0, False: 996]
  ------------------
  448|      0|        case OSSL_PARAM_INTEGER:
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (448:9): [True: 0, False: 996]
  ------------------
  449|      0|            *ctx->params = OSSL_PARAM_construct_int(translation->param_key,
  450|      0|                                                    &ctx->p1);
  451|      0|            break;
  452|      0|        case OSSL_PARAM_UNSIGNED_INTEGER:
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (452:9): [True: 0, False: 996]
  ------------------
  453|       |            /*
  454|       |             * BIGNUMs are passed via |p2|.  For all ctrl's that just want
  455|       |             * to pass a simple integer via |p1|, |p2| is expected to be
  456|       |             * NULL.
  457|       |             *
  458|       |             * Note that this allocates a buffer, which the cleanup function
  459|       |             * must deallocate.
  460|       |             */
  461|      0|            if (ctx->p2 != NULL) {
  ------------------
  |  Branch (461:17): [True: 0, False: 0]
  ------------------
  462|      0|                if (ctx->action_type == OSSL_ACTION_SET) {
  ------------------
  |  Branch (462:21): [True: 0, False: 0]
  ------------------
  463|      0|                    ctx->buflen = BN_num_bytes(ctx->p2);
  ------------------
  |  |  189|      0|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  464|      0|                    if ((ctx->allocated_buf
  ------------------
  |  Branch (464:25): [True: 0, False: 0]
  ------------------
  465|      0|                         = OPENSSL_malloc(ctx->buflen)) == NULL)
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  466|      0|                        return 0;
  467|      0|                    if (BN_bn2nativepad(ctx->p2,
  ------------------
  |  Branch (467:25): [True: 0, False: 0]
  ------------------
  468|      0|                                         ctx->allocated_buf, ctx->buflen) < 0) {
  469|      0|                        OPENSSL_free(ctx->allocated_buf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  470|      0|                        ctx->allocated_buf = NULL;
  471|      0|                        return 0;
  472|      0|                    }
  473|      0|                    *ctx->params =
  474|      0|                        OSSL_PARAM_construct_BN(translation->param_key,
  475|      0|                                                ctx->allocated_buf,
  476|      0|                                                ctx->buflen);
  477|      0|                } else {
  478|       |                    /*
  479|       |                     * No support for getting a BIGNUM by ctrl, this needs
  480|       |                     * fixup_args function support.
  481|       |                     */
  482|      0|                    ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|      0|                                   "[action:%d, state:%d] trying to get a "
  484|      0|                                   "BIGNUM via ctrl call",
  485|      0|                                   ctx->action_type, state);
  486|      0|                    return 0;
  487|      0|                }
  488|      0|            } else {
  489|      0|                *ctx->params =
  490|      0|                    OSSL_PARAM_construct_uint(translation->param_key,
  491|      0|                                              (unsigned int *)&ctx->p1);
  492|      0|            }
  493|      0|            break;
  494|    996|        case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|    996|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (494:9): [True: 996, False: 0]
  ------------------
  495|    996|            *ctx->params =
  496|    996|                OSSL_PARAM_construct_utf8_string(translation->param_key,
  497|    996|                                                 ctx->p2, (size_t)ctx->p1);
  498|    996|            break;
  499|      0|        case OSSL_PARAM_UTF8_PTR:
  ------------------
  |  |  141|      0|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
  |  Branch (499:9): [True: 0, False: 996]
  ------------------
  500|      0|            *ctx->params =
  501|      0|                OSSL_PARAM_construct_utf8_ptr(translation->param_key,
  502|      0|                                              ctx->p2, (size_t)ctx->p1);
  503|      0|            break;
  504|      0|        case OSSL_PARAM_OCTET_STRING:
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (504:9): [True: 0, False: 996]
  ------------------
  505|      0|            *ctx->params =
  506|      0|                OSSL_PARAM_construct_octet_string(translation->param_key,
  507|      0|                                                  ctx->p2, (size_t)ctx->p1);
  508|      0|            break;
  509|      0|        case OSSL_PARAM_OCTET_PTR:
  ------------------
  |  |  160|      0|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (509:9): [True: 0, False: 996]
  ------------------
  510|      0|            *ctx->params =
  511|      0|                OSSL_PARAM_construct_octet_ptr(translation->param_key,
  512|      0|                                               ctx->p2, (size_t)ctx->p1);
  513|      0|            break;
  514|    996|        }
  515|    996|        break;
  516|  1.49k|    case POST_CTRL_TO_PARAMS:
  ------------------
  |  Branch (516:5): [True: 1.49k, False: 996]
  ------------------
  517|       |        /*
  518|       |         * Because EVP_PKEY_CTX_ctrl() returns the length of certain objects
  519|       |         * as its return value, we need to ensure that we do it here as well,
  520|       |         * for the OSSL_PARAM data types where this makes sense.
  521|       |         */
  522|  1.49k|        if (ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (522:13): [True: 0, False: 1.49k]
  ------------------
  523|      0|            switch (translation->param_data_type) {
  ------------------
  |  Branch (523:21): [True: 0, False: 0]
  ------------------
  524|      0|            case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            case OSSL_PARAM_UTF8_PTR:
  ------------------
  |  |  141|      0|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  ------------------
  526|      0|            case OSSL_PARAM_OCTET_STRING:
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (526:13): [True: 0, False: 0]
  ------------------
  527|      0|            case OSSL_PARAM_OCTET_PTR:
  ------------------
  |  |  160|      0|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|                ctx->p1 = (int)ctx->params[0].return_size;
  529|      0|                break;
  530|      0|            }
  531|      0|        }
  532|  1.49k|        break;
  533|       |
  534|       |    /*
  535|       |     * PRE_CTRL_STR_TO_PARAMS and POST_CTRL_STR_TO_PARAMS handle ctrl_str to
  536|       |     * params translations.  PRE_CTRL_TO_PARAMS is responsible for preparing
  537|       |     * |*params|, and POST_CTRL_TO_PARAMS currently has nothing to do, since
  538|       |     * there's no support for getting data via ctrl_str calls.
  539|       |     */
  540|  1.49k|    case PRE_CTRL_STR_TO_PARAMS:
  ------------------
  |  Branch (540:5): [True: 0, False: 2.49k]
  ------------------
  541|      0|        {
  542|       |            /* This is ctrl_str to params translation */
  543|      0|            const char *tmp_ctrl_str = ctx->ctrl_str;
  544|      0|            const char *orig_ctrl_str = ctx->ctrl_str;
  545|      0|            const char *orig_value = ctx->p2;
  546|      0|            const OSSL_PARAM *settable = NULL;
  547|      0|            int exists = 0;
  548|       |
  549|       |            /* Only setting is supported here */
  550|      0|            if (ctx->action_type != OSSL_ACTION_SET) {
  ------------------
  |  Branch (550:17): [True: 0, False: 0]
  ------------------
  551|      0|                ERR_raise_data(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED,
  ------------------
  |  |   36|      0|# define EVP_R_COMMAND_NOT_SUPPORTED                      147
  ------------------
  552|      0|                                   "[action:%d, state:%d] only setting allowed",
  553|      0|                                   ctx->action_type, state);
  554|      0|                return 0;
  555|      0|            }
  556|       |
  557|       |            /*
  558|       |             * If no translation exists, we simply pass the control string
  559|       |             * unmodified.
  560|       |             */
  561|      0|            if (translation != NULL) {
  ------------------
  |  Branch (561:17): [True: 0, False: 0]
  ------------------
  562|      0|                tmp_ctrl_str = ctx->ctrl_str = translation->param_key;
  563|       |
  564|      0|                if (ctx->ishex) {
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|                    strcpy(ctx->name_buf, "hex");
  566|      0|                    if (OPENSSL_strlcat(ctx->name_buf, tmp_ctrl_str,
  ------------------
  |  Branch (566:25): [True: 0, False: 0]
  ------------------
  567|      0|                                        sizeof(ctx->name_buf)) <= 3) {
  568|      0|                        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  569|      0|                        return -1;
  570|      0|                    }
  571|      0|                    tmp_ctrl_str = ctx->name_buf;
  572|      0|                }
  573|      0|            }
  574|       |
  575|      0|            settable = EVP_PKEY_CTX_settable_params(ctx->pctx);
  576|      0|            if (!OSSL_PARAM_allocate_from_text(ctx->params, settable,
  ------------------
  |  Branch (576:17): [True: 0, False: 0]
  ------------------
  577|      0|                                               tmp_ctrl_str,
  578|      0|                                               ctx->p2, strlen(ctx->p2),
  579|      0|                                               &exists)) {
  580|      0|                if (!exists) {
  ------------------
  |  Branch (580:21): [True: 0, False: 0]
  ------------------
  581|      0|                    ERR_raise_data(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED,
  ------------------
  |  |   36|      0|# define EVP_R_COMMAND_NOT_SUPPORTED                      147
  ------------------
  582|      0|                                   "[action:%d, state:%d] name=%s, value=%s",
  583|      0|                                   ctx->action_type, state,
  584|      0|                                   orig_ctrl_str, orig_value);
  585|      0|                    return -2;
  586|      0|                }
  587|      0|                return 0;
  588|      0|            }
  589|      0|            ctx->allocated_buf = ctx->params->data;
  590|      0|            ctx->buflen = ctx->params->data_size;
  591|      0|        }
  592|      0|        break;
  593|      0|    case POST_CTRL_STR_TO_PARAMS:
  ------------------
  |  Branch (593:5): [True: 0, False: 2.49k]
  ------------------
  594|       |        /* Nothing to be done */
  595|      0|        break;
  596|       |
  597|       |    /*
  598|       |     * PRE_PARAMS_TO_CTRL and POST_PARAMS_TO_CTRL handle params to ctrl
  599|       |     * translations.  PRE_PARAMS_TO_CTRL is responsible for preparing
  600|       |     * |p1| and |p2|, and POST_PARAMS_TO_CTRL is responsible for bringing
  601|       |     * the EVP_PKEY_CTX_ctrl() return value (passed as |p1|) and |p2| back
  602|       |     * to |*params|.
  603|       |     *
  604|       |     * PKEY is treated just like POST_PARAMS_TO_CTRL, making it easy
  605|       |     * for the related fixup_args functions to just set |p1| and |p2|
  606|       |     * appropriately and leave it to this section of code to fix up
  607|       |     * |ctx->params| accordingly.
  608|       |     */
  609|      0|    case PKEY:
  ------------------
  |  Branch (609:5): [True: 0, False: 2.49k]
  ------------------
  610|      0|    case POST_PARAMS_TO_CTRL:
  ------------------
  |  Branch (610:5): [True: 0, False: 2.49k]
  ------------------
  611|      0|        ret = ctx->p1;
  612|       |        /* FALLTHRU */
  613|      0|    case PRE_PARAMS_TO_CTRL:
  ------------------
  |  Branch (613:5): [True: 0, False: 2.49k]
  ------------------
  614|      0|        {
  615|       |            /* This is params to ctrl translation */
  616|      0|            if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == OSSL_ACTION_SET) {
  ------------------
  |  Branch (616:17): [True: 0, False: 0]
  |  Branch (616:48): [True: 0, False: 0]
  ------------------
  617|       |                /* For the PRE state, only setting needs some work to be done */
  618|       |
  619|       |                /* When setting, we populate |p1| and |p2| from |*params| */
  620|      0|                switch (translation->param_data_type) {
  621|      0|                case OSSL_PARAM_INTEGER:
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (621:17): [True: 0, False: 0]
  ------------------
  622|      0|                    return OSSL_PARAM_get_int(ctx->params, &ctx->p1);
  623|      0|                case OSSL_PARAM_UNSIGNED_INTEGER:
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (623:17): [True: 0, False: 0]
  ------------------
  624|      0|                    if (ctx->p2 != NULL) {
  ------------------
  |  Branch (624:25): [True: 0, False: 0]
  ------------------
  625|       |                        /* BIGNUM passed down with p2 */
  626|      0|                        if (!OSSL_PARAM_get_BN(ctx->params, ctx->p2))
  ------------------
  |  Branch (626:29): [True: 0, False: 0]
  ------------------
  627|      0|                            return 0;
  628|      0|                    } else {
  629|       |                        /* Normal C unsigned int passed down */
  630|      0|                        if (!OSSL_PARAM_get_uint(ctx->params,
  ------------------
  |  Branch (630:29): [True: 0, False: 0]
  ------------------
  631|      0|                                                 (unsigned int *)&ctx->p1))
  632|      0|                            return 0;
  633|      0|                    }
  634|      0|                    return 1;
  635|      0|                case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (635:17): [True: 0, False: 0]
  ------------------
  636|      0|                    return OSSL_PARAM_get_utf8_string(ctx->params,
  637|      0|                                                      ctx->p2, ctx->sz);
  638|      0|                case OSSL_PARAM_OCTET_STRING:
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (638:17): [True: 0, False: 0]
  ------------------
  639|      0|                    return OSSL_PARAM_get_octet_string(ctx->params,
  640|      0|                                                       &ctx->p2, ctx->sz,
  641|      0|                                                       (size_t *)&ctx->p1);
  642|      0|                case OSSL_PARAM_OCTET_PTR:
  ------------------
  |  |  160|      0|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (642:17): [True: 0, False: 0]
  ------------------
  643|      0|                    return OSSL_PARAM_get_octet_ptr(ctx->params,
  644|      0|                                                    ctx->p2, &ctx->sz);
  645|      0|                default:
  ------------------
  |  Branch (645:17): [True: 0, False: 0]
  ------------------
  646|      0|                    ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|      0|                                   "[action:%d, state:%d] "
  648|      0|                                   "unknown OSSL_PARAM data type %d",
  649|      0|                                   ctx->action_type, state,
  650|      0|                                   translation->param_data_type);
  651|      0|                    return 0;
  652|      0|                }
  653|      0|            } else if ((state == POST_PARAMS_TO_CTRL || state == PKEY)
  ------------------
  |  Branch (653:25): [True: 0, False: 0]
  |  Branch (653:57): [True: 0, False: 0]
  ------------------
  654|      0|                       && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (654:27): [True: 0, False: 0]
  ------------------
  655|       |                /* For the POST state, only getting needs some work to be done */
  656|      0|                unsigned int param_data_type = translation->param_data_type;
  657|      0|                size_t size = (size_t)ctx->p1;
  658|       |
  659|      0|                if (state == PKEY)
  ------------------
  |  Branch (659:21): [True: 0, False: 0]
  ------------------
  660|      0|                    size = ctx->sz;
  661|      0|                if (param_data_type == 0) {
  ------------------
  |  Branch (661:21): [True: 0, False: 0]
  ------------------
  662|       |                    /* we must have a fixup_args function to work */
  663|      0|                    if (!ossl_assert(translation->fixup_args != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (663:25): [True: 0, False: 0]
  ------------------
  664|      0|                        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  665|      0|                        return 0;
  666|      0|                    }
  667|      0|                    param_data_type = ctx->params->data_type;
  668|      0|                }
  669|       |                /* When getting, we populate |*params| from |p1| and |p2| */
  670|      0|                switch (param_data_type) {
  671|      0|                case OSSL_PARAM_INTEGER:
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (671:17): [True: 0, False: 0]
  ------------------
  672|      0|                    return OSSL_PARAM_set_int(ctx->params, ctx->p1);
  673|      0|                case OSSL_PARAM_UNSIGNED_INTEGER:
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (673:17): [True: 0, False: 0]
  ------------------
  674|      0|                    if (ctx->p2 != NULL) {
  ------------------
  |  Branch (674:25): [True: 0, False: 0]
  ------------------
  675|       |                        /* BIGNUM passed back */
  676|      0|                        return OSSL_PARAM_set_BN(ctx->params, ctx->p2);
  677|      0|                    } else {
  678|       |                        /* Normal C unsigned int passed back */
  679|      0|                        return OSSL_PARAM_set_uint(ctx->params,
  680|      0|                                                   (unsigned int)ctx->p1);
  681|      0|                    }
  682|      0|                    return 0;
  683|      0|                case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (683:17): [True: 0, False: 0]
  ------------------
  684|      0|                    return OSSL_PARAM_set_utf8_string(ctx->params, ctx->p2);
  685|      0|                case OSSL_PARAM_OCTET_STRING:
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (685:17): [True: 0, False: 0]
  ------------------
  686|      0|                    return OSSL_PARAM_set_octet_string(ctx->params, ctx->p2,
  687|      0|                                                       size);
  688|      0|                case OSSL_PARAM_OCTET_PTR:
  ------------------
  |  |  160|      0|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (688:17): [True: 0, False: 0]
  ------------------
  689|      0|                    return OSSL_PARAM_set_octet_ptr(ctx->params, *(void **)ctx->p2,
  690|      0|                                                    size);
  691|      0|                default:
  ------------------
  |  Branch (691:17): [True: 0, False: 0]
  ------------------
  692|      0|                    ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                                  ERR_raise_data(ERR_LIB_EVP, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|      0|                                   "[action:%d, state:%d] "
  694|      0|                                   "unsupported OSSL_PARAM data type %d",
  695|      0|                                   ctx->action_type, state,
  696|      0|                                   translation->param_data_type);
  697|      0|                    return 0;
  698|      0|                }
  699|      0|            } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (699:24): [True: 0, False: 0]
  |  Branch (699:55): [True: 0, False: 0]
  ------------------
  700|      0|                if (translation->param_data_type == OSSL_PARAM_OCTET_PTR)
  ------------------
  |  |  160|      0|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (700:21): [True: 0, False: 0]
  ------------------
  701|      0|                    ctx->p2 = &ctx->bufp;
  702|      0|            }
  703|      0|        }
  704|       |        /* Any other combination is simply pass-through */
  705|      0|        break;
  706|  2.49k|    }
  707|  2.49k|    return ret;
  708|  2.49k|}
ctrl_params_translate.c:default_check:
  292|  5.47k|{
  293|  5.47k|    switch (state) {
  294|  2.98k|    default:
  ------------------
  |  Branch (294:5): [True: 2.98k, False: 2.49k]
  ------------------
  295|  2.98k|        break;
  296|  2.98k|    case PRE_CTRL_TO_PARAMS:
  ------------------
  |  Branch (296:5): [True: 2.49k, False: 2.98k]
  ------------------
  297|  2.49k|        if (!ossl_assert(translation != NULL)) {
  ------------------
  |  |   52|  2.49k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.49k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (297:13): [True: 0, False: 2.49k]
  ------------------
  298|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|            return -2;
  300|      0|        }
  301|  2.49k|        if (!ossl_assert(translation->param_key != 0)
  ------------------
  |  |   52|  4.98k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  4.98k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (301:13): [True: 0, False: 2.49k]
  ------------------
  302|  2.49k|            || !ossl_assert(translation->param_data_type != 0)) {
  ------------------
  |  |   52|  2.49k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.49k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (302:16): [True: 0, False: 2.49k]
  ------------------
  303|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  304|      0|            return -1;
  305|      0|        }
  306|  2.49k|        break;
  307|  2.49k|    case PRE_CTRL_STR_TO_PARAMS:
  ------------------
  |  Branch (307:5): [True: 0, False: 5.47k]
  ------------------
  308|       |        /*
  309|       |         * For ctrl_str to params translation, we allow direct use of
  310|       |         * OSSL_PARAM keys as ctrl_str keys.  Therefore, it's possible that
  311|       |         * we end up with |translation == NULL|, which is fine.  The fixup
  312|       |         * function will have to deal with it carefully.
  313|       |         */
  314|      0|        if (translation != NULL) {
  ------------------
  |  Branch (314:13): [True: 0, False: 0]
  ------------------
  315|      0|            if (!ossl_assert(translation->action_type != OSSL_ACTION_GET)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (315:17): [True: 0, False: 0]
  ------------------
  316|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  317|      0|                return -2;
  318|      0|            }
  319|      0|            if (!ossl_assert(translation->param_key != NULL)
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (319:17): [True: 0, False: 0]
  ------------------
  320|      0|                || !ossl_assert(translation->param_data_type != 0)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (320:20): [True: 0, False: 0]
  ------------------
  321|      0|                ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|                return 0;
  323|      0|            }
  324|      0|        }
  325|      0|        break;
  326|      0|    case PRE_PARAMS_TO_CTRL:
  ------------------
  |  Branch (326:5): [True: 0, False: 5.47k]
  ------------------
  327|      0|    case POST_PARAMS_TO_CTRL:
  ------------------
  |  Branch (327:5): [True: 0, False: 5.47k]
  ------------------
  328|      0|        if (!ossl_assert(translation != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (328:13): [True: 0, False: 0]
  ------------------
  329|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  330|      0|            return -2;
  331|      0|        }
  332|      0|        if (!ossl_assert(translation->ctrl_num != 0)
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (332:13): [True: 0, False: 0]
  ------------------
  333|      0|            || !ossl_assert(translation->param_data_type != 0)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (333:16): [True: 0, False: 0]
  ------------------
  334|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  335|      0|            return -1;
  336|      0|        }
  337|  5.47k|    }
  338|       |
  339|       |    /* Nothing else to check */
  340|  5.47k|    return 1;
  341|  5.47k|}
ctrl_params_translate.c:lookup_evp_pkey_ctx_translation:
 2697|  1.49k|{
 2698|  1.49k|    return lookup_translation(tmpl, evp_pkey_ctx_translations,
 2699|  1.49k|                              OSSL_NELEM(evp_pkey_ctx_translations));
  ------------------
  |  |   14|  1.49k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 2700|  1.49k|}
ctrl_params_translate.c:lookup_translation:
 2594|  1.49k|{
 2595|  1.49k|    size_t i;
 2596|       |
 2597|  73.2k|    for (i = 0; i < translations_num; i++) {
  ------------------
  |  Branch (2597:17): [True: 73.2k, False: 0]
  ------------------
 2598|  73.2k|        const struct translation_st *item = &translations[i];
 2599|       |
 2600|       |        /*
 2601|       |         * Sanity check the translation table item.
 2602|       |         *
 2603|       |         * 1.  Either both keytypes are -1, or neither of them are.
 2604|       |         * 2.  TBA...
 2605|       |         */
 2606|  73.2k|        if (!ossl_assert((item->keytype1 == -1) == (item->keytype2 == -1)))
  ------------------
  |  |   52|  73.2k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  73.2k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2606:13): [True: 0, False: 73.2k]
  ------------------
 2607|      0|            continue;
 2608|       |
 2609|       |
 2610|       |        /*
 2611|       |         * Base search criteria: check that the optype and keytypes match,
 2612|       |         * if relevant.  All callers must synthesise these bits somehow.
 2613|       |         */
 2614|  73.2k|        if (item->optype != -1 && (tmpl->optype & item->optype) == 0)
  ------------------
  |  Branch (2614:13): [True: 70.2k, False: 2.98k]
  |  Branch (2614:35): [True: 42.8k, False: 27.3k]
  ------------------
 2615|  42.8k|            continue;
 2616|       |        /*
 2617|       |         * This expression is stunningly simple thanks to the sanity check
 2618|       |         * above.
 2619|       |         */
 2620|  30.3k|        if (item->keytype1 != -1
  ------------------
  |  Branch (2620:13): [True: 25.8k, False: 4.48k]
  ------------------
 2621|  30.3k|            && tmpl->keytype1 != item->keytype1
  ------------------
  |  Branch (2621:16): [True: 21.7k, False: 4.15k]
  ------------------
 2622|  30.3k|            && tmpl->keytype2 != item->keytype2)
  ------------------
  |  Branch (2622:16): [True: 21.4k, False: 324]
  ------------------
 2623|  21.4k|            continue;
 2624|       |
 2625|       |        /*
 2626|       |         * Done with the base search criteria, now we check the criteria for
 2627|       |         * the individual types of translations:
 2628|       |         * ctrl->params, ctrl_str->params, and params->ctrl
 2629|       |         */
 2630|  8.96k|        if (tmpl->ctrl_num != 0) {
  ------------------
  |  Branch (2630:13): [True: 8.96k, False: 0]
  ------------------
 2631|  8.96k|            if (tmpl->ctrl_num != item->ctrl_num)
  ------------------
  |  Branch (2631:17): [True: 7.47k, False: 1.49k]
  ------------------
 2632|  7.47k|                continue;
 2633|  8.96k|        } else if (tmpl->ctrl_str != NULL) {
  ------------------
  |  Branch (2633:20): [True: 0, False: 0]
  ------------------
 2634|      0|            const char *ctrl_str = NULL;
 2635|      0|            const char *ctrl_hexstr = NULL;
 2636|       |
 2637|       |            /*
 2638|       |             * Search criteria that originates from a ctrl_str is only used
 2639|       |             * for setting, never for getting.  Therefore, we only look at
 2640|       |             * the setter items.
 2641|       |             */
 2642|      0|            if (item->action_type != OSSL_ACTION_NONE
  ------------------
  |  Branch (2642:17): [True: 0, False: 0]
  ------------------
 2643|      0|                && item->action_type != OSSL_ACTION_SET)
  ------------------
  |  Branch (2643:20): [True: 0, False: 0]
  ------------------
 2644|      0|                continue;
 2645|       |            /*
 2646|       |             * At least one of the ctrl cmd names must be match the ctrl
 2647|       |             * cmd name in the template.
 2648|       |             */
 2649|      0|            if (item->ctrl_str != NULL
  ------------------
  |  Branch (2649:17): [True: 0, False: 0]
  ------------------
 2650|      0|                && OPENSSL_strcasecmp(tmpl->ctrl_str, item->ctrl_str) == 0)
  ------------------
  |  Branch (2650:20): [True: 0, False: 0]
  ------------------
 2651|      0|                ctrl_str = tmpl->ctrl_str;
 2652|      0|            else if (item->ctrl_hexstr != NULL
  ------------------
  |  Branch (2652:22): [True: 0, False: 0]
  ------------------
 2653|      0|                     && OPENSSL_strcasecmp(tmpl->ctrl_hexstr,
  ------------------
  |  Branch (2653:25): [True: 0, False: 0]
  ------------------
 2654|      0|                                           item->ctrl_hexstr) == 0)
 2655|      0|                ctrl_hexstr = tmpl->ctrl_hexstr;
 2656|      0|            else
 2657|      0|                continue;
 2658|       |
 2659|       |            /* Modify the template to signal which string matched */
 2660|      0|            tmpl->ctrl_str = ctrl_str;
 2661|      0|            tmpl->ctrl_hexstr = ctrl_hexstr;
 2662|      0|        } else if (tmpl->param_key != NULL) {
  ------------------
  |  Branch (2662:20): [True: 0, False: 0]
  ------------------
 2663|       |            /*
 2664|       |             * Search criteria that originates from an OSSL_PARAM setter or
 2665|       |             * getter.
 2666|       |             *
 2667|       |             * Ctrls were fundamentally bidirectional, with only the ctrl
 2668|       |             * command macro name implying direction (if you're lucky).
 2669|       |             * A few ctrl commands were even taking advantage of the
 2670|       |             * bidirectional nature, making the direction depend in the
 2671|       |             * value of the numeric argument.
 2672|       |             *
 2673|       |             * OSSL_PARAM functions are fundamentally different, in that
 2674|       |             * setters and getters are separated, so the data direction is
 2675|       |             * implied by the function that's used.  The same OSSL_PARAM
 2676|       |             * key name can therefore be used in both directions.  We must
 2677|       |             * therefore take the action type into account in this case.
 2678|       |             */
 2679|      0|            if ((item->action_type != OSSL_ACTION_NONE
  ------------------
  |  Branch (2679:18): [True: 0, False: 0]
  ------------------
 2680|      0|                 && tmpl->action_type != item->action_type)
  ------------------
  |  Branch (2680:21): [True: 0, False: 0]
  ------------------
 2681|      0|                || (item->param_key != NULL
  ------------------
  |  Branch (2681:21): [True: 0, False: 0]
  ------------------
 2682|      0|                    && OPENSSL_strcasecmp(tmpl->param_key,
  ------------------
  |  Branch (2682:24): [True: 0, False: 0]
  ------------------
 2683|      0|                                          item->param_key) != 0))
 2684|      0|                continue;
 2685|      0|        } else {
 2686|      0|            return NULL;
 2687|      0|        }
 2688|       |
 2689|  1.49k|        return item;
 2690|  8.96k|    }
 2691|       |
 2692|      0|    return NULL;
 2693|  1.49k|}
ctrl_params_translate.c:fix_md:
  813|    996|{
  814|    996|    return fix_cipher_md(state, translation, ctx,
  815|    996|                         get_md_name, get_md_by_name);
  816|    996|}
ctrl_params_translate.c:fix_cipher_md:
  751|    996|{
  752|    996|    int ret = 1;
  753|       |
  754|    996|    if ((ret = default_check(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (754:9): [True: 0, False: 996]
  ------------------
  755|      0|        return ret;
  756|       |
  757|    996|    if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (757:9): [True: 498, False: 498]
  |  Branch (757:40): [True: 0, False: 498]
  ------------------
  758|       |        /*
  759|       |         * |ctx->p2| contains the address to an EVP_CIPHER or EVP_MD pointer
  760|       |         * to be filled in.  We need to remember it, then make |ctx->p2|
  761|       |         * point at a buffer to be filled in with the name, and |ctx->p1|
  762|       |         * with its size.  default_fixup_args() will take care of the rest
  763|       |         * for us.
  764|       |         */
  765|      0|        ctx->orig_p2 = ctx->p2;
  766|      0|        ctx->p2 = ctx->name_buf;
  767|      0|        ctx->p1 = sizeof(ctx->name_buf);
  768|    996|    } else if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == OSSL_ACTION_SET) {
  ------------------
  |  Branch (768:16): [True: 498, False: 498]
  |  Branch (768:47): [True: 498, False: 0]
  ------------------
  769|       |        /*
  770|       |         * In different parts of OpenSSL, this ctrl command is used
  771|       |         * differently.  Some calls pass a NID as p1, others pass an
  772|       |         * EVP_CIPHER pointer as p2...
  773|       |         */
  774|    498|        ctx->p2 = (char *)(ctx->p2 == NULL
  ------------------
  |  Branch (774:28): [True: 0, False: 498]
  ------------------
  775|    498|                           ? OBJ_nid2sn(ctx->p1)
  776|    498|                           : get_name(ctx->p2));
  777|    498|        ctx->p1 = strlen(ctx->p2);
  778|    498|    } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (778:16): [True: 0, False: 498]
  |  Branch (778:48): [True: 0, False: 0]
  ------------------
  779|      0|        ctx->p2 = (ctx->p2 == NULL ? "" : (char *)get_name(ctx->p2));
  ------------------
  |  Branch (779:20): [True: 0, False: 0]
  ------------------
  780|      0|        ctx->p1 = strlen(ctx->p2);
  781|      0|    }
  782|       |
  783|    996|    if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (783:9): [True: 0, False: 996]
  ------------------
  784|      0|        return ret;
  785|       |
  786|    996|    if (state == POST_CTRL_TO_PARAMS && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (786:9): [True: 498, False: 498]
  |  Branch (786:41): [True: 0, False: 498]
  ------------------
  787|       |        /*
  788|       |         * Here's how we reuse |ctx->orig_p2| that was set in the
  789|       |         * PRE_CTRL_TO_PARAMS state above.
  790|       |         */
  791|      0|        *(void **)ctx->orig_p2 =
  792|      0|            (void *)get_algo_by_name(ctx->pctx->libctx, ctx->p2);
  793|      0|        ctx->p1 = 1;
  794|    996|    } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == OSSL_ACTION_SET) {
  ------------------
  |  Branch (794:16): [True: 0, False: 996]
  |  Branch (794:47): [True: 0, False: 0]
  ------------------
  795|      0|        ctx->p2 = (void *)get_algo_by_name(ctx->pctx->libctx, ctx->p2);
  796|      0|        ctx->p1 = 0;
  797|      0|    }
  798|       |
  799|    996|    return ret;
  800|    996|}
ctrl_params_translate.c:get_md_name:
  731|    498|{
  732|    498|    return EVP_MD_get0_name(md);
  733|    498|}
ctrl_params_translate.c:fix_rsa_padding_mode:
 1252|    996|{
 1253|    996|    static const OSSL_ITEM str_value_map[] = {
 1254|    996|        { RSA_PKCS1_PADDING,            "pkcs1"  },
  ------------------
  |  |  194|    996|# define RSA_PKCS1_PADDING          1
  ------------------
 1255|    996|        { RSA_NO_PADDING,               "none"   },
  ------------------
  |  |  195|    996|# define RSA_NO_PADDING             3
  ------------------
 1256|    996|        { RSA_PKCS1_OAEP_PADDING,       "oaep"   },
  ------------------
  |  |  196|    996|# define RSA_PKCS1_OAEP_PADDING     4
  ------------------
 1257|    996|        { RSA_PKCS1_OAEP_PADDING,       "oeap"   },
  ------------------
  |  |  196|    996|# define RSA_PKCS1_OAEP_PADDING     4
  ------------------
 1258|    996|        { RSA_X931_PADDING,             "x931"   },
  ------------------
  |  |  197|    996|# define RSA_X931_PADDING           5
  ------------------
 1259|    996|        { RSA_PKCS1_PSS_PADDING,        "pss"    },
  ------------------
  |  |  200|    996|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
 1260|       |        /* Special case, will pass directly as an integer */
 1261|    996|        { RSA_PKCS1_WITH_TLS_PADDING,   NULL     }
  ------------------
  |  |  201|    996|# define RSA_PKCS1_WITH_TLS_PADDING 7
  ------------------
 1262|    996|    };
 1263|    996|    int ret;
 1264|       |
 1265|    996|    if ((ret = default_check(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (1265:9): [True: 0, False: 996]
  ------------------
 1266|      0|        return ret;
 1267|       |
 1268|    996|    if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (1268:9): [True: 498, False: 498]
  |  Branch (1268:40): [True: 0, False: 498]
  ------------------
 1269|       |        /*
 1270|       |         * EVP_PKEY_CTRL_GET_RSA_PADDING returns the padding mode in the
 1271|       |         * weirdest way for a ctrl.  Instead of doing like all other ctrls
 1272|       |         * that return a simple, i.e. just have that as a return value,
 1273|       |         * this particular ctrl treats p2 as the address for the int to be
 1274|       |         * returned.  We must therefore remember |ctx->p2|, then make
 1275|       |         * |ctx->p2| point at a buffer to be filled in with the name, and
 1276|       |         * |ctx->p1| with its size.  default_fixup_args() will take care
 1277|       |         * of the rest for us, along with the POST_CTRL_TO_PARAMS && OSSL_ACTION_GET
 1278|       |         * code section further down.
 1279|       |         */
 1280|      0|        ctx->orig_p2 = ctx->p2;
 1281|      0|        ctx->p2 = ctx->name_buf;
 1282|      0|        ctx->p1 = sizeof(ctx->name_buf);
 1283|    996|    } else if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == OSSL_ACTION_SET) {
  ------------------
  |  Branch (1283:16): [True: 498, False: 498]
  |  Branch (1283:47): [True: 498, False: 0]
  ------------------
 1284|       |        /*
 1285|       |         * Ideally, we should use utf8 strings for the diverse padding modes.
 1286|       |         * We only came here because someone called EVP_PKEY_CTX_ctrl(),
 1287|       |         * though, and since that can reasonably be seen as legacy code
 1288|       |         * that uses the diverse RSA macros for the padding mode, and we
 1289|       |         * know that at least our providers can handle the numeric modes,
 1290|       |         * we take the cheap route for now.
 1291|       |         *
 1292|       |         * The other solution would be to match |ctx->p1| against entries
 1293|       |         * in str_value_map and pass the corresponding string.  However,
 1294|       |         * since we don't have a string for RSA_PKCS1_WITH_TLS_PADDING,
 1295|       |         * we have to do this same hack at least for that one.
 1296|       |         *
 1297|       |         * Since the "official" data type for the RSA padding mode is utf8
 1298|       |         * string, we cannot count on default_fixup_args().  Instead, we
 1299|       |         * build the OSSL_PARAM item ourselves and return immediately.
 1300|       |         */
 1301|    498|        ctx->params[0] = OSSL_PARAM_construct_int(translation->param_key,
 1302|    498|                                                  &ctx->p1);
 1303|    498|        return 1;
 1304|    498|    } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (1304:16): [True: 0, False: 498]
  |  Branch (1304:48): [True: 0, False: 0]
  ------------------
 1305|      0|        size_t i;
 1306|       |
 1307|       |        /*
 1308|       |         * The EVP_PKEY_CTX_get_params() caller may have asked for a utf8
 1309|       |         * string, or may have asked for an integer of some sort.  If they
 1310|       |         * ask for an integer, we respond directly.  If not, we translate
 1311|       |         * the response from the ctrl function into a string.
 1312|       |         */
 1313|      0|        switch (ctx->params->data_type) {
 1314|      0|        case OSSL_PARAM_INTEGER:
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (1314:9): [True: 0, False: 0]
  ------------------
 1315|      0|            return OSSL_PARAM_get_int(ctx->params, &ctx->p1);
 1316|      0|        case OSSL_PARAM_UNSIGNED_INTEGER:
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (1316:9): [True: 0, False: 0]
  ------------------
 1317|      0|            return OSSL_PARAM_get_uint(ctx->params, (unsigned int *)&ctx->p1);
 1318|      0|        default:
  ------------------
  |  Branch (1318:9): [True: 0, False: 0]
  ------------------
 1319|      0|            break;
 1320|      0|        }
 1321|       |
 1322|      0|        for (i = 0; i < OSSL_NELEM(str_value_map); i++) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1322:21): [True: 0, False: 0]
  ------------------
 1323|      0|            if (ctx->p1 == (int)str_value_map[i].id)
  ------------------
  |  Branch (1323:17): [True: 0, False: 0]
  ------------------
 1324|      0|                break;
 1325|      0|        }
 1326|      0|        if (i == OSSL_NELEM(str_value_map)) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1326:13): [True: 0, False: 0]
  ------------------
 1327|      0|            ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
  ------------------
  |  |   74|      0|# define ERR_LIB_RSA             4
  ------------------
                          ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
  ------------------
  |  |   98|      0|# define RSA_R_UNKNOWN_PADDING_TYPE                       118
  ------------------
 1328|      0|                           "[action:%d, state:%d] padding number %d",
 1329|      0|                           ctx->action_type, state, ctx->p1);
 1330|      0|            return -2;
 1331|      0|        }
 1332|       |        /*
 1333|       |         * If we don't have a string, we can't do anything.  The caller
 1334|       |         * should have asked for a number...
 1335|       |         */
 1336|      0|        if (str_value_map[i].ptr == NULL) {
  ------------------
  |  Branch (1336:13): [True: 0, False: 0]
  ------------------
 1337|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1338|      0|            return -2;
 1339|      0|        }
 1340|      0|        ctx->p2 = str_value_map[i].ptr;
 1341|      0|        ctx->p1 = strlen(ctx->p2);
 1342|      0|    }
 1343|       |
 1344|    498|    if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (1344:9): [True: 0, False: 498]
  ------------------
 1345|      0|        return ret;
 1346|       |
 1347|    498|    if ((ctx->action_type == OSSL_ACTION_SET && state == PRE_PARAMS_TO_CTRL)
  ------------------
  |  Branch (1347:10): [True: 498, False: 0]
  |  Branch (1347:49): [True: 0, False: 498]
  ------------------
 1348|    498|        || (ctx->action_type == OSSL_ACTION_GET && state == POST_CTRL_TO_PARAMS)) {
  ------------------
  |  Branch (1348:13): [True: 0, False: 498]
  |  Branch (1348:52): [True: 0, False: 0]
  ------------------
 1349|      0|        size_t i;
 1350|       |
 1351|      0|        for (i = 0; i < OSSL_NELEM(str_value_map); i++) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1351:21): [True: 0, False: 0]
  ------------------
 1352|      0|            if (strcmp(ctx->p2, str_value_map[i].ptr) == 0)
  ------------------
  |  Branch (1352:17): [True: 0, False: 0]
  ------------------
 1353|      0|                break;
 1354|      0|        }
 1355|       |
 1356|      0|        if (i == OSSL_NELEM(str_value_map)) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1356:13): [True: 0, False: 0]
  ------------------
 1357|      0|            ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
  ------------------
  |  |   74|      0|# define ERR_LIB_RSA             4
  ------------------
                          ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
  ------------------
  |  |   98|      0|# define RSA_R_UNKNOWN_PADDING_TYPE                       118
  ------------------
 1358|      0|                           "[action:%d, state:%d] padding name %s",
 1359|      0|                           ctx->action_type, state, ctx->p1);
 1360|      0|            ctx->p1 = ret = -2;
 1361|      0|        } else if (state == POST_CTRL_TO_PARAMS) {
  ------------------
  |  Branch (1361:20): [True: 0, False: 0]
  ------------------
 1362|       |            /* EVP_PKEY_CTRL_GET_RSA_PADDING weirdness explained further up */
 1363|      0|            *(int *)ctx->orig_p2 = str_value_map[i].id;
 1364|      0|        } else {
 1365|      0|            ctx->p1 = str_value_map[i].id;
 1366|      0|        }
 1367|      0|        ctx->p2 = NULL;
 1368|      0|    }
 1369|       |
 1370|    498|    return ret;
 1371|    498|}
ctrl_params_translate.c:fix_rsa_pss_saltlen:
 1377|    996|{
 1378|    996|    static const OSSL_ITEM str_value_map[] = {
 1379|    996|        { (unsigned int)RSA_PSS_SALTLEN_DIGEST, "digest" },
  ------------------
  |  |  138|    996|# define RSA_PSS_SALTLEN_DIGEST -1
  ------------------
 1380|    996|        { (unsigned int)RSA_PSS_SALTLEN_MAX,    "max"    },
  ------------------
  |  |  142|    996|# define RSA_PSS_SALTLEN_MAX    -3
  ------------------
 1381|    996|        { (unsigned int)RSA_PSS_SALTLEN_AUTO,   "auto"   }
  ------------------
  |  |  140|    996|# define RSA_PSS_SALTLEN_AUTO   -2
  ------------------
 1382|    996|    };
 1383|    996|    int ret;
 1384|       |
 1385|    996|    if ((ret = default_check(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (1385:9): [True: 0, False: 996]
  ------------------
 1386|      0|        return ret;
 1387|       |
 1388|    996|    if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == OSSL_ACTION_GET) {
  ------------------
  |  Branch (1388:9): [True: 498, False: 498]
  |  Branch (1388:40): [True: 0, False: 498]
  ------------------
 1389|       |        /*
 1390|       |         * EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN returns the saltlen by filling
 1391|       |         * in the int pointed at by p2.  This is potentially as weird as
 1392|       |         * the way EVP_PKEY_CTRL_GET_RSA_PADDING works, except that saltlen
 1393|       |         * might be a negative value, so it wouldn't work as a legitimate
 1394|       |         * return value.
 1395|       |         * In any case, we must therefore remember |ctx->p2|, then make
 1396|       |         * |ctx->p2| point at a buffer to be filled in with the name, and
 1397|       |         * |ctx->p1| with its size.  default_fixup_args() will take care
 1398|       |         * of the rest for us, along with the POST_CTRL_TO_PARAMS && OSSL_ACTION_GET
 1399|       |         * code section further down.
 1400|       |         */
 1401|      0|        ctx->orig_p2 = ctx->p2;
 1402|      0|        ctx->p2 = ctx->name_buf;
 1403|      0|        ctx->p1 = sizeof(ctx->name_buf);
 1404|    996|    } else if ((ctx->action_type == OSSL_ACTION_SET && state == PRE_CTRL_TO_PARAMS)
  ------------------
  |  Branch (1404:17): [True: 996, False: 0]
  |  Branch (1404:56): [True: 498, False: 498]
  ------------------
 1405|    996|               || (ctx->action_type == OSSL_ACTION_GET && state == POST_PARAMS_TO_CTRL)) {
  ------------------
  |  Branch (1405:20): [True: 0, False: 498]
  |  Branch (1405:59): [True: 0, False: 0]
  ------------------
 1406|    498|        size_t i;
 1407|       |
 1408|  1.99k|        for (i = 0; i < OSSL_NELEM(str_value_map); i++) {
  ------------------
  |  |   14|  1.99k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1408:21): [True: 1.49k, False: 498]
  ------------------
 1409|  1.49k|            if (ctx->p1 == (int)str_value_map[i].id)
  ------------------
  |  Branch (1409:17): [True: 0, False: 1.49k]
  ------------------
 1410|      0|                break;
 1411|  1.49k|        }
 1412|    498|        if (i == OSSL_NELEM(str_value_map)) {
  ------------------
  |  |   14|    498|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1412:13): [True: 498, False: 0]
  ------------------
 1413|    498|            BIO_snprintf(ctx->name_buf, sizeof(ctx->name_buf), "%d", ctx->p1);
 1414|    498|        } else {
 1415|       |            /* This won't truncate but it will quiet static analysers */
 1416|      0|            strncpy(ctx->name_buf, str_value_map[i].ptr, sizeof(ctx->name_buf) - 1);
 1417|      0|            ctx->name_buf[sizeof(ctx->name_buf) - 1] = '\0';
 1418|      0|        }
 1419|    498|        ctx->p2 = ctx->name_buf;
 1420|    498|        ctx->p1 = strlen(ctx->p2);
 1421|    498|    }
 1422|       |
 1423|    996|    if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
  ------------------
  |  Branch (1423:9): [True: 0, False: 996]
  ------------------
 1424|      0|        return ret;
 1425|       |
 1426|    996|    if ((ctx->action_type == OSSL_ACTION_SET && state == PRE_PARAMS_TO_CTRL)
  ------------------
  |  Branch (1426:10): [True: 996, False: 0]
  |  Branch (1426:49): [True: 0, False: 996]
  ------------------
 1427|    996|        || (ctx->action_type == OSSL_ACTION_GET && state == POST_CTRL_TO_PARAMS)) {
  ------------------
  |  Branch (1427:13): [True: 0, False: 996]
  |  Branch (1427:52): [True: 0, False: 0]
  ------------------
 1428|      0|        size_t i;
 1429|      0|        int val;
 1430|       |
 1431|      0|        for (i = 0; i < OSSL_NELEM(str_value_map); i++) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1431:21): [True: 0, False: 0]
  ------------------
 1432|      0|            if (strcmp(ctx->p2, str_value_map[i].ptr) == 0)
  ------------------
  |  Branch (1432:17): [True: 0, False: 0]
  ------------------
 1433|      0|                break;
 1434|      0|        }
 1435|       |
 1436|      0|        val = i == OSSL_NELEM(str_value_map) ? atoi(ctx->p2)
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1436:15): [True: 0, False: 0]
  ------------------
 1437|      0|                                             : (int)str_value_map[i].id;
 1438|      0|        if (state == POST_CTRL_TO_PARAMS) {
  ------------------
  |  Branch (1438:13): [True: 0, False: 0]
  ------------------
 1439|       |            /*
 1440|       |             * EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN weirdness explained further
 1441|       |             * up
 1442|       |             */
 1443|      0|            *(int *)ctx->orig_p2 = val;
 1444|      0|        } else {
 1445|      0|            ctx->p1 = val;
 1446|      0|        }
 1447|      0|        ctx->p2 = NULL;
 1448|      0|    }
 1449|       |
 1450|    996|    return ret;
 1451|    996|}
ctrl_params_translate.c:cleanup_translation_ctx:
  714|  1.49k|{
  715|  1.49k|    if (ctx->allocated_buf != NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 1.49k]
  ------------------
  716|      0|        OPENSSL_free(ctx->allocated_buf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  717|  1.49k|    ctx->allocated_buf = NULL;
  718|  1.49k|    return 1;
  719|  1.49k|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EVP_CIPHER_CTX_reset:
   34|      1|{
   35|      1|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1]
  ------------------
   36|      0|        return 1;
   37|       |
   38|      1|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 1, False: 0]
  |  Branch (38:32): [True: 0, False: 0]
  ------------------
   39|      1|        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| legacy:
   55|       |
   56|      1|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   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|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      1|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|      1|    ENGINE_finish(ctx->engine);
   66|      1|#endif
   67|      1|    memset(ctx, 0, sizeof(*ctx));
   68|      1|    ctx->iv_len = -1;
   69|      1|    return 1;
   70|      1|}
EVP_CIPHER_CTX_new:
   73|      1|{
   74|      1|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|      1|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      1|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|      1|    ctx->iv_len = -1;
   81|      1|    return ctx;
   82|      1|}
EVP_CIPHER_CTX_free:
   85|      1|{
   86|      1|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 1]
  ------------------
   87|      0|        return;
   88|      1|    EVP_CIPHER_CTX_reset(ctx);
   89|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|      1|}

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

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

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

EVP_PBE_find_ex:
  253|    113|{
  254|    113|    EVP_PBE_CTL *pbetmp = NULL, pbelu;
  255|    113|    int i;
  256|    113|    if (pbe_nid == NID_undef)
  ------------------
  |  |   18|    113|#define NID_undef                       0
  ------------------
  |  Branch (256:9): [True: 29, False: 84]
  ------------------
  257|     29|        return 0;
  258|       |
  259|     84|    pbelu.pbe_type = type;
  260|     84|    pbelu.pbe_nid = pbe_nid;
  261|       |
  262|     84|    if (pbe_algs != NULL) {
  ------------------
  |  Branch (262:9): [True: 0, False: 84]
  ------------------
  263|       |        /* Ideally, this would be done under lock */
  264|      0|        sk_EVP_PBE_CTL_sort(pbe_algs);
  265|      0|        i = sk_EVP_PBE_CTL_find(pbe_algs, &pbelu);
  266|      0|        pbetmp = sk_EVP_PBE_CTL_value(pbe_algs, i);
  267|      0|    }
  268|     84|    if (pbetmp == NULL) {
  ------------------
  |  Branch (268:9): [True: 84, False: 0]
  ------------------
  269|     84|        pbetmp = OBJ_bsearch_pbe2(&pbelu, builtin_pbe, OSSL_NELEM(builtin_pbe));
  ------------------
  |  |   14|     84|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  270|     84|    }
  271|     84|    if (pbetmp == NULL)
  ------------------
  |  Branch (271:9): [True: 16, False: 68]
  ------------------
  272|     16|        return 0;
  273|     68|    if (pcnid != NULL)
  ------------------
  |  Branch (273:9): [True: 0, False: 68]
  ------------------
  274|      0|        *pcnid = pbetmp->cipher_nid;
  275|     68|    if (pmnid != NULL)
  ------------------
  |  Branch (275:9): [True: 68, False: 0]
  ------------------
  276|     68|        *pmnid = pbetmp->md_nid;
  277|     68|    if (pkeygen != NULL)
  ------------------
  |  Branch (277:9): [True: 0, False: 68]
  ------------------
  278|      0|        *pkeygen = pbetmp->keygen;
  279|     68|    if (pkeygen_ex != NULL)
  ------------------
  |  Branch (279:9): [True: 0, False: 68]
  ------------------
  280|      0|        *pkeygen_ex = pbetmp->keygen_ex;
  281|     68|    return 1;
  282|     84|}
EVP_PBE_find:
  286|    113|{
  287|    113|    return EVP_PBE_find_ex(type, pbe_nid, pcnid, pmnid, pkeygen, NULL);
  288|    113|}
EVP_PBE_cleanup:
  296|      2|{
  297|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  298|      2|    pbe_algs = NULL;
  299|      2|}
evp_pbe.c:pbe2_cmp:
  179|    401|{
  180|    401|    int ret = pbe1->pbe_type - pbe2->pbe_type;
  181|    401|    if (ret)
  ------------------
  |  Branch (181:9): [True: 107, False: 294]
  ------------------
  182|    107|        return ret;
  183|    294|    else
  184|    294|        return pbe1->pbe_nid - pbe2->pbe_nid;
  185|    401|}

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

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|  19.2k|{
   63|  19.2k|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 19.2k]
  |  Branch (63:25): [True: 0, False: 19.2k]
  |  Branch (63:44): [True: 0, False: 19.2k]
  ------------------
   64|  19.2k|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 19.2k]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|  19.2k|    pkey->keydata = keydata;
   69|  19.2k|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|  19.2k|    return 1;
   71|  19.2k|}
evp_keymgmt_util_make_pkey:
   74|  19.2k|{
   75|  19.2k|    EVP_PKEY *pkey = NULL;
   76|       |
   77|  19.2k|    if (keymgmt == NULL
  ------------------
  |  Branch (77:9): [True: 0, False: 19.2k]
  ------------------
   78|  19.2k|        || keydata == NULL
  ------------------
  |  Branch (78:12): [True: 0, False: 19.2k]
  ------------------
   79|  19.2k|        || (pkey = EVP_PKEY_new()) == NULL
  ------------------
  |  Branch (79:12): [True: 0, False: 19.2k]
  ------------------
   80|  19.2k|        || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) {
  ------------------
  |  Branch (80:12): [True: 0, False: 19.2k]
  ------------------
   81|      0|        EVP_PKEY_free(pkey);
   82|      0|        return NULL;
   83|      0|    }
   84|  19.2k|    return pkey;
   85|  19.2k|}
evp_keymgmt_util_export_to_provider:
   98|    982|{
   99|    982|    struct evp_keymgmt_util_try_import_data_st import_data;
  100|    982|    OP_CACHE_ELEM *op;
  101|       |
  102|       |    /* Export to where? */
  103|    982|    if (keymgmt == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 982]
  ------------------
  104|      0|        return NULL;
  105|       |
  106|       |    /* If we have an unassigned key, give up */
  107|    982|    if (pk->keydata == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 982]
  ------------------
  108|      0|        return NULL;
  109|       |
  110|       |    /*
  111|       |     * If |keymgmt| matches the "origin" |keymgmt|, there is no more to do.
  112|       |     * The "origin" is determined by the |keymgmt| pointers being identical
  113|       |     * or when the provider and the name ID match.  The latter case handles the
  114|       |     * situation where the fetch cache is flushed and a "new" key manager is
  115|       |     * created.
  116|       |     */
  117|    982|    if (pk->keymgmt == keymgmt
  ------------------
  |  Branch (117:9): [True: 982, False: 0]
  ------------------
  118|    982|        || (pk->keymgmt->name_id == keymgmt->name_id
  ------------------
  |  Branch (118:13): [True: 0, False: 0]
  ------------------
  119|      0|            && pk->keymgmt->prov == keymgmt->prov))
  ------------------
  |  Branch (119:16): [True: 0, False: 0]
  ------------------
  120|    982|        return pk->keydata;
  121|       |
  122|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (122:9): [True: 0, False: 0]
  ------------------
  123|      0|        return NULL;
  124|       |    /*
  125|       |     * If the provider native "origin" hasn't changed since last time, we
  126|       |     * try to find our keymgmt in the operation cache.  If it has changed
  127|       |     * and our keymgmt isn't found, we will clear the cache further down.
  128|       |     */
  129|      0|    if (pk->dirty_cnt == pk->dirty_cnt_copy) {
  ------------------
  |  Branch (129:9): [True: 0, False: 0]
  ------------------
  130|       |        /* If this key is already exported to |keymgmt|, no more to do */
  131|      0|        op = evp_keymgmt_util_find_operation_cache(pk, keymgmt, selection);
  132|      0|        if (op != NULL && op->keymgmt != NULL) {
  ------------------
  |  Branch (132:13): [True: 0, False: 0]
  |  Branch (132:27): [True: 0, False: 0]
  ------------------
  133|      0|            void *ret = op->keydata;
  134|       |
  135|      0|            CRYPTO_THREAD_unlock(pk->lock);
  136|      0|            return ret;
  137|      0|        }
  138|      0|    }
  139|      0|    CRYPTO_THREAD_unlock(pk->lock);
  140|       |
  141|       |    /* If the "origin" |keymgmt| doesn't support exporting, give up */
  142|      0|    if (pk->keymgmt->export == NULL)
  ------------------
  |  Branch (142:9): [True: 0, False: 0]
  ------------------
  143|      0|        return NULL;
  144|       |
  145|       |    /*
  146|       |     * Make sure that the type of the keymgmt to export to matches the type
  147|       |     * of the "origin"
  148|       |     */
  149|      0|    if (!ossl_assert(match_type(pk->keymgmt, keymgmt)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 0]
  ------------------
  150|      0|        return NULL;
  151|       |
  152|       |    /*
  153|       |     * We look at the already cached provider keys, and import from the
  154|       |     * first that supports it (i.e. use its export function), and export
  155|       |     * the imported data to the new provider.
  156|       |     */
  157|       |
  158|       |    /* Setup for the export callback */
  159|      0|    import_data.keydata = NULL;  /* evp_keymgmt_util_try_import will create it */
  160|      0|    import_data.keymgmt = keymgmt;
  161|      0|    import_data.selection = selection;
  162|       |
  163|       |    /*
  164|       |     * The export function calls the callback (evp_keymgmt_util_try_import),
  165|       |     * which does the import for us.  If successful, we're done.
  166|       |     */
  167|      0|    if (!evp_keymgmt_util_export(pk, selection,
  ------------------
  |  Branch (167:9): [True: 0, False: 0]
  ------------------
  168|      0|                                 &evp_keymgmt_util_try_import, &import_data))
  169|       |        /* If there was an error, bail out */
  170|      0|        return NULL;
  171|       |
  172|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock)) {
  ------------------
  |  Branch (172:9): [True: 0, False: 0]
  ------------------
  173|      0|        evp_keymgmt_freedata(keymgmt, import_data.keydata);
  174|      0|        return NULL;
  175|      0|    }
  176|       |    /* Check to make sure some other thread didn't get there first */
  177|      0|    op = evp_keymgmt_util_find_operation_cache(pk, keymgmt, selection);
  178|      0|    if (op != NULL && op->keydata != NULL) {
  ------------------
  |  Branch (178:9): [True: 0, False: 0]
  |  Branch (178:23): [True: 0, False: 0]
  ------------------
  179|      0|        void *ret = op->keydata;
  180|       |
  181|      0|        CRYPTO_THREAD_unlock(pk->lock);
  182|       |
  183|       |        /*
  184|       |         * Another thread seemms to have already exported this so we abandon
  185|       |         * all the work we just did.
  186|       |         */
  187|      0|        evp_keymgmt_freedata(keymgmt, import_data.keydata);
  188|       |
  189|      0|        return ret;
  190|      0|    }
  191|       |
  192|       |    /*
  193|       |     * If the dirty counter changed since last time, then clear the
  194|       |     * operation cache.  In that case, we know that |i| is zero.
  195|       |     */
  196|      0|    if (pk->dirty_cnt != pk->dirty_cnt_copy)
  ------------------
  |  Branch (196:9): [True: 0, False: 0]
  ------------------
  197|      0|        evp_keymgmt_util_clear_operation_cache(pk);
  198|       |
  199|       |    /* Add the new export to the operation cache */
  200|      0|    if (!evp_keymgmt_util_cache_keydata(pk, keymgmt, import_data.keydata,
  ------------------
  |  Branch (200:9): [True: 0, False: 0]
  ------------------
  201|      0|                                        selection)) {
  202|      0|        CRYPTO_THREAD_unlock(pk->lock);
  203|      0|        evp_keymgmt_freedata(keymgmt, import_data.keydata);
  204|      0|        return NULL;
  205|      0|    }
  206|       |
  207|       |    /* Synchronize the dirty count */
  208|      0|    pk->dirty_cnt_copy = pk->dirty_cnt;
  209|       |
  210|      0|    CRYPTO_THREAD_unlock(pk->lock);
  211|       |
  212|      0|    return import_data.keydata;
  213|      0|}
evp_keymgmt_util_clear_operation_cache:
  223|  69.7k|{
  224|  69.7k|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 69.7k, False: 0]
  ------------------
  225|  69.7k|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|  69.7k|        pk->operation_cache = NULL;
  227|  69.7k|    }
  228|       |
  229|  69.7k|    return 1;
  230|  69.7k|}
evp_keymgmt_util_cache_keyinfo:
  290|  19.2k|{
  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|  19.2k|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 19.2k, False: 0]
  ------------------
  297|  19.2k|        int bits = 0;
  298|  19.2k|        int security_bits = 0;
  299|  19.2k|        int security_category = -1;
  300|  19.2k|        int size = 0;
  301|  19.2k|        OSSL_PARAM params[5];
  302|       |
  303|  19.2k|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  360|  19.2k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  304|  19.2k|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  487|  19.2k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  305|  19.2k|                                             &security_bits);
  306|  19.2k|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_CATEGORY,
  ------------------
  |  |  488|  19.2k|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|  19.2k|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  307|  19.2k|                                             &security_category);
  308|  19.2k|        params[3] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  416|  19.2k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  309|  19.2k|        params[4] = OSSL_PARAM_construct_end();
  310|  19.2k|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (310:13): [True: 19.2k, False: 0]
  ------------------
  311|  19.2k|            pk->cache.size = size;
  312|  19.2k|            pk->cache.bits = bits;
  313|  19.2k|            pk->cache.security_bits = security_bits;
  314|  19.2k|            pk->cache.security_category = security_category;
  315|  19.2k|        }
  316|  19.2k|    }
  317|  19.2k|}
evp_keymgmt_util_get_deflt_digest_name:
  540|      1|{
  541|      1|    OSSL_PARAM params[3];
  542|      1|    char mddefault[100] = "";
  543|      1|    char mdmandatory[100] = "";
  544|      1|    char *result = NULL;
  545|      1|    int rv = -2;
  546|       |
  547|      1|    params[0] =
  548|      1|        OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST,
  ------------------
  |  |  362|      1|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  549|      1|                                         mddefault, sizeof(mddefault));
  550|      1|    params[1] =
  551|      1|        OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST,
  ------------------
  |  |  414|      1|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  552|      1|                                         mdmandatory,
  553|      1|                                         sizeof(mdmandatory));
  554|      1|    params[2] = OSSL_PARAM_construct_end();
  555|       |
  556|      1|    if (!evp_keymgmt_get_params(keymgmt, keydata, params))
  ------------------
  |  Branch (556:9): [True: 0, False: 1]
  ------------------
  557|      0|        return 0;
  558|       |
  559|      1|    if (OSSL_PARAM_modified(params + 1)) {
  ------------------
  |  Branch (559:9): [True: 0, False: 1]
  ------------------
  560|      0|        if (params[1].return_size <= 1) /* Only a NUL byte */
  ------------------
  |  Branch (560:13): [True: 0, False: 0]
  ------------------
  561|      0|            result = SN_undef;
  ------------------
  |  |   16|      0|#define SN_undef                        "UNDEF"
  ------------------
  562|      0|        else
  563|      0|            result = mdmandatory;
  564|      0|        rv = 2;
  565|      1|    } else if (OSSL_PARAM_modified(params)) {
  ------------------
  |  Branch (565:16): [True: 1, False: 0]
  ------------------
  566|      1|        if (params[0].return_size <= 1) /* Only a NUL byte */
  ------------------
  |  Branch (566:13): [True: 0, False: 1]
  ------------------
  567|      0|            result = SN_undef;
  ------------------
  |  |   16|      0|#define SN_undef                        "UNDEF"
  ------------------
  568|      1|        else
  569|      1|            result = mddefault;
  570|      1|        rv = 1;
  571|      1|    }
  572|      1|    if (rv > 0)
  ------------------
  |  Branch (572:9): [True: 1, False: 0]
  ------------------
  573|      1|        OPENSSL_strlcpy(mdname, result, mdname_sz);
  574|      1|    return rv;
  575|      1|}
evp_keymgmt_util_query_operation_name:
  584|    982|{
  585|    982|    const char *name = NULL;
  586|       |
  587|    982|    if (keymgmt != NULL) {
  ------------------
  |  Branch (587:9): [True: 982, False: 0]
  ------------------
  588|    982|        if (keymgmt->query_operation_name != NULL)
  ------------------
  |  Branch (588:13): [True: 199, False: 783]
  ------------------
  589|    199|            name = keymgmt->query_operation_name(op_id);
  590|    982|        if (name == NULL)
  ------------------
  |  Branch (590:13): [True: 783, False: 199]
  ------------------
  591|    783|            name = EVP_KEYMGMT_get0_name(keymgmt);
  592|    982|    }
  593|    982|    return name;
  594|    982|}

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

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

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

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

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

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

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

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

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

EVP_DigestVerifyInit:
  398|    982|{
  399|    982|    return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, e, pkey, 1,
  400|    982|                          NULL);
  401|    982|}
EVP_DigestVerifyUpdate:
  448|    965|{
  449|    965|    EVP_SIGNATURE *signature;
  450|    965|    const char *desc;
  451|    965|    EVP_PKEY_CTX *pctx = ctx->pctx;
  452|    965|    int ret;
  453|       |
  454|    965|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|    965|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (454:9): [True: 0, False: 965]
  ------------------
  455|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  456|      0|        return 0;
  457|      0|    }
  458|       |
  459|    965|    if (pctx == NULL
  ------------------
  |  Branch (459:9): [True: 0, False: 965]
  ------------------
  460|    965|            || pctx->operation != EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|  1.93k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (460:16): [True: 0, False: 965]
  ------------------
  461|    965|            || pctx->op.sig.algctx == NULL
  ------------------
  |  Branch (461:16): [True: 0, False: 965]
  ------------------
  462|    965|            || pctx->op.sig.signature == NULL)
  ------------------
  |  Branch (462:16): [True: 0, False: 965]
  ------------------
  463|      0|        goto legacy;
  464|       |
  465|    965|    signature = pctx->op.sig.signature;
  466|    965|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (466:12): [True: 0, False: 965]
  ------------------
  467|    965|    if (signature->digest_verify_update == NULL) {
  ------------------
  |  Branch (467:9): [True: 0, False: 965]
  ------------------
  468|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  469|      0|                       "%s digest_verify_update:%s", signature->type_name, desc);
  470|      0|        return 0;
  471|      0|    }
  472|       |
  473|    965|    ret = signature->digest_verify_update(pctx->op.sig.algctx, data, dsize);
  474|    965|    if (ret <= 0)
  ------------------
  |  Branch (474:9): [True: 0, False: 965]
  ------------------
  475|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  111|      0|# define EVP_R_PROVIDER_SIGNATURE_FAILURE                 234
  ------------------
  476|      0|                       "%s digest_verify_update:%s", signature->type_name, desc);
  477|    965|    return ret;
  478|       |
  479|      0| legacy:
  480|      0|    if (pctx != NULL) {
  ------------------
  |  Branch (480:9): [True: 0, False: 0]
  ------------------
  481|       |        /* do_sigver_init() checked that |digest_custom| is non-NULL */
  482|      0|        if (pctx->flag_call_digest_custom
  ------------------
  |  Branch (482:13): [True: 0, False: 0]
  ------------------
  483|      0|            && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx))
  ------------------
  |  Branch (483:16): [True: 0, False: 0]
  ------------------
  484|      0|            return 0;
  485|      0|        pctx->flag_call_digest_custom = 0;
  486|      0|    }
  487|       |
  488|      0|    return EVP_DigestUpdate(ctx, data, dsize);
  489|      0|}
EVP_DigestVerifyFinal:
  657|    965|{
  658|    965|    EVP_SIGNATURE *signature;
  659|    965|    const char *desc;
  660|    965|    int vctx = 0;
  661|    965|    unsigned int mdlen = 0;
  662|    965|    unsigned char md[EVP_MAX_MD_SIZE];
  663|    965|    int r = 0;
  664|    965|    EVP_PKEY_CTX *dctx = NULL, *pctx = ctx->pctx;
  665|       |
  666|    965|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|    965|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (666:9): [True: 0, False: 965]
  ------------------
  667|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return 0;
  669|      0|    }
  670|       |
  671|    965|    if (pctx == NULL
  ------------------
  |  Branch (671:9): [True: 0, False: 965]
  ------------------
  672|    965|            || pctx->operation != EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|  1.93k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (672:16): [True: 0, False: 965]
  ------------------
  673|    965|            || pctx->op.sig.algctx == NULL
  ------------------
  |  Branch (673:16): [True: 0, False: 965]
  ------------------
  674|    965|            || pctx->op.sig.signature == NULL)
  ------------------
  |  Branch (674:16): [True: 0, False: 965]
  ------------------
  675|      0|        goto legacy;
  676|       |
  677|    965|    signature = pctx->op.sig.signature;
  678|    965|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (678:12): [True: 0, False: 965]
  ------------------
  679|    965|    if (signature->digest_verify_final == NULL) {
  ------------------
  |  Branch (679:9): [True: 0, False: 965]
  ------------------
  680|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  681|      0|                       "%s digest_verify_final:%s", signature->type_name, desc);
  682|      0|        return 0;
  683|      0|    }
  684|       |
  685|    965|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISE) == 0) {
  ------------------
  |  |  251|    965|# define EVP_MD_CTX_FLAG_FINALISE        0x0200
  ------------------
  |  Branch (685:9): [True: 965, False: 0]
  ------------------
  686|       |        /* try dup */
  687|    965|        dctx = EVP_PKEY_CTX_dup(pctx);
  688|    965|        if (dctx != NULL)
  ------------------
  |  Branch (688:13): [True: 965, False: 0]
  ------------------
  689|    965|            pctx = dctx;
  690|    965|    }
  691|       |
  692|    965|    r = signature->digest_verify_final(pctx->op.sig.algctx, sig, siglen);
  693|    965|    if (!r)
  ------------------
  |  Branch (693:9): [True: 858, False: 107]
  ------------------
  694|    858|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  403|    858|    (ERR_new(),                                                 \
  |  |  404|    858|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|    858|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|    858|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|    858|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|    858|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |   76|    858|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  111|    858|# define EVP_R_PROVIDER_SIGNATURE_FAILURE                 234
  ------------------
  695|    858|                       "%s digest_verify_final:%s", signature->type_name, desc);
  696|    965|    if (dctx == NULL)
  ------------------
  |  Branch (696:9): [True: 0, False: 965]
  ------------------
  697|      0|        ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|      0|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  698|    965|    else
  699|    965|        EVP_PKEY_CTX_free(dctx);
  700|    965|    return r;
  701|       |
  702|      0| legacy:
  703|      0|    if (pctx == NULL || pctx->pmeth == NULL) {
  ------------------
  |  Branch (703:9): [True: 0, False: 0]
  |  Branch (703:25): [True: 0, False: 0]
  ------------------
  704|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  705|      0|        return 0;
  706|      0|    }
  707|       |
  708|       |    /* do_sigver_init() checked that |digest_custom| is non-NULL */
  709|      0|    if (pctx->flag_call_digest_custom
  ------------------
  |  Branch (709:9): [True: 0, False: 0]
  ------------------
  710|      0|        && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx))
  ------------------
  |  Branch (710:12): [True: 0, False: 0]
  ------------------
  711|      0|        return 0;
  712|      0|    pctx->flag_call_digest_custom = 0;
  713|       |
  714|      0|    if (pctx->pmeth->verifyctx != NULL)
  ------------------
  |  Branch (714:9): [True: 0, False: 0]
  ------------------
  715|      0|        vctx = 1;
  716|      0|    else
  717|      0|        vctx = 0;
  718|      0|    if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
  ------------------
  |  |  251|      0|# define EVP_MD_CTX_FLAG_FINALISE        0x0200
  ------------------
  |  Branch (718:9): [True: 0, False: 0]
  ------------------
  719|      0|        if (vctx) {
  ------------------
  |  Branch (719:13): [True: 0, False: 0]
  ------------------
  720|      0|            r = pctx->pmeth->verifyctx(pctx, sig, siglen, ctx);
  721|      0|            ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|      0|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  722|      0|        } else
  723|      0|            r = EVP_DigestFinal_ex(ctx, md, &mdlen);
  724|      0|    } else {
  725|      0|        EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
  726|      0|        if (tmp_ctx == NULL)
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  ------------------
  727|      0|            return -1;
  728|      0|        if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {
  ------------------
  |  Branch (728:13): [True: 0, False: 0]
  ------------------
  729|      0|            EVP_MD_CTX_free(tmp_ctx);
  730|      0|            return -1;
  731|      0|        }
  732|      0|        if (vctx)
  ------------------
  |  Branch (732:13): [True: 0, False: 0]
  ------------------
  733|      0|            r = tmp_ctx->pctx->pmeth->verifyctx(tmp_ctx->pctx,
  734|      0|                                                sig, siglen, tmp_ctx);
  735|      0|        else
  736|      0|            r = EVP_DigestFinal_ex(tmp_ctx, md, &mdlen);
  737|      0|        EVP_MD_CTX_free(tmp_ctx);
  738|      0|    }
  739|      0|    if (vctx || !r)
  ------------------
  |  Branch (739:9): [True: 0, False: 0]
  |  Branch (739:17): [True: 0, False: 0]
  ------------------
  740|      0|        return r;
  741|      0|    return EVP_PKEY_verify(pctx, sig, siglen, md, mdlen);
  742|      0|}
EVP_DigestVerify:
  746|    965|{
  747|    965|    EVP_PKEY_CTX *pctx = ctx->pctx;
  748|       |
  749|    965|    if (pctx == NULL) {
  ------------------
  |  Branch (749:9): [True: 0, False: 965]
  ------------------
  750|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  751|      0|        return -1;
  752|      0|    }
  753|       |
  754|    965|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|    965|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (754:9): [True: 0, False: 965]
  ------------------
  755|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  756|      0|        return 0;
  757|      0|    }
  758|       |
  759|    965|    if (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|  1.93k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (759:9): [True: 965, False: 0]
  ------------------
  760|    965|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (760:16): [True: 965, False: 0]
  ------------------
  761|    965|            && pctx->op.sig.signature != NULL) {
  ------------------
  |  Branch (761:16): [True: 965, False: 0]
  ------------------
  762|    965|        if (pctx->op.sig.signature->digest_verify != NULL) {
  ------------------
  |  Branch (762:13): [True: 0, False: 965]
  ------------------
  763|      0|            EVP_SIGNATURE *signature = pctx->op.sig.signature;
  764|      0|            const char *desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (764:32): [True: 0, False: 0]
  ------------------
  765|      0|            int ret;
  766|       |
  767|      0|            ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|      0|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  768|      0|            ret = signature->digest_verify(pctx->op.sig.algctx, sigret, siglen, tbs, tbslen);
  769|      0|            if (ret <= 0)
  ------------------
  |  Branch (769:17): [True: 0, False: 0]
  ------------------
  770|      0|                ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  111|      0|# define EVP_R_PROVIDER_SIGNATURE_FAILURE                 234
  ------------------
  771|      0|                               "%s digest_verify:%s", signature->type_name, desc);
  772|      0|            return ret;
  773|      0|        }
  774|    965|    } else {
  775|       |        /* legacy */
  776|      0|        if (pctx->pmeth != NULL && pctx->pmeth->digestverify != NULL)
  ------------------
  |  Branch (776:13): [True: 0, False: 0]
  |  Branch (776:36): [True: 0, False: 0]
  ------------------
  777|      0|            return pctx->pmeth->digestverify(ctx, sigret, siglen, tbs, tbslen);
  778|      0|    }
  779|    965|    if (EVP_DigestVerifyUpdate(ctx, tbs, tbslen) <= 0)
  ------------------
  |  Branch (779:9): [True: 0, False: 965]
  ------------------
  780|      0|        return -1;
  781|    965|    return EVP_DigestVerifyFinal(ctx, sigret, siglen);
  782|    965|}
m_sigver.c:do_sigver_init:
   42|    982|{
   43|    982|    EVP_PKEY_CTX *locpctx = NULL;
   44|    982|    EVP_SIGNATURE *signature = NULL;
   45|    982|    const char *desc;
   46|    982|    EVP_KEYMGMT *tmp_keymgmt = NULL;
   47|    982|    const OSSL_PROVIDER *tmp_prov = NULL;
   48|    982|    const char *supported_sig = NULL;
   49|    982|    char locmdname[80] = "";     /* 80 chars should be enough */
   50|    982|    void *provkey = NULL;
   51|    982|    int ret, iter, reinit = 1;
   52|       |
   53|    982|    if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (53:9): [True: 0, False: 982]
  ------------------
   54|      0|        return 0;
   55|       |
   56|    982|    if (ctx->pctx == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 982]
  ------------------
   57|      0|        reinit = 0;
   58|      0|        if (e == NULL)
  ------------------
  |  Branch (58:13): [True: 0, False: 0]
  ------------------
   59|      0|            ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props);
   60|      0|        else
   61|      0|            ctx->pctx = EVP_PKEY_CTX_new(pkey, e);
   62|      0|    }
   63|    982|    if (ctx->pctx == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 982]
  ------------------
   64|      0|        return 0;
   65|       |
   66|    982|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|    982|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
   67|       |
   68|    982|    locpctx = ctx->pctx;
   69|    982|    ERR_set_mark();
   70|       |
   71|    982|    if (evp_pkey_ctx_is_legacy(locpctx))
  ------------------
  |  |   36|    982|    ((ctx)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 982]
  |  |  ------------------
  ------------------
   72|      0|        goto legacy;
   73|       |
   74|       |    /* do not reinitialize if pkey is set or operation is different */
   75|    982|    if (reinit
  ------------------
  |  Branch (75:9): [True: 982, False: 0]
  ------------------
   76|    982|        && (pkey != NULL
  ------------------
  |  Branch (76:13): [True: 982, False: 0]
  ------------------
   77|    982|            || locpctx->operation != (ver ? EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (77:16): [True: 0, False: 0]
  |  Branch (77:39): [True: 0, False: 0]
  ------------------
   78|      0|                                          : EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
   79|    982|            || (signature = locpctx->op.sig.signature) == NULL
  ------------------
  |  Branch (79:16): [True: 0, False: 0]
  ------------------
   80|    982|            || locpctx->op.sig.algctx == NULL))
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|    982|        reinit = 0;
   82|       |
   83|    982|    if (props == NULL)
  ------------------
  |  Branch (83:9): [True: 982, False: 0]
  ------------------
   84|    982|        props = locpctx->propquery;
   85|       |
   86|    982|    if (locpctx->pkey == NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 982]
  ------------------
   87|      0|        ERR_clear_last_mark();
   88|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_KEY_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   89|      0|        goto err;
   90|      0|    }
   91|       |
   92|    982|    if (!reinit) {
  ------------------
  |  Branch (92:9): [True: 982, False: 0]
  ------------------
   93|    982|        evp_pkey_ctx_free_old_ops(locpctx);
   94|    982|    } else {
   95|      0|        if (mdname == NULL && type == NULL)
  ------------------
  |  Branch (95:13): [True: 0, False: 0]
  |  Branch (95:31): [True: 0, False: 0]
  ------------------
   96|      0|            mdname = canon_mdname(EVP_MD_get0_name(ctx->reqdigest));
   97|      0|        goto reinitialize;
   98|      0|    }
   99|       |
  100|       |    /*
  101|       |     * Try to derive the supported signature from |locpctx->keymgmt|.
  102|       |     */
  103|    982|    if (!ossl_assert(locpctx->pkey->keymgmt == NULL
  ------------------
  |  |   52|  1.96k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 982]
  |  |  |  Branch (52:43): [True: 982, False: 0]
  |  |  ------------------
  |  |   53|    982|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (103:9): [True: 0, False: 982]
  ------------------
  104|    982|                     || locpctx->pkey->keymgmt == locpctx->keymgmt)) {
  105|      0|        ERR_clear_last_mark();
  106|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|        goto err;
  108|      0|    }
  109|    982|    supported_sig = evp_keymgmt_util_query_operation_name(locpctx->keymgmt,
  110|    982|                                                          OSSL_OP_SIGNATURE);
  ------------------
  |  |  317|    982|# define OSSL_OP_SIGNATURE                          12
  ------------------
  111|    982|    if (supported_sig == NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 982]
  ------------------
  112|      0|        ERR_clear_last_mark();
  113|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  114|      0|        goto err;
  115|      0|    }
  116|       |
  117|       |    /*
  118|       |     * We perform two iterations:
  119|       |     *
  120|       |     * 1.  Do the normal signature fetch, using the fetching data given by
  121|       |     *     the EVP_PKEY_CTX.
  122|       |     * 2.  Do the provider specific signature fetch, from the same provider
  123|       |     *     as |ctx->keymgmt|
  124|       |     *
  125|       |     * We then try to fetch the keymgmt from the same provider as the
  126|       |     * signature, and try to export |ctx->pkey| to that keymgmt (when
  127|       |     * this keymgmt happens to be the same as |ctx->keymgmt|, the export
  128|       |     * is a no-op, but we call it anyway to not complicate the code even
  129|       |     * more).
  130|       |     * If the export call succeeds (returns a non-NULL provider key pointer),
  131|       |     * we're done and can perform the operation itself.  If not, we perform
  132|       |     * the second iteration, or jump to legacy.
  133|       |     */
  134|  1.96k|    for (iter = 1, provkey = NULL; iter < 3 && provkey == NULL; iter++) {
  ------------------
  |  Branch (134:36): [True: 1.96k, False: 0]
  |  Branch (134:48): [True: 982, False: 982]
  ------------------
  135|    982|        EVP_KEYMGMT *tmp_keymgmt_tofree = NULL;
  136|       |
  137|       |        /*
  138|       |         * If we're on the second iteration, free the results from the first.
  139|       |         * They are NULL on the first iteration, so no need to check what
  140|       |         * iteration we're on.
  141|       |         */
  142|    982|        EVP_SIGNATURE_free(signature);
  143|    982|        EVP_KEYMGMT_free(tmp_keymgmt);
  144|       |
  145|    982|        switch (iter) {
  ------------------
  |  Branch (145:17): [True: 0, False: 982]
  ------------------
  146|    982|        case 1:
  ------------------
  |  Branch (146:9): [True: 982, False: 0]
  ------------------
  147|    982|            signature = EVP_SIGNATURE_fetch(locpctx->libctx, supported_sig,
  148|    982|                                            locpctx->propquery);
  149|    982|            if (signature != NULL)
  ------------------
  |  Branch (149:17): [True: 982, False: 0]
  ------------------
  150|    982|                tmp_prov = EVP_SIGNATURE_get0_provider(signature);
  151|    982|            break;
  152|      0|        case 2:
  ------------------
  |  Branch (152:9): [True: 0, False: 982]
  ------------------
  153|      0|            tmp_prov = EVP_KEYMGMT_get0_provider(locpctx->keymgmt);
  154|      0|            signature =
  155|      0|                evp_signature_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  156|      0|                                              supported_sig, locpctx->propquery);
  157|      0|            if (signature == NULL)
  ------------------
  |  Branch (157:17): [True: 0, False: 0]
  ------------------
  158|      0|                goto legacy;
  159|      0|            break;
  160|    982|        }
  161|    982|        if (signature == NULL)
  ------------------
  |  Branch (161:13): [True: 0, False: 982]
  ------------------
  162|      0|            continue;
  163|       |
  164|       |        /*
  165|       |         * Ensure that the key is provided, either natively, or as a cached
  166|       |         * export.  We start by fetching the keymgmt with the same name as
  167|       |         * |locpctx->pkey|, but from the provider of the signature method, using
  168|       |         * the same property query as when fetching the signature method.
  169|       |         * With the keymgmt we found (if we did), we try to export |locpctx->pkey|
  170|       |         * to it (evp_pkey_export_to_provider() is smart enough to only actually
  171|       |
  172|       |         * export it if |tmp_keymgmt| is different from |locpctx->pkey|'s keymgmt)
  173|       |         */
  174|    982|        tmp_keymgmt_tofree = tmp_keymgmt =
  175|    982|            evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  176|    982|                                        EVP_KEYMGMT_get0_name(locpctx->keymgmt),
  177|    982|                                        locpctx->propquery);
  178|    982|        if (tmp_keymgmt != NULL)
  ------------------
  |  Branch (178:13): [True: 982, False: 0]
  ------------------
  179|    982|            provkey = evp_pkey_export_to_provider(locpctx->pkey, locpctx->libctx,
  180|    982|                                                  &tmp_keymgmt, locpctx->propquery);
  181|    982|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (181:13): [True: 0, False: 982]
  ------------------
  182|      0|            EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  183|    982|    }
  184|       |
  185|    982|    if (provkey == NULL) {
  ------------------
  |  Branch (185:9): [True: 0, False: 982]
  ------------------
  186|      0|        EVP_SIGNATURE_free(signature);
  187|      0|        ERR_clear_last_mark();
  188|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  189|      0|        goto err;
  190|      0|    }
  191|       |
  192|    982|    ERR_pop_to_mark();
  193|       |
  194|       |    /* No more legacy from here down to legacy: */
  195|       |
  196|    982|    locpctx->op.sig.signature = signature;
  197|    982|    locpctx->operation = ver ? EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|    982|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (197:26): [True: 982, False: 0]
  ------------------
  198|    982|                             : EVP_PKEY_OP_SIGNCTX;
  ------------------
  |  | 1751|    982|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  199|    982|    locpctx->op.sig.algctx
  200|    982|        = signature->newctx(ossl_provider_ctx(signature->prov), props);
  201|    982|    if (locpctx->op.sig.algctx == NULL) {
  ------------------
  |  Branch (201:9): [True: 0, False: 982]
  ------------------
  202|      0|        ERR_raise(ERR_LIB_EVP,  EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  203|      0|        goto err;
  204|      0|    }
  205|       |
  206|    982| reinitialize:
  207|    982|    if (pctx != NULL)
  ------------------
  |  Branch (207:9): [True: 501, False: 481]
  ------------------
  208|    501|        *pctx = locpctx;
  209|       |
  210|    982|    if (type != NULL) {
  ------------------
  |  Branch (210:9): [True: 981, False: 1]
  ------------------
  211|    981|        ctx->reqdigest = type;
  212|    981|        if (mdname == NULL)
  ------------------
  |  Branch (212:13): [True: 981, False: 0]
  ------------------
  213|    981|            mdname = canon_mdname(EVP_MD_get0_name(type));
  214|    981|    } else {
  215|      1|        if (mdname == NULL && !reinit) {
  ------------------
  |  Branch (215:13): [True: 1, False: 0]
  |  Branch (215:31): [True: 1, False: 0]
  ------------------
  216|      1|            if (evp_keymgmt_util_get_deflt_digest_name(tmp_keymgmt, provkey,
  ------------------
  |  Branch (216:17): [True: 1, False: 0]
  ------------------
  217|      1|                                                       locmdname,
  218|      1|                                                       sizeof(locmdname)) > 0) {
  219|      1|                mdname = canon_mdname(locmdname);
  220|      1|            }
  221|      1|        }
  222|       |
  223|      1|        if (mdname != NULL) {
  ------------------
  |  Branch (223:13): [True: 1, False: 0]
  ------------------
  224|       |            /*
  225|       |             * We're about to get a new digest so clear anything associated with
  226|       |             * an old digest.
  227|       |             */
  228|      1|            evp_md_ctx_clear_digest(ctx, 1, 0);
  229|       |
  230|       |            /* legacy code support for engines */
  231|      1|            ERR_set_mark();
  232|       |            /*
  233|       |             * This might be requested by a later call to EVP_MD_CTX_get0_md().
  234|       |             * In that case the "explicit fetch" rules apply for that
  235|       |             * function (as per man pages), i.e. the ref count is not updated
  236|       |             * so the EVP_MD should not be used beyond the lifetime of the
  237|       |             * EVP_MD_CTX.
  238|       |             */
  239|      1|            ctx->fetched_digest = EVP_MD_fetch(locpctx->libctx, mdname, props);
  240|      1|            if (ctx->fetched_digest != NULL) {
  ------------------
  |  Branch (240:17): [True: 1, False: 0]
  ------------------
  241|      1|                ctx->digest = ctx->reqdigest = ctx->fetched_digest;
  242|      1|            } else {
  243|       |                /* legacy engine support : remove the mark when this is deleted */
  244|      0|                ctx->reqdigest = ctx->digest = EVP_get_digestbyname(mdname);
  245|      0|                if (ctx->digest == NULL) {
  ------------------
  |  Branch (245:21): [True: 0, False: 0]
  ------------------
  246|      0|                    (void)ERR_clear_last_mark();
  247|      0|                    ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  248|      0|                    goto err;
  249|      0|                }
  250|      0|            }
  251|      1|            (void)ERR_pop_to_mark();
  252|      1|        }
  253|      1|    }
  254|       |
  255|    982|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (255:12): [True: 0, False: 982]
  ------------------
  256|    982|    if (ver) {
  ------------------
  |  Branch (256:9): [True: 982, False: 0]
  ------------------
  257|    982|        if (signature->digest_verify_init == NULL) {
  ------------------
  |  Branch (257:13): [True: 0, False: 982]
  ------------------
  258|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  259|      0|                           "%s digest_verify_init:%s", signature->type_name, desc);
  260|      0|            goto err;
  261|      0|        }
  262|    982|        ret = signature->digest_verify_init(locpctx->op.sig.algctx,
  263|    982|                                            mdname, provkey, params);
  264|    982|    } else {
  265|      0|        if (signature->digest_sign_init == NULL) {
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  267|      0|                           "%s digest_sign_init:%s", signature->type_name, desc);
  268|      0|            goto err;
  269|      0|        }
  270|      0|        ret = signature->digest_sign_init(locpctx->op.sig.algctx,
  271|      0|                                          mdname, provkey, params);
  272|      0|    }
  273|       |
  274|       |    /*
  275|       |     * If the operation was not a success and no digest was found, an error
  276|       |     * needs to be raised.
  277|       |     */
  278|    982|    if (ret > 0 || mdname != NULL)
  ------------------
  |  Branch (278:9): [True: 965, False: 17]
  |  Branch (278:20): [True: 17, False: 0]
  ------------------
  279|    982|        goto end;
  280|      0|    if (type == NULL)   /* This check is redundant but clarifies matters */
  ------------------
  |  Branch (280:9): [True: 0, False: 0]
  ------------------
  281|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|    ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                  ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                  ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  111|      0|# define EVP_R_PROVIDER_SIGNATURE_FAILURE                 234
  ------------------
  283|      0|                   ver ? "%s digest_verify_init:%s" : "%s digest_sign_init:%s",
  ------------------
  |  Branch (283:20): [True: 0, False: 0]
  ------------------
  284|      0|                   signature->type_name, desc);
  285|       |
  286|      0| err:
  287|      0|    evp_pkey_ctx_free_old_ops(locpctx);
  288|      0|    locpctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  289|      0|    EVP_KEYMGMT_free(tmp_keymgmt);
  290|      0|    return 0;
  291|       |
  292|      0| legacy:
  293|       |    /*
  294|       |     * If we don't have the full support we need with provided methods,
  295|       |     * let's go see if legacy does.
  296|       |     */
  297|      0|    ERR_pop_to_mark();
  298|      0|    EVP_KEYMGMT_free(tmp_keymgmt);
  299|      0|    tmp_keymgmt = NULL;
  300|       |
  301|      0|    if (type == NULL && mdname != NULL)
  ------------------
  |  Branch (301:9): [True: 0, False: 0]
  |  Branch (301:25): [True: 0, False: 0]
  ------------------
  302|      0|        type = evp_get_digestbyname_ex(locpctx->libctx, mdname);
  303|       |
  304|      0|    if (ctx->pctx->pmeth == NULL) {
  ------------------
  |  Branch (304:9): [True: 0, False: 0]
  ------------------
  305|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|        return 0;
  307|      0|    }
  308|       |
  309|      0|    if (!(ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)) {
  ------------------
  |  | 1817|      0|# define EVP_PKEY_FLAG_SIGCTX_CUSTOM     4
  ------------------
  |  Branch (309:9): [True: 0, False: 0]
  ------------------
  310|       |
  311|      0|        if (type == NULL) {
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            int def_nid;
  313|      0|            if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0)
  ------------------
  |  Branch (313:17): [True: 0, False: 0]
  ------------------
  314|      0|                type = EVP_get_digestbynid(def_nid);
  ------------------
  |  |  552|      0|# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
  ------------------
  315|      0|        }
  316|       |
  317|      0|        if (type == NULL) {
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  319|      0|            return 0;
  320|      0|        }
  321|      0|    }
  322|       |
  323|      0|    if (ver) {
  ------------------
  |  Branch (323:9): [True: 0, False: 0]
  ------------------
  324|      0|        if (ctx->pctx->pmeth->verifyctx_init) {
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  ------------------
  325|      0|            if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, ctx) <= 0)
  ------------------
  |  Branch (325:17): [True: 0, False: 0]
  ------------------
  326|      0|                return 0;
  327|      0|            ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX;
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  328|      0|        } else if (ctx->pctx->pmeth->digestverify != 0) {
  ------------------
  |  Branch (328:20): [True: 0, False: 0]
  ------------------
  329|      0|            ctx->pctx->operation = EVP_PKEY_OP_VERIFY;
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  330|      0|            ctx->update = update;
  331|      0|        } else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) {
  ------------------
  |  Branch (331:20): [True: 0, False: 0]
  ------------------
  332|      0|            return 0;
  333|      0|        }
  334|      0|    } else {
  335|      0|        if (ctx->pctx->pmeth->signctx_init) {
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            if (ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx) <= 0)
  ------------------
  |  Branch (336:17): [True: 0, False: 0]
  ------------------
  337|      0|                return 0;
  338|      0|            ctx->pctx->operation = EVP_PKEY_OP_SIGNCTX;
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  339|      0|        } else if (ctx->pctx->pmeth->digestsign != 0) {
  ------------------
  |  Branch (339:20): [True: 0, False: 0]
  ------------------
  340|      0|            ctx->pctx->operation = EVP_PKEY_OP_SIGN;
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  341|      0|            ctx->update = update;
  342|      0|        } else if (EVP_PKEY_sign_init(ctx->pctx) <= 0) {
  ------------------
  |  Branch (342:20): [True: 0, False: 0]
  ------------------
  343|      0|            return 0;
  344|      0|        }
  345|      0|    }
  346|      0|    if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0)
  ------------------
  |  Branch (346:9): [True: 0, False: 0]
  ------------------
  347|      0|        return 0;
  348|      0|    if (pctx)
  ------------------
  |  Branch (348:9): [True: 0, False: 0]
  ------------------
  349|      0|        *pctx = ctx->pctx;
  350|      0|    if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)
  ------------------
  |  | 1817|      0|# define EVP_PKEY_FLAG_SIGCTX_CUSTOM     4
  ------------------
  |  Branch (350:9): [True: 0, False: 0]
  ------------------
  351|      0|        return 1;
  352|      0|    if (!EVP_DigestInit_ex(ctx, type, e))
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|        return 0;
  354|       |    /*
  355|       |     * This indicates the current algorithm requires
  356|       |     * special treatment before hashing the tbs-message.
  357|       |     */
  358|      0|    ctx->pctx->flag_call_digest_custom = 0;
  359|      0|    if (ctx->pctx->pmeth->digest_custom != NULL)
  ------------------
  |  Branch (359:9): [True: 0, False: 0]
  ------------------
  360|      0|        ctx->pctx->flag_call_digest_custom = 1;
  361|       |
  362|      0|    ret = 1;
  363|    982| end:
  364|    982|    if (ret > 0)
  ------------------
  |  Branch (364:9): [True: 965, False: 17]
  ------------------
  365|    965|        ret = evp_pkey_ctx_use_cached_data(locpctx);
  366|       |
  367|    982|    EVP_KEYMGMT_free(tmp_keymgmt);
  368|    982|    return ret > 0 ? 1 : 0;
  ------------------
  |  Branch (368:12): [True: 965, False: 17]
  ------------------
  369|      0|}
m_sigver.c:canon_mdname:
   30|    982|{
   31|    982|    if (mdname != NULL && strcmp(mdname, "UNDEF") == 0)
  ------------------
  |  Branch (31:9): [True: 982, False: 0]
  |  Branch (31:27): [True: 0, False: 982]
  ------------------
   32|      0|        return NULL;
   33|       |
   34|    982|    return mdname;
   35|    982|}

EVP_MAC_CTX_new:
   23|     68|{
   24|     68|    EVP_MAC_CTX *ctx = OPENSSL_zalloc(sizeof(EVP_MAC_CTX));
  ------------------
  |  |  104|     68|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|       |
   26|     68|    if (ctx != NULL) {
  ------------------
  |  Branch (26:9): [True: 68, False: 0]
  ------------------
   27|     68|        ctx->meth = mac;
   28|     68|        if ((ctx->algctx = mac->newctx(ossl_provider_ctx(mac->prov))) == NULL
  ------------------
  |  Branch (28:13): [True: 0, False: 68]
  ------------------
   29|     68|            || !EVP_MAC_up_ref(mac)) {
  ------------------
  |  Branch (29:16): [True: 0, False: 68]
  ------------------
   30|      0|            mac->freectx(ctx->algctx);
   31|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   32|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      0|            ctx = NULL;
   34|      0|        }
   35|     68|    }
   36|     68|    return ctx;
   37|     68|}
EVP_MAC_CTX_free:
   40|     68|{
   41|     68|    if (ctx == NULL)
  ------------------
  |  Branch (41:9): [True: 0, False: 68]
  ------------------
   42|      0|        return;
   43|     68|    ctx->meth->freectx(ctx->algctx);
   44|     68|    ctx->algctx = NULL;
   45|       |    /* refcnt-- */
   46|     68|    EVP_MAC_free(ctx->meth);
   47|     68|    OPENSSL_free(ctx);
  ------------------
  |  |  115|     68|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|     68|}
EVP_MAC_CTX_get_mac_size:
  106|     60|{
  107|     60|    return get_size_t_ctx_param(ctx, OSSL_MAC_PARAM_SIZE);
  ------------------
  |  |  347|     60|# define OSSL_MAC_PARAM_SIZE "size"
  ------------------
  108|     60|}
EVP_MAC_init:
  117|     60|{
  118|     60|    if (ctx->meth->init == NULL) {
  ------------------
  |  Branch (118:9): [True: 0, False: 60]
  ------------------
  119|      0|        ERR_raise(ERR_R_EVP_LIB, ERR_R_UNSUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|      0|        return 0;
  121|      0|    }
  122|     60|    return ctx->meth->init(ctx->algctx, key, keylen, params);
  123|     60|}
EVP_MAC_update:
  137|     60|{
  138|     60|    return ctx->meth->update(ctx->algctx, data, datalen);
  139|     60|}
EVP_MAC_final:
  188|     60|{
  189|     60|    return evp_mac_final(ctx, 0, out, outl, outsize);
  190|     60|}
EVP_MAC_CTX_set_params:
  218|    128|{
  219|    128|    if (ctx->meth->set_ctx_params != NULL)
  ------------------
  |  Branch (219:9): [True: 128, False: 0]
  ------------------
  220|    128|        return ctx->meth->set_ctx_params(ctx->algctx, params);
  221|      0|    return 1;
  222|    128|}
EVP_Q_mac:
  260|     68|{
  261|     68|    EVP_MAC *mac = EVP_MAC_fetch(libctx, name, propq);
  262|     68|    OSSL_PARAM subalg_param[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     68|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM subalg_param[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     68|    { NULL, 0, NULL, 0, 0 }
  ------------------
  263|     68|    EVP_MAC_CTX *ctx  = NULL;
  264|     68|    size_t len = 0;
  265|     68|    unsigned char *res = NULL;
  266|       |
  267|     68|    if (outlen != NULL)
  ------------------
  |  Branch (267:9): [True: 68, False: 0]
  ------------------
  268|     68|        *outlen = 0;
  269|     68|    if (mac == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 68]
  ------------------
  270|      0|        return NULL;
  271|     68|    if (subalg != NULL) {
  ------------------
  |  Branch (271:9): [True: 68, False: 0]
  ------------------
  272|     68|        const OSSL_PARAM *defined_params = EVP_MAC_settable_ctx_params(mac);
  273|     68|        const char *param_name = OSSL_MAC_PARAM_DIGEST;
  ------------------
  |  |  336|     68|# define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|     68|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  274|       |
  275|       |        /*
  276|       |         * The underlying algorithm may be a cipher or a digest.
  277|       |         * We don't know which it is, but we can ask the MAC what it
  278|       |         * should be and bet on that.
  279|       |         */
  280|     68|        if (OSSL_PARAM_locate_const(defined_params, param_name) == NULL) {
  ------------------
  |  Branch (280:13): [True: 0, False: 68]
  ------------------
  281|      0|            param_name = OSSL_MAC_PARAM_CIPHER;
  ------------------
  |  |  333|      0|# define OSSL_MAC_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      0|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  282|      0|            if (OSSL_PARAM_locate_const(defined_params, param_name) == NULL) {
  ------------------
  |  Branch (282:17): [True: 0, False: 0]
  ------------------
  283|      0|                ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  284|      0|                goto err;
  285|      0|            }
  286|      0|        }
  287|     68|        subalg_param[0] =
  288|     68|            OSSL_PARAM_construct_utf8_string(param_name, (char *)subalg, 0);
  289|     68|    }
  290|       |    /* Single-shot - on NULL key input, set dummy key value for EVP_MAC_Init. */
  291|     68|    if (key == NULL && keylen == 0)
  ------------------
  |  Branch (291:9): [True: 0, False: 68]
  |  Branch (291:24): [True: 0, False: 0]
  ------------------
  292|      0|        key = data;
  293|     68|    if ((ctx = EVP_MAC_CTX_new(mac)) != NULL
  ------------------
  |  Branch (293:9): [True: 68, False: 0]
  ------------------
  294|     68|            && EVP_MAC_CTX_set_params(ctx, subalg_param)
  ------------------
  |  Branch (294:16): [True: 60, False: 8]
  ------------------
  295|     68|            && EVP_MAC_CTX_set_params(ctx, params)
  ------------------
  |  Branch (295:16): [True: 60, False: 0]
  ------------------
  296|     68|            && EVP_MAC_init(ctx, key, keylen, params)
  ------------------
  |  Branch (296:16): [True: 60, False: 0]
  ------------------
  297|     68|            && EVP_MAC_update(ctx, data, datalen)
  ------------------
  |  Branch (297:16): [True: 60, False: 0]
  ------------------
  298|     68|            && EVP_MAC_final(ctx, out, &len, outsize)) {
  ------------------
  |  Branch (298:16): [True: 60, False: 0]
  ------------------
  299|     60|        if (out == NULL) {
  ------------------
  |  Branch (299:13): [True: 0, False: 60]
  ------------------
  300|      0|            out = OPENSSL_malloc(len);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  301|      0|            if (out != NULL && !EVP_MAC_final(ctx, out, NULL, len)) {
  ------------------
  |  Branch (301:17): [True: 0, False: 0]
  |  Branch (301:32): [True: 0, False: 0]
  ------------------
  302|      0|                OPENSSL_free(out);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|      0|                out = NULL;
  304|      0|            }
  305|      0|        }
  306|     60|        res = out;
  307|     60|        if (res != NULL && outlen != NULL)
  ------------------
  |  Branch (307:13): [True: 60, False: 0]
  |  Branch (307:28): [True: 60, False: 0]
  ------------------
  308|     60|            *outlen = len;
  309|     60|    }
  310|       |
  311|     68| err:
  312|     68|    EVP_MAC_CTX_free(ctx);
  313|     68|    EVP_MAC_free(mac);
  314|     68|    return res;
  315|     68|}
mac_lib.c:get_size_t_ctx_param:
   83|     60|{
   84|     60|    size_t sz = 0;
   85|       |
   86|     60|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (86:9): [True: 60, False: 0]
  ------------------
   87|     60|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     60|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     60|    { NULL, 0, NULL, 0, 0 }
  ------------------
   88|       |
   89|     60|        params[0] = OSSL_PARAM_construct_size_t(name, &sz);
   90|     60|        if (ctx->meth->get_ctx_params != NULL) {
  ------------------
  |  Branch (90:13): [True: 60, False: 0]
  ------------------
   91|     60|            if (ctx->meth->get_ctx_params(ctx->algctx, params))
  ------------------
  |  Branch (91:17): [True: 60, False: 0]
  ------------------
   92|     60|                return sz;
   93|     60|        } else if (ctx->meth->get_params != NULL) {
  ------------------
  |  Branch (93:20): [True: 0, False: 0]
  ------------------
   94|      0|            if (ctx->meth->get_params(params))
  ------------------
  |  Branch (94:17): [True: 0, False: 0]
  ------------------
   95|      0|                return sz;
   96|      0|        }
   97|     60|    }
   98|       |    /*
   99|       |     * If the MAC hasn't been initialized yet, or there is no size to get,
  100|       |     * we return zero
  101|       |     */
  102|      0|    return 0;
  103|     60|}
mac_lib.c:evp_mac_final:
  143|     60|{
  144|     60|    size_t l;
  145|     60|    int res;
  146|     60|    OSSL_PARAM params[2];
  147|     60|    size_t macsize;
  148|       |
  149|     60|    if (ctx == NULL || ctx->meth == NULL) {
  ------------------
  |  Branch (149:9): [True: 0, False: 60]
  |  Branch (149:24): [True: 0, False: 60]
  ------------------
  150|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  151|      0|        return 0;
  152|      0|    }
  153|     60|    if (ctx->meth->final == NULL) {
  ------------------
  |  Branch (153:9): [True: 0, False: 60]
  ------------------
  154|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  155|      0|        return 0;
  156|      0|    }
  157|       |
  158|     60|    macsize = EVP_MAC_CTX_get_mac_size(ctx);
  159|     60|    if (out == NULL) {
  ------------------
  |  Branch (159:9): [True: 0, False: 60]
  ------------------
  160|      0|        if (outl == NULL) {
  ------------------
  |  Branch (160:13): [True: 0, False: 0]
  ------------------
  161|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  162|      0|            return 0;
  163|      0|        }
  164|      0|        *outl = macsize;
  165|      0|        return 1;
  166|      0|    }
  167|     60|    if (outsize < macsize) {
  ------------------
  |  Branch (167:9): [True: 0, False: 60]
  ------------------
  168|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|        return 0;
  170|      0|    }
  171|     60|    if (xof) {
  ------------------
  |  Branch (171:9): [True: 0, False: 60]
  ------------------
  172|      0|        params[0] = OSSL_PARAM_construct_int(OSSL_MAC_PARAM_XOF, &xof);
  ------------------
  |  |  349|      0|# define OSSL_MAC_PARAM_XOF "xof"
  ------------------
  173|      0|        params[1] = OSSL_PARAM_construct_end();
  174|       |
  175|      0|        if (EVP_MAC_CTX_set_params(ctx, params) <= 0) {
  ------------------
  |  Branch (175:13): [True: 0, False: 0]
  ------------------
  176|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_SETTING_XOF_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  177|      0|            return 0;
  178|      0|        }
  179|      0|    }
  180|     60|    res = ctx->meth->final(ctx->algctx, out, &l, outsize);
  181|     60|    if (outl != NULL)
  ------------------
  |  Branch (181:9): [True: 60, False: 0]
  ------------------
  182|     60|        *outl = l;
  183|     60|    return res;
  184|     60|}

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

EVP_add_cipher:
   20|    144|{
   21|    144|    int r;
   22|       |
   23|    144|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 144]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    144|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    144|                     (const char *)c);
   28|    144|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 144]
  ------------------
   29|      0|        return 0;
   30|    144|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    144|                     (const char *)c);
   32|    144|    return r;
   33|    144|}
EVP_add_digest:
   36|     22|{
   37|     22|    int r;
   38|     22|    const char *name;
   39|       |
   40|     22|    name = OBJ_nid2sn(md->type);
   41|     22|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     22|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 22]
  ------------------
   43|      0|        return 0;
   44|     22|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     22|                     (const char *)md);
   46|     22|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     22|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 17, False: 5]
  |  Branch (49:26): [True: 16, False: 1]
  ------------------
   50|     16|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     16|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 16]
  ------------------
   53|      0|            return 0;
   54|     16|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     16|    }
   57|     22|    return r;
   58|     22|}
EVP_get_digestbyname:
  131|    884|{
  132|    884|    return evp_get_digestbyname_ex(NULL, name);
  133|    884|}
evp_get_digestbyname_ex:
  136|    884|{
  137|    884|    const EVP_MD *dp;
  138|    884|    OSSL_NAMEMAP *namemap;
  139|    884|    int id;
  140|    884|    int do_retry = 1;
  141|       |
  142|    884|    if (!OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL))
  ------------------
  |  |  469|    884|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (142:9): [True: 0, False: 884]
  ------------------
  143|      0|        return NULL;
  144|       |
  145|    884|    dp = (const EVP_MD *)OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|    884|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  146|       |
  147|    884|    if (dp != NULL)
  ------------------
  |  Branch (147:9): [True: 836, False: 48]
  ------------------
  148|    836|        return dp;
  149|       |
  150|       |    /*
  151|       |     * It's not in the method database, but it might be there under a different
  152|       |     * name. So we check for aliases in the EVP namemap and try all of those
  153|       |     * in turn.
  154|       |     */
  155|       |
  156|     48|    namemap = ossl_namemap_stored(libctx);
  157|     96| retry:
  158|     96|    id = ossl_namemap_name2num(namemap, name);
  159|     96|    if (id == 0) {
  ------------------
  |  Branch (159:9): [True: 96, False: 0]
  ------------------
  160|     96|        EVP_MD *fetched_md;
  161|       |
  162|       |        /* Try to fetch it because the name might not be known yet. */
  163|     96|        if (!do_retry)
  ------------------
  |  Branch (163:13): [True: 48, False: 48]
  ------------------
  164|     48|            return NULL;
  165|     48|        do_retry = 0;
  166|     48|        ERR_set_mark();
  167|     48|        fetched_md = EVP_MD_fetch(libctx, name, NULL);
  168|     48|        EVP_MD_free(fetched_md);
  169|     48|        ERR_pop_to_mark();
  170|     48|        goto retry;
  171|     96|    }
  172|       |
  173|      0|    if (!ossl_namemap_doall_names(namemap, id, digest_from_name, &dp))
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  ------------------
  174|      0|        return NULL;
  175|       |
  176|      0|    return dp;
  177|      0|}
evp_cleanup_int:
  180|      2|{
  181|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  182|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  183|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  184|       |    /*
  185|       |     * The above calls will only clean out the contents of the name hash
  186|       |     * table, but not the hash table itself.  The following line does that
  187|       |     * part.  -- Richard Levitte
  188|       |     */
  189|      2|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      2|    EVP_PBE_cleanup();
  192|      2|    OBJ_sigid_free();
  193|       |
  194|      2|    evp_app_cleanup_int();
  195|      2|}

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

EVP_PKEY_get_security_bits:
   78|      8|{
   79|      8|    int size = 0;
   80|       |
   81|      8|    if (pkey != NULL) {
  ------------------
  |  Branch (81:9): [True: 8, False: 0]
  ------------------
   82|      8|        size = pkey->cache.security_bits;
   83|      8|        if (pkey->ameth != NULL && pkey->ameth->pkey_security_bits != NULL)
  ------------------
  |  Branch (83:13): [True: 0, False: 8]
  |  Branch (83:36): [True: 0, False: 0]
  ------------------
   84|      0|            size = pkey->ameth->pkey_security_bits(pkey);
   85|      8|    }
   86|      8|    if (size <= 0) {
  ------------------
  |  Branch (86:9): [True: 1, False: 7]
  ------------------
   87|      1|        ERR_raise(ERR_LIB_EVP, EVP_R_UNKNOWN_SECURITY_BITS);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
   88|      1|        return 0;
   89|      1|    }
   90|      7|    return size;
   91|      8|}
EVP_PKEY_set_type:
  724|  69.8k|{
  725|  69.8k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  726|  69.8k|}
EVP_PKEY_assign:
  794|  19.2k|{
  795|  19.2k|#  ifndef OPENSSL_NO_EC
  796|  19.2k|    int pktype;
  797|       |
  798|  19.2k|    pktype = EVP_PKEY_type(type);
  799|  19.2k|    if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   73|  19.2k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  38.5k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   74|  6.85k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  6.85k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (799:9): [True: 19.2k, False: 0]
  |  Branch (799:27): [True: 12.4k, False: 6.85k]
  |  Branch (799:52): [True: 0, False: 6.85k]
  ------------------
  800|  12.4k|        const EC_GROUP *group = EC_KEY_get0_group(key);
  801|       |
  802|  12.4k|        if (group != NULL) {
  ------------------
  |  Branch (802:13): [True: 12.4k, False: 0]
  ------------------
  803|  12.4k|            int curve = EC_GROUP_get_curve_name(group);
  804|       |
  805|       |            /*
  806|       |             * Regardless of what is requested the SM2 curve must be SM2 type,
  807|       |             * and non SM2 curves are EC type.
  808|       |             */
  809|  12.4k|            if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  | 1232|  24.8k|#define NID_sm2         1172
  ------------------
                          if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  |   73|  1.02k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  1.02k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (809:17): [True: 1.02k, False: 11.3k]
  |  Branch (809:37): [True: 1.02k, False: 0]
  ------------------
  810|  1.02k|                type = EVP_PKEY_SM2;
  ------------------
  |  |   74|  1.02k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  1.02k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  811|  11.3k|            else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  | 1232|  22.7k|#define NID_sm2         1172
  ------------------
                          else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  |   74|  11.3k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  11.3k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (811:21): [True: 11.3k, False: 0]
  |  Branch (811:41): [True: 0, False: 11.3k]
  ------------------
  812|      0|                type = EVP_PKEY_EC;
  ------------------
  |  |   73|      0|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  813|  12.4k|        }
  814|  12.4k|    }
  815|  19.2k|#  endif
  816|       |
  817|  19.2k|    if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
  ------------------
  |  Branch (817:9): [True: 0, False: 19.2k]
  |  Branch (817:25): [True: 0, False: 19.2k]
  ------------------
  818|      0|        return 0;
  819|       |
  820|  19.2k|    pkey->pkey.ptr = key;
  821|  19.2k|    detect_foreign_key(pkey);
  822|       |
  823|  19.2k|    return (key != NULL);
  824|  19.2k|}
EVP_PKEY_get1_DSA:
  918|     86|{
  919|     86|    DSA *ret = evp_pkey_get0_DSA_int(pkey);
  920|       |
  921|     86|    if (ret != NULL && !DSA_up_ref(ret))
  ------------------
  |  Branch (921:9): [True: 86, False: 0]
  |  Branch (921:24): [True: 0, False: 86]
  ------------------
  922|      0|        return NULL;
  923|       |
  924|     86|    return ret;
  925|     86|}
ossl_evp_pkey_get1_X25519:
  949|      6|    {                                                                   \
  950|      6|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  951|      6|    }
ossl_evp_pkey_get1_ED25519:
  949|      3|    {                                                                   \
  950|      3|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  951|      3|    }
evp_pkey_get0_DH_int:
 1001|    143|{
 1002|    143|    if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   71|    143|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|    286|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   72|    143|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|    143|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (1002:9): [True: 143, False: 0]
  |  Branch (1002:38): [True: 0, False: 143]
  ------------------
 1003|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1004|      0|        return NULL;
 1005|      0|    }
 1006|    143|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
 1007|    143|}
EVP_PKEY_get1_DH:
 1015|    143|{
 1016|    143|    DH *ret = evp_pkey_get0_DH_int(pkey);
 1017|       |
 1018|    143|    if (ret != NULL && !DH_up_ref(ret))
  ------------------
  |  Branch (1018:9): [True: 143, False: 0]
  |  Branch (1018:24): [True: 0, False: 143]
  ------------------
 1019|      0|        ret = NULL;
 1020|       |
 1021|    143|    return ret;
 1022|    143|}
EVP_PKEY_type:
 1026|  31.8k|{
 1027|  31.8k|    int ret;
 1028|  31.8k|    const EVP_PKEY_ASN1_METHOD *ameth;
 1029|  31.8k|    ENGINE *e;
 1030|  31.8k|    ameth = EVP_PKEY_asn1_find(&e, type);
 1031|  31.8k|    if (ameth)
  ------------------
  |  Branch (1031:9): [True: 31.7k, False: 146]
  ------------------
 1032|  31.7k|        ret = ameth->pkey_id;
 1033|    146|    else
 1034|    146|        ret = NID_undef;
  ------------------
  |  |   18|    146|#define NID_undef                       0
  ------------------
 1035|  31.8k|# ifndef OPENSSL_NO_ENGINE
 1036|  31.8k|    ENGINE_finish(e);
 1037|  31.8k|# endif
 1038|  31.8k|    return ret;
 1039|  31.8k|}
EVP_PKEY_get_id:
 1042|  12.5k|{
 1043|  12.5k|    return pkey->type;
 1044|  12.5k|}
EVP_PKEY_get_base_id:
 1047|  12.4k|{
 1048|  12.4k|    return EVP_PKEY_type(pkey->type);
 1049|  12.4k|}
evp_pkey_name2type:
 1079|  1.15k|{
 1080|  1.15k|    int type;
 1081|  1.15k|    size_t i;
 1082|       |
 1083|  2.51k|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|  2.51k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1083:17): [True: 2.43k, False: 78]
  ------------------
 1084|  2.43k|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1084:13): [True: 1.08k, False: 1.35k]
  ------------------
 1085|  1.08k|            return (int)standard_name2type[i].id;
 1086|  2.43k|    }
 1087|       |
 1088|     78|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|     78|#define NID_undef                       0
  ------------------
  |  Branch (1088:9): [True: 5, False: 73]
  ------------------
 1089|      5|        return type;
 1090|     73|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1091|     78|}
EVP_PKEY_is_a:
 1106|  1.72k|{
 1107|  1.72k|    if (pkey == NULL)
  ------------------
  |  Branch (1107:9): [True: 0, False: 1.72k]
  ------------------
 1108|      0|        return 0;
 1109|  1.72k|    if (pkey->keymgmt == NULL)
  ------------------
  |  Branch (1109:9): [True: 0, False: 1.72k]
  ------------------
 1110|      0|        return pkey->type == evp_pkey_name2type(name);
 1111|  1.72k|    return EVP_KEYMGMT_is_a(pkey->keymgmt, name);
 1112|  1.72k|}
EVP_PKEY_new:
 1509|  69.7k|{
 1510|  69.7k|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  69.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  69.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  69.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1511|       |
 1512|  69.7k|    if (ret == NULL)
  ------------------
  |  Branch (1512:9): [True: 0, False: 69.7k]
  ------------------
 1513|      0|        return NULL;
 1514|       |
 1515|  69.7k|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|  69.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  69.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1516|  69.7k|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   62|  69.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  69.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1517|       |
 1518|  69.7k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1518:9): [True: 0, False: 69.7k]
  ------------------
 1519|      0|        goto err;
 1520|       |
 1521|  69.7k|    ret->lock = CRYPTO_THREAD_lock_new();
 1522|  69.7k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1522:9): [True: 0, False: 69.7k]
  ------------------
 1523|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1524|      0|        goto err;
 1525|      0|    }
 1526|       |
 1527|  69.7k|#ifndef FIPS_MODULE
 1528|  69.7k|    ret->save_parameters = 1;
 1529|  69.7k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  247|  69.7k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1529:9): [True: 0, False: 69.7k]
  ------------------
 1530|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1531|      0|        goto err;
 1532|      0|    }
 1533|  69.7k|#endif
 1534|  69.7k|    return ret;
 1535|       |
 1536|      0| err:
 1537|      0|    CRYPTO_FREE_REF(&ret->references);
 1538|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1539|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1540|      0|    return NULL;
 1541|  69.7k|}
EVP_PKEY_set_type_by_keymgmt:
 1695|  19.2k|{
 1696|  19.2k|#ifndef FIPS_MODULE
 1697|  19.2k|# define EVP_PKEY_TYPE_STR str[0]
 1698|  19.2k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
 1699|       |    /*
 1700|       |     * Find at most two strings that have an associated EVP_PKEY_ASN1_METHOD
 1701|       |     * Ideally, only one should be found.  If two (or more) are found, the
 1702|       |     * match is ambiguous.  This should never happen, but...
 1703|       |     */
 1704|  19.2k|    const char *str[2] = { NULL, NULL };
 1705|       |
 1706|  19.2k|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1706:9): [True: 0, False: 19.2k]
  ------------------
 1707|  19.2k|            || str[1] != NULL) {
  ------------------
  |  Branch (1707:16): [True: 0, False: 19.2k]
  ------------------
 1708|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1709|      0|        return 0;
 1710|      0|    }
 1711|       |#else
 1712|       |# define EVP_PKEY_TYPE_STR NULL
 1713|       |# define EVP_PKEY_TYPE_STRLEN -1
 1714|       |#endif
 1715|  19.2k|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   62|  19.2k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  19.2k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1716|  19.2k|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1697|  19.2k|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1698|  19.2k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1698:32): [True: 1.02k, False: 18.2k]
  |  |  ------------------
  ------------------
 1717|  19.2k|                         keymgmt);
 1718|       |
 1719|  19.2k|#undef EVP_PKEY_TYPE_STR
 1720|  19.2k|#undef EVP_PKEY_TYPE_STRLEN
 1721|  19.2k|}
EVP_PKEY_up_ref:
 1724|  21.5k|{
 1725|  21.5k|    int i;
 1726|       |
 1727|  21.5k|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1727:9): [True: 0, False: 21.5k]
  ------------------
 1728|      0|        return 0;
 1729|       |
 1730|  21.5k|    REF_PRINT_COUNT("EVP_PKEY", i, pkey);
  ------------------
  |  |  301|  21.5k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  21.5k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  21.5k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  21.5k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|  21.5k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  21.5k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1732|  21.5k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1732:13): [True: 21.5k, False: 0]
  ------------------
 1733|  21.5k|}
evp_pkey_free_legacy:
 1798|  69.7k|{
 1799|  69.7k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1800|  69.7k|    ENGINE *tmpe = NULL;
 1801|       |
 1802|  69.7k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1802:9): [True: 19.2k, False: 50.5k]
  |  Branch (1802:26): [True: 0, False: 19.2k]
  ------------------
 1803|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1804|       |
 1805|  69.7k|    if (ameth != NULL) {
  ------------------
  |  Branch (1805:9): [True: 50.5k, False: 19.2k]
  ------------------
 1806|  50.5k|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 50.5k]
  ------------------
 1807|       |            /*
 1808|       |             * We should never have both a legacy origin key, and a key in the
 1809|       |             * legacy cache.
 1810|       |             */
 1811|      0|            assert(x->pkey.ptr == NULL);
 1812|       |            /*
 1813|       |             * For the purposes of freeing we make the legacy cache look like
 1814|       |             * a legacy origin key.
 1815|       |             */
 1816|      0|            x->pkey = x->legacy_cache_pkey;
 1817|      0|            x->legacy_cache_pkey.ptr = NULL;
 1818|      0|        }
 1819|  50.5k|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1819:13): [True: 50.5k, False: 0]
  ------------------
 1820|  50.5k|            ameth->pkey_free(x);
 1821|  50.5k|        x->pkey.ptr = NULL;
 1822|  50.5k|    }
 1823|  69.7k|# ifndef OPENSSL_NO_ENGINE
 1824|  69.7k|    ENGINE_finish(tmpe);
 1825|  69.7k|    ENGINE_finish(x->engine);
 1826|  69.7k|    x->engine = NULL;
 1827|  69.7k|    ENGINE_finish(x->pmeth_engine);
 1828|  69.7k|    x->pmeth_engine = NULL;
 1829|  69.7k|# endif
 1830|  69.7k|}
EVP_PKEY_free:
 1851|   315k|{
 1852|   315k|    int i;
 1853|       |
 1854|   315k|    if (x == NULL)
  ------------------
  |  Branch (1854:9): [True: 223k, False: 91.3k]
  ------------------
 1855|   223k|        return;
 1856|       |
 1857|  91.3k|    CRYPTO_DOWN_REF(&x->references, &i);
 1858|  91.3k|    REF_PRINT_COUNT("EVP_PKEY", i, x);
  ------------------
  |  |  301|  91.3k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  91.3k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  91.3k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  91.3k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1859|  91.3k|    if (i > 0)
  ------------------
  |  Branch (1859:9): [True: 21.5k, False: 69.7k]
  ------------------
 1860|  21.5k|        return;
 1861|  69.7k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  69.7k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 69.7k]
  |  |  ------------------
  ------------------
 1862|  69.7k|    evp_pkey_free_it(x);
 1863|  69.7k|#ifndef FIPS_MODULE
 1864|  69.7k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  247|  69.7k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1865|  69.7k|#endif
 1866|  69.7k|    CRYPTO_THREAD_lock_free(x->lock);
 1867|  69.7k|    CRYPTO_FREE_REF(&x->references);
 1868|  69.7k|#ifndef FIPS_MODULE
 1869|  69.7k|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|  69.7k|#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
  ------------------
 1870|  69.7k|#endif
 1871|  69.7k|    OPENSSL_free(x);
  ------------------
  |  |  115|  69.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  69.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  69.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1872|  69.7k|}
evp_pkey_export_to_provider:
 1909|    982|{
 1910|    982|    EVP_KEYMGMT *allocated_keymgmt = NULL;
 1911|    982|    EVP_KEYMGMT *tmp_keymgmt = NULL;
 1912|    982|    int selection = OSSL_KEYMGMT_SELECT_ALL;
  ------------------
  |  |  652|    982|    ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  650|    982|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    982|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    982|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  647|    982|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|    982|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  648|    982|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|    982|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1913|    982|    void *keydata = NULL;
 1914|    982|    int check;
 1915|       |
 1916|    982|    if (pk == NULL)
  ------------------
  |  Branch (1916:9): [True: 0, False: 982]
  ------------------
 1917|      0|        return NULL;
 1918|       |
 1919|       |    /* No key data => nothing to export */
 1920|    982|    check = 1;
 1921|    982|#ifndef FIPS_MODULE
 1922|    982|    check = check && pk->pkey.ptr == NULL;
  ------------------
  |  Branch (1922:13): [True: 982, False: 0]
  |  Branch (1922:22): [True: 982, False: 0]
  ------------------
 1923|    982|#endif
 1924|    982|    check = check && pk->keydata == NULL;
  ------------------
  |  Branch (1924:13): [True: 982, False: 0]
  |  Branch (1924:22): [True: 0, False: 982]
  ------------------
 1925|    982|    if (check)
  ------------------
  |  Branch (1925:9): [True: 0, False: 982]
  ------------------
 1926|      0|        return NULL;
 1927|       |
 1928|    982|#ifndef FIPS_MODULE
 1929|    982|    if (pk->pkey.ptr != NULL) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 982]
  ------------------
 1930|       |        /*
 1931|       |         * If the legacy key doesn't have an dirty counter or export function,
 1932|       |         * give up
 1933|       |         */
 1934|      0|        if (pk->ameth->dirty_cnt == NULL || pk->ameth->export_to == NULL)
  ------------------
  |  Branch (1934:13): [True: 0, False: 0]
  |  Branch (1934:45): [True: 0, False: 0]
  ------------------
 1935|      0|            return NULL;
 1936|      0|    }
 1937|    982|#endif
 1938|       |
 1939|    982|    if (keymgmt != NULL) {
  ------------------
  |  Branch (1939:9): [True: 982, False: 0]
  ------------------
 1940|    982|        tmp_keymgmt = *keymgmt;
 1941|    982|        *keymgmt = NULL;
 1942|    982|    }
 1943|       |
 1944|       |    /*
 1945|       |     * If no keymgmt was given or found, get a default keymgmt.  We do so by
 1946|       |     * letting EVP_PKEY_CTX_new_from_pkey() do it for us, then we steal it.
 1947|       |     */
 1948|    982|    if (tmp_keymgmt == NULL) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 982]
  ------------------
 1949|      0|        EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pk, propquery);
 1950|       |
 1951|      0|        if (ctx == NULL)
  ------------------
  |  Branch (1951:13): [True: 0, False: 0]
  ------------------
 1952|      0|            goto end;
 1953|      0|        allocated_keymgmt = tmp_keymgmt = ctx->keymgmt;
 1954|      0|        ctx->keymgmt = NULL;
 1955|      0|        EVP_PKEY_CTX_free(ctx);
 1956|      0|    }
 1957|       |
 1958|       |    /* If there's still no keymgmt to be had, give up */
 1959|    982|    if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (1959:9): [True: 0, False: 982]
  ------------------
 1960|      0|        goto end;
 1961|       |
 1962|    982|#ifndef FIPS_MODULE
 1963|    982|    if (pk->pkey.ptr != NULL) {
  ------------------
  |  Branch (1963:9): [True: 0, False: 982]
  ------------------
 1964|      0|        OP_CACHE_ELEM *op;
 1965|       |
 1966|       |        /*
 1967|       |         * If the legacy "origin" hasn't changed since last time, we try
 1968|       |         * to find our keymgmt in the operation cache.  If it has changed,
 1969|       |         * |i| remains zero, and we will clear the cache further down.
 1970|       |         */
 1971|      0|        if (pk->ameth->dirty_cnt(pk) == pk->dirty_cnt_copy) {
  ------------------
  |  Branch (1971:13): [True: 0, False: 0]
  ------------------
 1972|      0|            if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (1972:17): [True: 0, False: 0]
  ------------------
 1973|      0|                goto end;
 1974|      0|            op = evp_keymgmt_util_find_operation_cache(pk, tmp_keymgmt,
 1975|      0|                                                       selection);
 1976|       |
 1977|       |            /*
 1978|       |             * If |tmp_keymgmt| is present in the operation cache, it means
 1979|       |             * that export doesn't need to be redone.  In that case, we take
 1980|       |             * token copies of the cached pointers, to have token success
 1981|       |             * values to return. It is possible (e.g. in a no-cached-fetch
 1982|       |             * build), for op->keymgmt to be a different pointer to tmp_keymgmt
 1983|       |             * even though the name/provider must be the same. In other words
 1984|       |             * the keymgmt instance may be different but still equivalent, i.e.
 1985|       |             * same algorithm/provider instance - but we make the simplifying
 1986|       |             * assumption that the keydata can be used with either keymgmt
 1987|       |             * instance. Not doing so introduces significant complexity and
 1988|       |             * probably requires refactoring - since we would have to ripple
 1989|       |             * the change in keymgmt instance up the call chain.
 1990|       |             */
 1991|      0|            if (op != NULL && op->keymgmt != NULL) {
  ------------------
  |  Branch (1991:17): [True: 0, False: 0]
  |  Branch (1991:31): [True: 0, False: 0]
  ------------------
 1992|      0|                keydata = op->keydata;
 1993|      0|                CRYPTO_THREAD_unlock(pk->lock);
 1994|      0|                goto end;
 1995|      0|            }
 1996|      0|            CRYPTO_THREAD_unlock(pk->lock);
 1997|      0|        }
 1998|       |
 1999|       |        /* Make sure that the keymgmt key type matches the legacy NID */
 2000|      0|        if (!EVP_KEYMGMT_is_a(tmp_keymgmt, OBJ_nid2sn(pk->type)))
  ------------------
  |  Branch (2000:13): [True: 0, False: 0]
  ------------------
 2001|      0|            goto end;
 2002|       |
 2003|      0|        if ((keydata = evp_keymgmt_newdata(tmp_keymgmt)) == NULL)
  ------------------
  |  Branch (2003:13): [True: 0, False: 0]
  ------------------
 2004|      0|            goto end;
 2005|       |
 2006|      0|        if (!pk->ameth->export_to(pk, keydata, tmp_keymgmt->import,
  ------------------
  |  Branch (2006:13): [True: 0, False: 0]
  ------------------
 2007|      0|                                  libctx, propquery)) {
 2008|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2009|      0|            keydata = NULL;
 2010|      0|            goto end;
 2011|      0|        }
 2012|       |
 2013|       |        /*
 2014|       |         * If the dirty counter changed since last time, then clear the
 2015|       |         * operation cache.  In that case, we know that |i| is zero.  Just
 2016|       |         * in case this is a re-export, we increment then decrement the
 2017|       |         * keymgmt reference counter.
 2018|       |         */
 2019|      0|        if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) { /* refcnt++ */
  ------------------
  |  Branch (2019:13): [True: 0, False: 0]
  ------------------
 2020|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2021|      0|            keydata = NULL;
 2022|      0|            goto end;
 2023|      0|        }
 2024|       |
 2025|      0|        if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2025:13): [True: 0, False: 0]
  ------------------
 2026|      0|            goto end;
 2027|      0|        if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy
  ------------------
  |  Branch (2027:13): [True: 0, False: 0]
  ------------------
 2028|      0|                && !evp_keymgmt_util_clear_operation_cache(pk)) {
  ------------------
  |  Branch (2028:20): [True: 0, False: 0]
  ------------------
 2029|      0|            CRYPTO_THREAD_unlock(pk->lock);
 2030|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2031|      0|            keydata = NULL;
 2032|      0|            EVP_KEYMGMT_free(tmp_keymgmt);
 2033|      0|            goto end;
 2034|      0|        }
 2035|      0|        EVP_KEYMGMT_free(tmp_keymgmt); /* refcnt-- */
 2036|       |
 2037|       |        /* Check to make sure some other thread didn't get there first */
 2038|      0|        op = evp_keymgmt_util_find_operation_cache(pk, tmp_keymgmt, selection);
 2039|      0|        if (op != NULL && op->keymgmt != NULL) {
  ------------------
  |  Branch (2039:13): [True: 0, False: 0]
  |  Branch (2039:27): [True: 0, False: 0]
  ------------------
 2040|      0|            void *tmp_keydata = op->keydata;
 2041|       |
 2042|      0|            CRYPTO_THREAD_unlock(pk->lock);
 2043|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2044|      0|            keydata = tmp_keydata;
 2045|      0|            goto end;
 2046|      0|        }
 2047|       |
 2048|       |        /* Add the new export to the operation cache */
 2049|      0|        if (!evp_keymgmt_util_cache_keydata(pk, tmp_keymgmt, keydata,
  ------------------
  |  Branch (2049:13): [True: 0, False: 0]
  ------------------
 2050|      0|                                            selection)) {
 2051|      0|            CRYPTO_THREAD_unlock(pk->lock);
 2052|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2053|      0|            keydata = NULL;
 2054|      0|            goto end;
 2055|      0|        }
 2056|       |
 2057|       |        /* Synchronize the dirty count */
 2058|      0|        pk->dirty_cnt_copy = pk->ameth->dirty_cnt(pk);
 2059|       |
 2060|      0|        CRYPTO_THREAD_unlock(pk->lock);
 2061|      0|        goto end;
 2062|      0|    }
 2063|    982|#endif  /* FIPS_MODULE */
 2064|       |
 2065|    982|    keydata = evp_keymgmt_util_export_to_provider(pk, tmp_keymgmt, selection);
 2066|       |
 2067|    982| end:
 2068|       |    /*
 2069|       |     * If nothing was exported, |tmp_keymgmt| might point at a freed
 2070|       |     * EVP_KEYMGMT, so we clear it to be safe.  It shouldn't be useful for
 2071|       |     * the caller either way in that case.
 2072|       |     */
 2073|    982|    if (keydata == NULL)
  ------------------
  |  Branch (2073:9): [True: 0, False: 982]
  ------------------
 2074|      0|        tmp_keymgmt = NULL;
 2075|       |
 2076|    982|    if (keymgmt != NULL && tmp_keymgmt != NULL) {
  ------------------
  |  Branch (2076:9): [True: 982, False: 0]
  |  Branch (2076:28): [True: 982, False: 0]
  ------------------
 2077|    982|        *keymgmt = tmp_keymgmt;
 2078|    982|        allocated_keymgmt = NULL;
 2079|    982|    }
 2080|       |
 2081|    982|    EVP_KEYMGMT_free(allocated_keymgmt);
 2082|    982|    return keydata;
 2083|    982|}
evp_pkey_get_legacy:
 2177|  19.2k|{
 2178|  19.2k|    EVP_PKEY *tmp_copy = NULL;
 2179|  19.2k|    void *ret = NULL;
 2180|       |
 2181|  19.2k|    if (!ossl_assert(pk != NULL))
  ------------------
  |  |   52|  19.2k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  19.2k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2181:9): [True: 0, False: 19.2k]
  ------------------
 2182|      0|        return NULL;
 2183|       |
 2184|       |    /*
 2185|       |     * If this isn't an assigned provider side key, we just use any existing
 2186|       |     * origin legacy key.
 2187|       |     */
 2188|  19.2k|    if (!evp_pkey_is_assigned(pk))
  ------------------
  |  |  641|  19.2k|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (641:6): [True: 19.2k, False: 0]
  |  |  |  Branch (641:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2189|      0|        return NULL;
 2190|  19.2k|    if (!evp_pkey_is_provided(pk))
  ------------------
  |  |  649|  19.2k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (2190:9): [True: 19.2k, False: 0]
  ------------------
 2191|  19.2k|        return pk->pkey.ptr;
 2192|       |
 2193|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (2193:9): [True: 0, False: 0]
  ------------------
 2194|      0|        return NULL;
 2195|       |
 2196|      0|    ret = pk->legacy_cache_pkey.ptr;
 2197|       |
 2198|      0|    if (!CRYPTO_THREAD_unlock(pk->lock))
  ------------------
  |  Branch (2198:9): [True: 0, False: 0]
  ------------------
 2199|      0|        return NULL;
 2200|       |
 2201|      0|    if (ret != NULL)
  ------------------
  |  Branch (2201:9): [True: 0, False: 0]
  ------------------
 2202|      0|        return ret;
 2203|       |
 2204|      0|    if (!evp_pkey_copy_downgraded(&tmp_copy, pk))
  ------------------
  |  Branch (2204:9): [True: 0, False: 0]
  ------------------
 2205|      0|        goto err;
 2206|       |
 2207|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2207:9): [True: 0, False: 0]
  ------------------
 2208|      0|        goto err;
 2209|       |
 2210|       |    /* Check again in case some other thread has updated it in the meantime */
 2211|      0|    ret = pk->legacy_cache_pkey.ptr;
 2212|      0|    if (ret == NULL) {
  ------------------
  |  Branch (2212:9): [True: 0, False: 0]
  ------------------
 2213|       |        /* Steal the legacy key reference from the temporary copy */
 2214|      0|        ret = pk->legacy_cache_pkey.ptr = tmp_copy->pkey.ptr;
 2215|      0|        tmp_copy->pkey.ptr = NULL;
 2216|      0|    }
 2217|       |
 2218|      0|    if (!CRYPTO_THREAD_unlock(pk->lock)) {
  ------------------
  |  Branch (2218:9): [True: 0, False: 0]
  ------------------
 2219|      0|        ret = NULL;
 2220|      0|        goto err;
 2221|      0|    }
 2222|       |
 2223|      0| err:
 2224|      0|    EVP_PKEY_free(tmp_copy);
 2225|       |
 2226|      0|    return ret;
 2227|      0|}
p_lib.c:detect_foreign_key:
  760|  19.2k|{
  761|  19.2k|    switch (pkey->type) {
  762|  2.38k|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|  2.38k|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  2.38k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (762:5): [True: 2.38k, False: 16.8k]
  ------------------
  763|  6.62k|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|  6.62k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  6.62k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (763:5): [True: 4.23k, False: 15.0k]
  ------------------
  764|  6.62k|        pkey->foreign = pkey->pkey.rsa != NULL
  ------------------
  |  Branch (764:25): [True: 6.62k, False: 0]
  ------------------
  765|  6.62k|                        && ossl_rsa_is_foreign(pkey->pkey.rsa);
  ------------------
  |  Branch (765:28): [True: 0, False: 6.62k]
  ------------------
  766|  6.62k|        break;
  767|      0|#  ifndef OPENSSL_NO_EC
  768|  1.02k|    case EVP_PKEY_SM2:
  ------------------
  |  |   74|  1.02k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  1.02k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (768:5): [True: 1.02k, False: 18.2k]
  ------------------
  769|  1.02k|        break;
  770|  11.3k|    case EVP_PKEY_EC:
  ------------------
  |  |   73|  11.3k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  11.3k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (770:5): [True: 11.3k, False: 7.88k]
  ------------------
  771|  11.3k|        pkey->foreign = pkey->pkey.ec != NULL
  ------------------
  |  Branch (771:25): [True: 11.3k, False: 0]
  ------------------
  772|  11.3k|                        && ossl_ec_key_is_foreign(pkey->pkey.ec);
  ------------------
  |  Branch (772:28): [True: 0, False: 11.3k]
  ------------------
  773|  11.3k|        break;
  774|      0|#  endif
  775|      0|#  ifndef OPENSSL_NO_DSA
  776|     86|    case EVP_PKEY_DSA:
  ------------------
  |  |   66|     86|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|     86|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (776:5): [True: 86, False: 19.1k]
  ------------------
  777|     86|        pkey->foreign = pkey->pkey.dsa != NULL
  ------------------
  |  Branch (777:25): [True: 86, False: 0]
  ------------------
  778|     86|                        && ossl_dsa_is_foreign(pkey->pkey.dsa);
  ------------------
  |  Branch (778:28): [True: 0, False: 86]
  ------------------
  779|     86|        break;
  780|      0|#endif
  781|      0|#  ifndef OPENSSL_NO_DH
  782|      0|    case EVP_PKEY_DH:
  ------------------
  |  |   71|      0|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|      0|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (782:5): [True: 0, False: 19.2k]
  ------------------
  783|      0|        pkey->foreign = pkey->pkey.dh != NULL
  ------------------
  |  Branch (783:25): [True: 0, False: 0]
  ------------------
  784|      0|                        && ossl_dh_is_foreign(pkey->pkey.dh);
  ------------------
  |  Branch (784:28): [True: 0, False: 0]
  ------------------
  785|      0|        break;
  786|      0|#endif
  787|    152|    default:
  ------------------
  |  Branch (787:5): [True: 152, False: 19.1k]
  ------------------
  788|    152|        pkey->foreign = 0;
  789|    152|        break;
  790|  19.2k|    }
  791|  19.2k|}
p_lib.c:evp_pkey_get0_DSA_int:
  890|     86|{
  891|     86|    if (pkey->type != EVP_PKEY_DSA) {
  ------------------
  |  |   66|     86|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|     86|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (891:9): [True: 0, False: 86]
  ------------------
  892|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  893|      0|        return NULL;
  894|      0|    }
  895|     86|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  896|     86|}
p_lib.c:evp_pkey_get1_ECX_KEY:
  939|      9|{
  940|      9|    ECX_KEY *ret = (ECX_KEY *)evp_pkey_get0_ECX_KEY(pkey, type);
  941|       |
  942|      9|    if (ret != NULL && !ossl_ecx_key_up_ref(ret))
  ------------------
  |  Branch (942:9): [True: 9, False: 0]
  |  Branch (942:24): [True: 0, False: 9]
  ------------------
  943|      0|        ret = NULL;
  944|      9|    return ret;
  945|      9|}
p_lib.c:evp_pkey_get0_ECX_KEY:
  930|      9|{
  931|      9|    if (EVP_PKEY_get_base_id(pkey) != type) {
  ------------------
  |  Branch (931:9): [True: 0, False: 9]
  ------------------
  932|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_ECX_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  933|      0|        return NULL;
  934|      0|    }
  935|      9|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  936|      9|}
p_lib.c:pkey_set_type:
 1558|   152k|{
 1559|   152k|#ifndef FIPS_MODULE
 1560|   152k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1561|   152k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1561:21): [True: 152k, False: 0]
  ------------------
 1562|   152k|#endif
 1563|       |
 1564|       |    /*
 1565|       |     * The setups can't set both legacy and provider side methods.
 1566|       |     * It is forbidden
 1567|       |     */
 1568|   152k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|   305k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 82.9k, False: 69.8k]
  |  |  |  Branch (52:43): [True: 69.8k, False: 0]
  |  |  ------------------
  |  |   53|   305k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1568:9): [True: 0, False: 152k]
  ------------------
 1569|   152k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|   152k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 152k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|   152k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1569:12): [True: 0, False: 152k]
  ------------------
 1570|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1571|      0|        return 0;
 1572|      0|    }
 1573|       |
 1574|   152k|    if (pkey != NULL) {
  ------------------
  |  Branch (1574:9): [True: 89.0k, False: 63.7k]
  ------------------
 1575|  89.0k|        int free_it = 0;
 1576|       |
 1577|  89.0k|#ifndef FIPS_MODULE
 1578|  89.0k|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1578:19): [True: 0, False: 89.0k]
  |  Branch (1578:30): [True: 0, False: 89.0k]
  ------------------
 1579|  89.0k|#endif
 1580|  89.0k|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1580:19): [True: 0, False: 89.0k]
  |  Branch (1580:30): [True: 0, False: 89.0k]
  ------------------
 1581|  89.0k|        if (free_it)
  ------------------
  |  Branch (1581:13): [True: 0, False: 89.0k]
  ------------------
 1582|      0|            evp_pkey_free_it(pkey);
 1583|  89.0k|#ifndef FIPS_MODULE
 1584|       |        /*
 1585|       |         * If key type matches and a method exists then this lookup has
 1586|       |         * succeeded once so just indicate success.
 1587|       |         */
 1588|  89.0k|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   62|  89.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|   178k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1588:13): [True: 19.2k, False: 69.7k]
  ------------------
 1589|  89.0k|            && type == pkey->save_type
  ------------------
  |  Branch (1589:16): [True: 18.2k, False: 1.02k]
  ------------------
 1590|  89.0k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1590:16): [True: 18.2k, False: 0]
  ------------------
 1591|  18.2k|            return 1;
 1592|  70.8k|# ifndef OPENSSL_NO_ENGINE
 1593|       |        /* If we have ENGINEs release them */
 1594|  70.8k|        ENGINE_finish(pkey->engine);
 1595|  70.8k|        pkey->engine = NULL;
 1596|  70.8k|        ENGINE_finish(pkey->pmeth_engine);
 1597|  70.8k|        pkey->pmeth_engine = NULL;
 1598|  70.8k|# endif
 1599|  70.8k|#endif
 1600|  70.8k|    }
 1601|   134k|#ifndef FIPS_MODULE
 1602|   134k|    if (str != NULL)
  ------------------
  |  Branch (1602:9): [True: 81.9k, False: 52.5k]
  ------------------
 1603|  81.9k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1604|  52.5k|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   62|  52.5k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  52.5k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1604:14): [True: 51.5k, False: 1.02k]
  ------------------
 1605|  51.5k|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1606|   134k|# ifndef OPENSSL_NO_ENGINE
 1607|   134k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1607:9): [True: 63.7k, False: 70.8k]
  |  Branch (1607:25): [True: 63.7k, False: 0]
  ------------------
 1608|  63.7k|        ENGINE_finish(e);
 1609|   134k|# endif
 1610|   134k|#endif
 1611|       |
 1612|       |
 1613|   134k|    {
 1614|   134k|        int check = 1;
 1615|       |
 1616|   134k|#ifndef FIPS_MODULE
 1617|   134k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1617:17): [True: 134k, False: 0]
  |  Branch (1617:26): [True: 46.4k, False: 88.0k]
  ------------------
 1618|   134k|#endif
 1619|   134k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1619:17): [True: 46.4k, False: 88.0k]
  |  Branch (1619:26): [True: 45.4k, False: 1.02k]
  ------------------
 1620|   134k|        if (check) {
  ------------------
  |  Branch (1620:13): [True: 45.4k, False: 89.0k]
  ------------------
 1621|  45.4k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  45.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  45.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  45.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  45.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  45.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  45.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  45.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1622|  45.4k|            return 0;
 1623|  45.4k|        }
 1624|   134k|    }
 1625|  89.0k|    if (pkey != NULL) {
  ------------------
  |  Branch (1625:9): [True: 70.8k, False: 18.2k]
  ------------------
 1626|  70.8k|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1626:13): [True: 19.2k, False: 51.5k]
  |  Branch (1626:32): [True: 0, False: 19.2k]
  ------------------
 1627|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1628|      0|            return 0;
 1629|      0|        }
 1630|       |
 1631|  70.8k|        pkey->keymgmt = keymgmt;
 1632|       |
 1633|  70.8k|        pkey->save_type = type;
 1634|  70.8k|        pkey->type = type;
 1635|       |
 1636|  70.8k|#ifndef FIPS_MODULE
 1637|       |        /*
 1638|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1639|       |         * The main reason is that |ameth| is one factor to detect that the
 1640|       |         * internal "origin" key is a legacy one.
 1641|       |         */
 1642|  70.8k|        if (keymgmt == NULL)
  ------------------
  |  Branch (1642:13): [True: 51.5k, False: 19.2k]
  ------------------
 1643|  51.5k|            pkey->ameth = ameth;
 1644|       |
 1645|       |        /*
 1646|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1647|       |         * for any key type that has a legacy implementation, regardless of
 1648|       |         * if the internal key is a legacy or a provider side one.  When
 1649|       |         * there is no legacy implementation for the key, the type becomes
 1650|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1651|       |         * with functions that expect legacy internal keys.
 1652|       |         */
 1653|  70.8k|        if (ameth != NULL) {
  ------------------
  |  Branch (1653:13): [True: 69.7k, False: 1.02k]
  ------------------
 1654|  69.7k|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   62|  69.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  69.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1654:17): [True: 18.2k, False: 51.5k]
  ------------------
 1655|  18.2k|                pkey->type = ameth->pkey_id;
 1656|  69.7k|        } else {
 1657|  1.02k|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |  103|  1.02k|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1658|  1.02k|        }
 1659|  70.8k|# ifndef OPENSSL_NO_ENGINE
 1660|  70.8k|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1660:13): [True: 0, False: 70.8k]
  |  Branch (1660:29): [True: 0, False: 0]
  |  Branch (1660:42): [True: 0, False: 0]
  ------------------
 1661|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1662|      0|            return 0;
 1663|      0|        }
 1664|  70.8k|# endif
 1665|  70.8k|        pkey->engine = e;
 1666|  70.8k|#endif
 1667|  70.8k|    }
 1668|  89.0k|    return 1;
 1669|  89.0k|}
p_lib.c:find_ameth:
 1673|  63.7k|{
 1674|  63.7k|    const char **str = data;
 1675|       |
 1676|       |    /*
 1677|       |     * The error messages from pkey_set_type() are uninteresting here,
 1678|       |     * and misleading.
 1679|       |     */
 1680|  63.7k|    ERR_set_mark();
 1681|       |
 1682|  63.7k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   62|  63.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  63.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1682:9): [True: 18.2k, False: 45.4k]
  ------------------
 1683|  63.7k|                      NULL)) {
 1684|  18.2k|        if (str[0] == NULL)
  ------------------
  |  Branch (1684:13): [True: 18.2k, False: 0]
  ------------------
 1685|  18.2k|            str[0] = name;
 1686|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1686:18): [True: 0, False: 0]
  ------------------
 1687|      0|            str[1] = name;
 1688|  18.2k|    }
 1689|       |
 1690|  63.7k|    ERR_pop_to_mark();
 1691|  63.7k|}
p_lib.c:evp_pkey_free_it:
 1834|  69.7k|{
 1835|       |    /* internal function; x is never NULL */
 1836|  69.7k|    evp_keymgmt_util_clear_operation_cache(x);
 1837|  69.7k|#ifndef FIPS_MODULE
 1838|  69.7k|    evp_pkey_free_legacy(x);
 1839|  69.7k|#endif
 1840|       |
 1841|  69.7k|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1841:9): [True: 19.2k, False: 50.5k]
  ------------------
 1842|  19.2k|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1843|  19.2k|        EVP_KEYMGMT_free(x->keymgmt);
 1844|  19.2k|        x->keymgmt = NULL;
 1845|  19.2k|        x->keydata = NULL;
 1846|  19.2k|    }
 1847|  69.7k|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|  69.7k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  69.7k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1848|  69.7k|}

evp_pkey_ctx_state:
  139|  2.98k|{
  140|  2.98k|    if (ctx->operation == EVP_PKEY_OP_UNDEFINED)
  ------------------
  |  | 1744|  2.98k|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  |  Branch (140:9): [True: 0, False: 2.98k]
  ------------------
  141|      0|        return EVP_PKEY_STATE_UNKNOWN;
  ------------------
  |  |  946|      0|# define EVP_PKEY_STATE_UNKNOWN         0
  ------------------
  142|       |
  143|  2.98k|    if ((EVP_PKEY_CTX_IS_DERIVE_OP(ctx)
  ------------------
  |  |  744|  5.97k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|  2.98k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|  2.98k|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 2.98k]
  |  |  ------------------
  ------------------
  144|  2.98k|         && ctx->op.kex.algctx != NULL)
  ------------------
  |  Branch (144:13): [True: 0, False: 0]
  ------------------
  145|  2.98k|        || (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)
  ------------------
  |  |  741|  5.97k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|  2.98k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|  2.98k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|  2.98k|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|  2.98k|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|  2.98k|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|  2.98k|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|  2.98k|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|  2.98k|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|  2.98k|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|  2.98k|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|  2.98k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 2.98k, False: 0]
  |  |  ------------------
  ------------------
  146|  2.98k|            && ctx->op.sig.algctx != NULL)
  ------------------
  |  Branch (146:16): [True: 2.98k, False: 0]
  ------------------
  147|  2.98k|        || (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)
  ------------------
  |  |  747|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|      0|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|      0|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|      0|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  148|      0|            && ctx->op.ciph.algctx != NULL)
  ------------------
  |  Branch (148:16): [True: 0, False: 0]
  ------------------
  149|  2.98k|        || (EVP_PKEY_CTX_IS_GEN_OP(ctx)
  ------------------
  |  |  750|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|      0|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  150|      0|            && ctx->op.keymgmt.genctx != NULL)
  ------------------
  |  Branch (150:16): [True: 0, False: 0]
  ------------------
  151|  2.98k|        || (EVP_PKEY_CTX_IS_KEM_OP(ctx)
  ------------------
  |  |  756|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|      0|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|      0|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|      0|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  152|      0|            && ctx->op.encap.algctx != NULL))
  ------------------
  |  Branch (152:16): [True: 0, False: 0]
  ------------------
  153|  2.98k|        return EVP_PKEY_STATE_PROVIDER;
  ------------------
  |  |  948|  2.98k|# define EVP_PKEY_STATE_PROVIDER        2
  ------------------
  154|       |
  155|      0|    return EVP_PKEY_STATE_LEGACY;
  ------------------
  |  |  947|      0|# define EVP_PKEY_STATE_LEGACY          1
  ------------------
  156|  2.98k|}
EVP_PKEY_CTX_new_from_pkey:
  354|  1.13k|{
  355|  1.13k|    return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
  356|  1.13k|}
evp_pkey_ctx_free_old_ops:
  359|  3.02k|{
  360|  3.02k|    if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)) {
  ------------------
  |  |  741|  3.02k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|  3.02k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|  3.02k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|  3.02k|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|  3.02k|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|  3.02k|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|  3.02k|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|  3.02k|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|  3.02k|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|  3.02k|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|  3.02k|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|  3.02k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 1.94k, False: 1.07k]
  |  |  ------------------
  ------------------
  361|  1.94k|        if (ctx->op.sig.algctx != NULL && ctx->op.sig.signature != NULL)
  ------------------
  |  Branch (361:13): [True: 1.94k, False: 0]
  |  Branch (361:43): [True: 1.94k, False: 0]
  ------------------
  362|  1.94k|            ctx->op.sig.signature->freectx(ctx->op.sig.algctx);
  363|  1.94k|        EVP_SIGNATURE_free(ctx->op.sig.signature);
  364|  1.94k|        ctx->op.sig.algctx = NULL;
  365|  1.94k|        ctx->op.sig.signature = NULL;
  366|  1.94k|    } else if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) {
  ------------------
  |  |  744|  1.07k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|  1.07k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|  1.07k|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 1.07k]
  |  |  ------------------
  ------------------
  367|      0|        if (ctx->op.kex.algctx != NULL && ctx->op.kex.exchange != NULL)
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  |  Branch (367:43): [True: 0, False: 0]
  ------------------
  368|      0|            ctx->op.kex.exchange->freectx(ctx->op.kex.algctx);
  369|      0|        EVP_KEYEXCH_free(ctx->op.kex.exchange);
  370|      0|        ctx->op.kex.algctx = NULL;
  371|      0|        ctx->op.kex.exchange = NULL;
  372|  1.07k|    } else if (EVP_PKEY_CTX_IS_KEM_OP(ctx)) {
  ------------------
  |  |  756|  1.07k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|  1.07k|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|  1.07k|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|  1.07k|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 1.07k]
  |  |  ------------------
  ------------------
  373|      0|        if (ctx->op.encap.algctx != NULL && ctx->op.encap.kem != NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 0]
  |  Branch (373:45): [True: 0, False: 0]
  ------------------
  374|      0|            ctx->op.encap.kem->freectx(ctx->op.encap.algctx);
  375|      0|        EVP_KEM_free(ctx->op.encap.kem);
  376|      0|        ctx->op.encap.algctx = NULL;
  377|      0|        ctx->op.encap.kem = NULL;
  378|      0|    }
  379|  1.07k|    else if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)) {
  ------------------
  |  |  747|  1.07k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|  1.07k|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|  1.07k|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|  1.07k|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 1.07k]
  |  |  ------------------
  ------------------
  380|      0|        if (ctx->op.ciph.algctx != NULL && ctx->op.ciph.cipher != NULL)
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  |  Branch (380:44): [True: 0, False: 0]
  ------------------
  381|      0|            ctx->op.ciph.cipher->freectx(ctx->op.ciph.algctx);
  382|      0|        EVP_ASYM_CIPHER_free(ctx->op.ciph.cipher);
  383|      0|        ctx->op.ciph.algctx = NULL;
  384|      0|        ctx->op.ciph.cipher = NULL;
  385|  1.07k|    } else if (EVP_PKEY_CTX_IS_GEN_OP(ctx)) {
  ------------------
  |  |  750|  1.07k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|  1.07k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|  1.07k|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|  1.07k|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 1.07k]
  |  |  ------------------
  ------------------
  386|      0|        if (ctx->op.keymgmt.genctx != NULL && ctx->keymgmt != NULL)
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  |  Branch (386:47): [True: 0, False: 0]
  ------------------
  387|      0|            evp_keymgmt_gen_cleanup(ctx->keymgmt, ctx->op.keymgmt.genctx);
  388|      0|    }
  389|  3.02k|}
EVP_PKEY_CTX_free:
  392|  8.60k|{
  393|  8.60k|    if (ctx == NULL)
  ------------------
  |  Branch (393:9): [True: 6.56k, False: 2.04k]
  ------------------
  394|  6.56k|        return;
  395|  2.04k|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (395:9): [True: 0, False: 2.04k]
  |  Branch (395:23): [True: 0, False: 0]
  ------------------
  396|      0|        ctx->pmeth->cleanup(ctx);
  397|       |
  398|  2.04k|    evp_pkey_ctx_free_old_ops(ctx);
  399|  2.04k|#ifndef FIPS_MODULE
  400|  2.04k|    evp_pkey_ctx_free_all_cached_data(ctx);
  401|  2.04k|#endif
  402|  2.04k|    EVP_KEYMGMT_free(ctx->keymgmt);
  403|       |
  404|  2.04k|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  115|  2.04k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.04k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.04k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  405|  2.04k|    EVP_PKEY_free(ctx->pkey);
  406|  2.04k|    EVP_PKEY_free(ctx->peerkey);
  407|  2.04k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  408|  2.04k|    ENGINE_finish(ctx->engine);
  409|  2.04k|#endif
  410|  2.04k|    BN_free(ctx->rsa_pubexp);
  411|  2.04k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  2.04k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.04k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.04k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|  2.04k|}
EVP_PKEY_CTX_dup:
  454|    965|{
  455|    965|    EVP_PKEY_CTX *rctx;
  456|       |
  457|    965|# ifndef OPENSSL_NO_ENGINE
  458|       |    /* Make sure it's safe to copy a pkey context using an ENGINE */
  459|    965|    if (pctx->engine && !ENGINE_init(pctx->engine)) {
  ------------------
  |  Branch (459:9): [True: 0, False: 965]
  |  Branch (459:25): [True: 0, False: 0]
  ------------------
  460|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  461|      0|        return 0;
  462|      0|    }
  463|    965|# endif
  464|    965|    rctx = OPENSSL_zalloc(sizeof(*rctx));
  ------------------
  |  |  104|    965|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    965|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    965|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|    965|    if (rctx == NULL)
  ------------------
  |  Branch (465:9): [True: 0, False: 965]
  ------------------
  466|      0|        return NULL;
  467|       |
  468|    965|    if (pctx->pkey != NULL && !EVP_PKEY_up_ref(pctx->pkey))
  ------------------
  |  Branch (468:9): [True: 965, False: 0]
  |  Branch (468:31): [True: 0, False: 965]
  ------------------
  469|      0|        goto err;
  470|       |
  471|    965|    rctx->pkey = pctx->pkey;
  472|    965|    rctx->operation = pctx->operation;
  473|    965|    rctx->libctx = pctx->libctx;
  474|    965|    rctx->keytype = pctx->keytype;
  475|    965|    rctx->propquery = NULL;
  476|    965|    if (pctx->propquery != NULL) {
  ------------------
  |  Branch (476:9): [True: 0, False: 965]
  ------------------
  477|      0|        rctx->propquery = OPENSSL_strdup(pctx->propquery);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  478|      0|        if (rctx->propquery == NULL)
  ------------------
  |  Branch (478:13): [True: 0, False: 0]
  ------------------
  479|      0|            goto err;
  480|      0|    }
  481|    965|    rctx->legacy_keytype = pctx->legacy_keytype;
  482|       |
  483|    965|    if (pctx->keymgmt != NULL) {
  ------------------
  |  Branch (483:9): [True: 965, False: 0]
  ------------------
  484|    965|        if (!EVP_KEYMGMT_up_ref(pctx->keymgmt))
  ------------------
  |  Branch (484:13): [True: 0, False: 965]
  ------------------
  485|      0|            goto err;
  486|    965|        rctx->keymgmt = pctx->keymgmt;
  487|    965|    }
  488|       |
  489|    965|    if (EVP_PKEY_CTX_IS_DERIVE_OP(pctx)) {
  ------------------
  |  |  744|    965|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|    965|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|    965|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 965]
  |  |  ------------------
  ------------------
  490|      0|        if (pctx->op.kex.exchange != NULL) {
  ------------------
  |  Branch (490:13): [True: 0, False: 0]
  ------------------
  491|      0|            rctx->op.kex.exchange = pctx->op.kex.exchange;
  492|      0|            if (!EVP_KEYEXCH_up_ref(rctx->op.kex.exchange))
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                goto err;
  494|      0|        }
  495|      0|        if (pctx->op.kex.algctx != NULL) {
  ------------------
  |  Branch (495:13): [True: 0, False: 0]
  ------------------
  496|      0|            if (!ossl_assert(pctx->op.kex.exchange != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (496:17): [True: 0, False: 0]
  ------------------
  497|      0|                goto err;
  498|       |
  499|      0|            if (pctx->op.kex.exchange->dupctx != NULL)
  ------------------
  |  Branch (499:17): [True: 0, False: 0]
  ------------------
  500|      0|                rctx->op.kex.algctx
  501|      0|                    = pctx->op.kex.exchange->dupctx(pctx->op.kex.algctx);
  502|       |
  503|      0|            if (rctx->op.kex.algctx == NULL) {
  ------------------
  |  Branch (503:17): [True: 0, False: 0]
  ------------------
  504|      0|                EVP_KEYEXCH_free(rctx->op.kex.exchange);
  505|      0|                rctx->op.kex.exchange = NULL;
  506|      0|                goto err;
  507|      0|            }
  508|      0|            return rctx;
  509|      0|        }
  510|    965|    } else if (EVP_PKEY_CTX_IS_SIGNATURE_OP(pctx)) {
  ------------------
  |  |  741|    965|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|    965|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|    965|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|    965|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|    965|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|    965|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|    965|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|    965|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|    965|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|    965|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|    965|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|    965|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 965, False: 0]
  |  |  ------------------
  ------------------
  511|    965|        if (pctx->op.sig.signature != NULL) {
  ------------------
  |  Branch (511:13): [True: 965, False: 0]
  ------------------
  512|    965|            rctx->op.sig.signature = pctx->op.sig.signature;
  513|    965|            if (!EVP_SIGNATURE_up_ref(rctx->op.sig.signature))
  ------------------
  |  Branch (513:17): [True: 0, False: 965]
  ------------------
  514|      0|                goto err;
  515|    965|        }
  516|    965|        if (pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (516:13): [True: 965, False: 0]
  ------------------
  517|    965|            if (!ossl_assert(pctx->op.sig.signature != NULL))
  ------------------
  |  |   52|    965|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    965|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (517:17): [True: 0, False: 965]
  ------------------
  518|      0|                goto err;
  519|       |
  520|    965|            if (pctx->op.sig.signature->dupctx != NULL)
  ------------------
  |  Branch (520:17): [True: 965, False: 0]
  ------------------
  521|    965|                rctx->op.sig.algctx
  522|    965|                    = pctx->op.sig.signature->dupctx(pctx->op.sig.algctx);
  523|       |
  524|    965|            if (rctx->op.sig.algctx == NULL) {
  ------------------
  |  Branch (524:17): [True: 0, False: 965]
  ------------------
  525|      0|                EVP_SIGNATURE_free(rctx->op.sig.signature);
  526|      0|                rctx->op.sig.signature = NULL;
  527|      0|                goto err;
  528|      0|            }
  529|    965|            return rctx;
  530|    965|        }
  531|    965|    } else if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(pctx)) {
  ------------------
  |  |  747|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|      0|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|      0|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|      0|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  532|      0|        if (pctx->op.ciph.cipher != NULL) {
  ------------------
  |  Branch (532:13): [True: 0, False: 0]
  ------------------
  533|      0|            rctx->op.ciph.cipher = pctx->op.ciph.cipher;
  534|      0|            if (!EVP_ASYM_CIPHER_up_ref(rctx->op.ciph.cipher))
  ------------------
  |  Branch (534:17): [True: 0, False: 0]
  ------------------
  535|      0|                goto err;
  536|      0|        }
  537|      0|        if (pctx->op.ciph.algctx != NULL) {
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  ------------------
  538|      0|            if (!ossl_assert(pctx->op.ciph.cipher != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (538:17): [True: 0, False: 0]
  ------------------
  539|      0|                goto err;
  540|       |
  541|      0|            if (pctx->op.ciph.cipher->dupctx != NULL)
  ------------------
  |  Branch (541:17): [True: 0, False: 0]
  ------------------
  542|      0|                rctx->op.ciph.algctx
  543|      0|                    = pctx->op.ciph.cipher->dupctx(pctx->op.ciph.algctx);
  544|       |
  545|      0|            if (rctx->op.ciph.algctx == NULL) {
  ------------------
  |  Branch (545:17): [True: 0, False: 0]
  ------------------
  546|      0|                EVP_ASYM_CIPHER_free(rctx->op.ciph.cipher);
  547|      0|                rctx->op.ciph.cipher = NULL;
  548|      0|                goto err;
  549|      0|            }
  550|      0|            return rctx;
  551|      0|        }
  552|      0|    } else if (EVP_PKEY_CTX_IS_KEM_OP(pctx)) {
  ------------------
  |  |  756|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|      0|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|      0|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|      0|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  553|      0|        if (pctx->op.encap.kem != NULL) {
  ------------------
  |  Branch (553:13): [True: 0, False: 0]
  ------------------
  554|      0|            rctx->op.encap.kem = pctx->op.encap.kem;
  555|      0|            if (!EVP_KEM_up_ref(rctx->op.encap.kem))
  ------------------
  |  Branch (555:17): [True: 0, False: 0]
  ------------------
  556|      0|                goto err;
  557|      0|        }
  558|      0|        if (pctx->op.encap.algctx != NULL) {
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|            if (!ossl_assert(pctx->op.encap.kem != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (559:17): [True: 0, False: 0]
  ------------------
  560|      0|                goto err;
  561|       |
  562|      0|            if (pctx->op.encap.kem->dupctx != NULL)
  ------------------
  |  Branch (562:17): [True: 0, False: 0]
  ------------------
  563|      0|                rctx->op.encap.algctx
  564|      0|                    = pctx->op.encap.kem->dupctx(pctx->op.encap.algctx);
  565|       |
  566|      0|            if (rctx->op.encap.algctx == NULL) {
  ------------------
  |  Branch (566:17): [True: 0, False: 0]
  ------------------
  567|      0|                EVP_KEM_free(rctx->op.encap.kem);
  568|      0|                rctx->op.encap.kem = NULL;
  569|      0|                goto err;
  570|      0|            }
  571|      0|            return rctx;
  572|      0|        }
  573|      0|    } else if (EVP_PKEY_CTX_IS_GEN_OP(pctx)) {
  ------------------
  |  |  750|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|      0|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  574|       |        /* Not supported - This would need a gen_dupctx() to work */
  575|      0|        goto err;
  576|      0|    }
  577|       |
  578|      0|    rctx->pmeth = pctx->pmeth;
  579|      0|# ifndef OPENSSL_NO_ENGINE
  580|      0|    rctx->engine = pctx->engine;
  581|      0|# endif
  582|       |
  583|      0|    if (pctx->peerkey != NULL && !EVP_PKEY_up_ref(pctx->peerkey))
  ------------------
  |  Branch (583:9): [True: 0, False: 0]
  |  Branch (583:34): [True: 0, False: 0]
  ------------------
  584|      0|        goto err;
  585|       |
  586|      0|    rctx->peerkey = pctx->peerkey;
  587|       |
  588|      0|    if (pctx->pmeth == NULL) {
  ------------------
  |  Branch (588:9): [True: 0, False: 0]
  ------------------
  589|      0|        if (rctx->operation == EVP_PKEY_OP_UNDEFINED) {
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  |  Branch (589:13): [True: 0, False: 0]
  ------------------
  590|      0|            EVP_KEYMGMT *tmp_keymgmt = pctx->keymgmt;
  591|      0|            void *provkey;
  592|       |
  593|      0|            if (pctx->pkey == NULL)
  ------------------
  |  Branch (593:17): [True: 0, False: 0]
  ------------------
  594|      0|                return rctx;
  595|       |
  596|      0|            provkey = evp_pkey_export_to_provider(pctx->pkey, pctx->libctx,
  597|      0|                                                  &tmp_keymgmt, pctx->propquery);
  598|      0|            if (provkey == NULL)
  ------------------
  |  Branch (598:17): [True: 0, False: 0]
  ------------------
  599|      0|                goto err;
  600|      0|            if (!EVP_KEYMGMT_up_ref(tmp_keymgmt))
  ------------------
  |  Branch (600:17): [True: 0, False: 0]
  ------------------
  601|      0|                goto err;
  602|      0|            EVP_KEYMGMT_free(rctx->keymgmt);
  603|      0|            rctx->keymgmt = tmp_keymgmt;
  604|      0|            return rctx;
  605|      0|        }
  606|      0|    } else if (pctx->pmeth->copy(rctx, pctx) > 0) {
  ------------------
  |  Branch (606:16): [True: 0, False: 0]
  ------------------
  607|      0|        return rctx;
  608|      0|    }
  609|      0|err:
  610|      0|    rctx->pmeth = NULL;
  611|      0|    EVP_PKEY_CTX_free(rctx);
  612|      0|    return NULL;
  613|      0|}
evp_app_cleanup_int:
  633|      2|{
  634|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 2]
  ------------------
  635|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  636|      2|}
EVP_PKEY_CTX_set_params:
  679|  1.49k|{
  680|  1.49k|    switch (evp_pkey_ctx_state(ctx)) {
  ------------------
  |  Branch (680:13): [True: 0, False: 1.49k]
  ------------------
  681|  1.49k|    case EVP_PKEY_STATE_PROVIDER:
  ------------------
  |  |  948|  1.49k|# define EVP_PKEY_STATE_PROVIDER        2
  ------------------
  |  Branch (681:5): [True: 1.49k, False: 0]
  ------------------
  682|  1.49k|        if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)
  ------------------
  |  |  744|  2.98k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|  1.49k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|  1.49k|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 1.49k]
  |  |  ------------------
  ------------------
  683|  1.49k|            && ctx->op.kex.exchange != NULL
  ------------------
  |  Branch (683:16): [True: 0, False: 0]
  ------------------
  684|  1.49k|            && ctx->op.kex.exchange->set_ctx_params != NULL)
  ------------------
  |  Branch (684:16): [True: 0, False: 0]
  ------------------
  685|      0|            return
  686|      0|                ctx->op.kex.exchange->set_ctx_params(ctx->op.kex.algctx,
  687|      0|                                                     params);
  688|  1.49k|        if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)
  ------------------
  |  |  741|  2.98k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|  1.49k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|  1.49k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|  1.49k|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|  1.49k|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|  1.49k|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|  1.49k|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|  1.49k|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|  1.49k|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|  1.49k|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|  1.49k|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|  1.49k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 1.49k, False: 0]
  |  |  ------------------
  ------------------
  689|  1.49k|            && ctx->op.sig.signature != NULL
  ------------------
  |  Branch (689:16): [True: 1.49k, False: 0]
  ------------------
  690|  1.49k|            && ctx->op.sig.signature->set_ctx_params != NULL)
  ------------------
  |  Branch (690:16): [True: 1.49k, False: 0]
  ------------------
  691|  1.49k|            return
  692|  1.49k|                ctx->op.sig.signature->set_ctx_params(ctx->op.sig.algctx,
  693|  1.49k|                                                      params);
  694|      0|        if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)
  ------------------
  |  |  747|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|      0|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|      0|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|      0|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  695|      0|            && ctx->op.ciph.cipher != NULL
  ------------------
  |  Branch (695:16): [True: 0, False: 0]
  ------------------
  696|      0|            && ctx->op.ciph.cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (696:16): [True: 0, False: 0]
  ------------------
  697|      0|            return
  698|      0|                ctx->op.ciph.cipher->set_ctx_params(ctx->op.ciph.algctx,
  699|      0|                                                    params);
  700|      0|        if (EVP_PKEY_CTX_IS_GEN_OP(ctx)
  ------------------
  |  |  750|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|      0|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  701|      0|            && ctx->keymgmt != NULL
  ------------------
  |  Branch (701:16): [True: 0, False: 0]
  ------------------
  702|      0|            && ctx->keymgmt->gen_set_params != NULL)
  ------------------
  |  Branch (702:16): [True: 0, False: 0]
  ------------------
  703|      0|            return
  704|      0|                evp_keymgmt_gen_set_params(ctx->keymgmt, ctx->op.keymgmt.genctx,
  705|      0|                                           params);
  706|      0|        if (EVP_PKEY_CTX_IS_KEM_OP(ctx)
  ------------------
  |  |  756|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|      0|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|      0|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|      0|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  707|      0|            && ctx->op.encap.kem != NULL
  ------------------
  |  Branch (707:16): [True: 0, False: 0]
  ------------------
  708|      0|            && ctx->op.encap.kem->set_ctx_params != NULL)
  ------------------
  |  Branch (708:16): [True: 0, False: 0]
  ------------------
  709|      0|            return
  710|      0|                ctx->op.encap.kem->set_ctx_params(ctx->op.encap.algctx,
  711|      0|                                                  params);
  712|      0|        break;
  713|      0|    case EVP_PKEY_STATE_UNKNOWN:
  ------------------
  |  |  946|      0|# define EVP_PKEY_STATE_UNKNOWN         0
  ------------------
  |  Branch (713:5): [True: 0, False: 1.49k]
  ------------------
  714|      0|        break;
  715|      0|#ifndef FIPS_MODULE
  716|      0|    case EVP_PKEY_STATE_LEGACY:
  ------------------
  |  |  947|      0|# define EVP_PKEY_STATE_LEGACY          1
  ------------------
  |  Branch (716:5): [True: 0, False: 1.49k]
  ------------------
  717|      0|        return evp_pkey_ctx_set_params_to_ctrl(ctx, params);
  718|  1.49k|#endif
  719|  1.49k|    }
  720|      0|    return 0;
  721|  1.49k|}
EVP_PKEY_CTX_settable_params:
  814|  1.49k|{
  815|  1.49k|    void *provctx;
  816|       |
  817|  1.49k|    if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)
  ------------------
  |  |  744|  2.98k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|  1.49k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|  1.49k|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 1.49k]
  |  |  ------------------
  ------------------
  818|  1.49k|            && ctx->op.kex.exchange != NULL
  ------------------
  |  Branch (818:16): [True: 0, False: 0]
  ------------------
  819|  1.49k|            && ctx->op.kex.exchange->settable_ctx_params != NULL) {
  ------------------
  |  Branch (819:16): [True: 0, False: 0]
  ------------------
  820|      0|        provctx = ossl_provider_ctx(EVP_KEYEXCH_get0_provider(ctx->op.kex.exchange));
  821|      0|        return ctx->op.kex.exchange->settable_ctx_params(ctx->op.kex.algctx,
  822|      0|                                                         provctx);
  823|      0|    }
  824|  1.49k|    if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)
  ------------------
  |  |  741|  2.98k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|  1.49k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|  1.49k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|  1.49k|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|  1.49k|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|  1.49k|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|  1.49k|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|  1.49k|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|  1.49k|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|  1.49k|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|  1.49k|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|  1.49k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 1.49k, False: 0]
  |  |  ------------------
  ------------------
  825|  1.49k|            && ctx->op.sig.signature != NULL
  ------------------
  |  Branch (825:16): [True: 1.49k, False: 0]
  ------------------
  826|  1.49k|            && ctx->op.sig.signature->settable_ctx_params != NULL) {
  ------------------
  |  Branch (826:16): [True: 1.49k, False: 0]
  ------------------
  827|  1.49k|        provctx = ossl_provider_ctx(
  828|  1.49k|                      EVP_SIGNATURE_get0_provider(ctx->op.sig.signature));
  829|  1.49k|        return ctx->op.sig.signature->settable_ctx_params(ctx->op.sig.algctx,
  830|  1.49k|                                                          provctx);
  831|  1.49k|    }
  832|      0|    if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)
  ------------------
  |  |  747|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|      0|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|      0|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|      0|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  833|      0|            && ctx->op.ciph.cipher != NULL
  ------------------
  |  Branch (833:16): [True: 0, False: 0]
  ------------------
  834|      0|            && ctx->op.ciph.cipher->settable_ctx_params != NULL) {
  ------------------
  |  Branch (834:16): [True: 0, False: 0]
  ------------------
  835|      0|        provctx = ossl_provider_ctx(
  836|      0|                      EVP_ASYM_CIPHER_get0_provider(ctx->op.ciph.cipher));
  837|      0|        return ctx->op.ciph.cipher->settable_ctx_params(ctx->op.ciph.algctx,
  838|      0|                                                        provctx);
  839|      0|    }
  840|      0|    if (EVP_PKEY_CTX_IS_GEN_OP(ctx)
  ------------------
  |  |  750|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|      0|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  841|      0|            && ctx->keymgmt != NULL
  ------------------
  |  Branch (841:16): [True: 0, False: 0]
  ------------------
  842|      0|            && ctx->keymgmt->gen_settable_params != NULL) {
  ------------------
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|        provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(ctx->keymgmt));
  844|      0|        return ctx->keymgmt->gen_settable_params(ctx->op.keymgmt.genctx,
  845|      0|                                                 provctx);
  846|      0|    }
  847|      0|    if (EVP_PKEY_CTX_IS_KEM_OP(ctx)
  ------------------
  |  |  756|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|      0|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|      0|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|      0|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  848|      0|        && ctx->op.encap.kem != NULL
  ------------------
  |  Branch (848:12): [True: 0, False: 0]
  ------------------
  849|      0|        && ctx->op.encap.kem->settable_ctx_params != NULL) {
  ------------------
  |  Branch (849:12): [True: 0, False: 0]
  ------------------
  850|      0|        provctx = ossl_provider_ctx(EVP_KEM_get0_provider(ctx->op.encap.kem));
  851|      0|        return ctx->op.encap.kem->settable_ctx_params(ctx->op.encap.algctx,
  852|      0|                                                      provctx);
  853|      0|    }
  854|      0|    return NULL;
  855|      0|}
evp_pkey_ctx_set_params_strict:
  870|  1.49k|{
  871|  1.49k|    if (ctx == NULL || params == NULL)
  ------------------
  |  Branch (871:9): [True: 0, False: 1.49k]
  |  Branch (871:24): [True: 0, False: 1.49k]
  ------------------
  872|      0|        return 0;
  873|       |
  874|       |    /*
  875|       |     * We only check for provider side EVP_PKEY_CTX.  For #legacy, we
  876|       |     * depend on the translation that happens in EVP_PKEY_CTX_set_params()
  877|       |     * call, and that the resulting ctrl call will return -2 if it doesn't
  878|       |     * known the ctrl command number.
  879|       |     */
  880|  1.49k|    if (evp_pkey_ctx_is_provided(ctx)) {
  ------------------
  |  |   38|  1.49k|    (!evp_pkey_ctx_is_legacy(ctx))
  |  |  ------------------
  |  |  |  |   36|  1.49k|    ((ctx)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  Branch (38:5): [True: 1.49k, False: 0]
  |  |  ------------------
  ------------------
  881|  1.49k|        const OSSL_PARAM *settable = EVP_PKEY_CTX_settable_params(ctx);
  882|  1.49k|        const OSSL_PARAM *p;
  883|       |
  884|  2.98k|        for (p = params; p->key != NULL; p++) {
  ------------------
  |  Branch (884:26): [True: 1.49k, False: 1.49k]
  ------------------
  885|       |            /* Check the ctx actually understands this parameter */
  886|  1.49k|            if (OSSL_PARAM_locate_const(settable, p->key) == NULL)
  ------------------
  |  Branch (886:17): [True: 0, False: 1.49k]
  ------------------
  887|      0|                return -2;
  888|  1.49k|        }
  889|  1.49k|    }
  890|       |
  891|  1.49k|    return EVP_PKEY_CTX_set_params(ctx, params);
  892|  1.49k|}
EVP_PKEY_CTX_ctrl:
 1353|  1.49k|{
 1354|  1.49k|    int ret = 0;
 1355|       |
 1356|  1.49k|    if (ctx == NULL) {
  ------------------
  |  Branch (1356:9): [True: 0, False: 1.49k]
  ------------------
 1357|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1358|      0|        return -2;
 1359|      0|    }
 1360|       |    /* If unsupported, we don't want that reported here */
 1361|  1.49k|    ERR_set_mark();
 1362|  1.49k|    ret = evp_pkey_ctx_store_cached_data(ctx, keytype, optype,
 1363|  1.49k|                                         cmd, NULL, p2, p1);
 1364|  1.49k|    if (ret == -2) {
  ------------------
  |  Branch (1364:9): [True: 1.49k, False: 0]
  ------------------
 1365|  1.49k|        ERR_pop_to_mark();
 1366|  1.49k|    } else {
 1367|      0|        ERR_clear_last_mark();
 1368|       |        /*
 1369|       |         * If there was an error, there was an error.
 1370|       |         * If the operation isn't initialized yet, we also return, as
 1371|       |         * the saved values will be used then anyway.
 1372|       |         */
 1373|      0|        if (ret < 1 || ctx->operation == EVP_PKEY_OP_UNDEFINED)
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  |  Branch (1373:13): [True: 0, False: 0]
  |  Branch (1373:24): [True: 0, False: 0]
  ------------------
 1374|      0|            return ret;
 1375|      0|    }
 1376|  1.49k|    return evp_pkey_ctx_ctrl_int(ctx, keytype, optype, cmd, p1, p2);
 1377|  1.49k|}
evp_pkey_ctx_use_cached_data:
 1547|    965|{
 1548|    965|    int ret = 1;
 1549|       |
 1550|    965|    if (ret && ctx->cached_parameters.dist_id_set) {
  ------------------
  |  Branch (1550:9): [True: 965, False: 0]
  |  Branch (1550:16): [True: 0, False: 965]
  ------------------
 1551|      0|        const char *name = ctx->cached_parameters.dist_id_name;
 1552|      0|        const void *val = ctx->cached_parameters.dist_id;
 1553|      0|        size_t len = ctx->cached_parameters.dist_id_len;
 1554|       |
 1555|      0|        if (name != NULL)
  ------------------
  |  Branch (1555:13): [True: 0, False: 0]
  ------------------
 1556|      0|            ret = evp_pkey_ctx_ctrl_str_int(ctx, name, val);
 1557|      0|        else
 1558|      0|            ret = evp_pkey_ctx_ctrl_int(ctx, -1, ctx->operation,
 1559|      0|                                        EVP_PKEY_CTRL_SET1_ID,
  ------------------
  |  | 1807|      0|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
 1560|      0|                                        (int)len, (void *)val);
 1561|      0|    }
 1562|       |
 1563|    965|    return ret;
 1564|    965|}
EVP_PKEY_CTX_get0_pkey:
 1659|  1.07k|{
 1660|  1.07k|    return ctx->pkey;
 1661|  1.07k|}
pmeth_lib.c:evp_pkey_meth_find_added_by_application:
   93|  1.07k|{
   94|  1.07k|    if (app_pkey_methods != NULL) {
  ------------------
  |  Branch (94:9): [True: 0, False: 1.07k]
  ------------------
   95|      0|        int idx;
   96|      0|        EVP_PKEY_METHOD tmp;
   97|       |
   98|      0|        tmp.pkey_id = type;
   99|      0|        idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp);
  100|      0|        if (idx >= 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
  102|      0|    }
  103|  1.07k|    return NULL;
  104|  1.07k|}
pmeth_lib.c:int_ctx_new:
  163|  1.13k|{
  164|  1.13k|    EVP_PKEY_CTX *ret = NULL;
  165|  1.13k|    const EVP_PKEY_METHOD *pmeth = NULL, *app_pmeth = NULL;
  166|  1.13k|    EVP_KEYMGMT *keymgmt = NULL;
  167|       |
  168|       |    /* Code below to be removed when legacy support is dropped. */
  169|       |    /* BEGIN legacy */
  170|  1.13k|    if (id == -1) {
  ------------------
  |  Branch (170:9): [True: 1.13k, False: 0]
  ------------------
  171|  1.13k|        if (pkey != NULL && !evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  649|  1.07k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (171:13): [True: 1.07k, False: 58]
  |  Branch (171:29): [True: 0, False: 1.07k]
  ------------------
  172|      0|            id = pkey->type;
  173|  1.13k|        } else {
  174|  1.13k|            if (pkey != NULL) {
  ------------------
  |  Branch (174:17): [True: 1.07k, False: 58]
  ------------------
  175|       |                /* Must be provided if we get here */
  176|  1.07k|                keytype = EVP_KEYMGMT_get0_name(pkey->keymgmt);
  177|  1.07k|            }
  178|  1.13k|#ifndef FIPS_MODULE
  179|  1.13k|            if (keytype != NULL) {
  ------------------
  |  Branch (179:17): [True: 1.07k, False: 58]
  ------------------
  180|  1.07k|                id = evp_pkey_name2type(keytype);
  181|  1.07k|                if (id == NID_undef)
  ------------------
  |  |   18|  1.07k|#define NID_undef                       0
  ------------------
  |  Branch (181:21): [True: 0, False: 1.07k]
  ------------------
  182|      0|                    id = -1;
  183|  1.07k|            }
  184|  1.13k|#endif
  185|  1.13k|        }
  186|  1.13k|    }
  187|       |    /* If no ID was found here, we can only resort to find a keymgmt */
  188|  1.13k|    if (id == -1) {
  ------------------
  |  Branch (188:9): [True: 58, False: 1.07k]
  ------------------
  189|     58|#ifndef FIPS_MODULE
  190|       |        /* Using engine with a key without id will not work */
  191|     58|        if (e != NULL) {
  ------------------
  |  Branch (191:13): [True: 0, False: 58]
  ------------------
  192|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|            return NULL;
  194|      0|        }
  195|     58|#endif
  196|     58|        goto common;
  197|     58|    }
  198|       |
  199|  1.07k|#ifndef FIPS_MODULE
  200|       |    /*
  201|       |     * Here, we extract what information we can for the purpose of
  202|       |     * supporting usage with implementations from providers, to make
  203|       |     * for a smooth transition from legacy stuff to provider based stuff.
  204|       |     *
  205|       |     * If an engine is given, this is entirely legacy, and we should not
  206|       |     * pretend anything else, so we clear the name.
  207|       |     */
  208|  1.07k|    if (e != NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 1.07k]
  ------------------
  209|      0|        keytype = NULL;
  210|  1.07k|    if (e == NULL && (pkey == NULL || pkey->foreign == 0))
  ------------------
  |  Branch (210:9): [True: 1.07k, False: 0]
  |  Branch (210:23): [True: 0, False: 1.07k]
  |  Branch (210:39): [True: 1.07k, False: 0]
  ------------------
  211|  1.07k|        keytype = OBJ_nid2sn(id);
  212|       |
  213|  1.07k|# ifndef OPENSSL_NO_ENGINE
  214|  1.07k|    if (e == NULL && pkey != NULL)
  ------------------
  |  Branch (214:9): [True: 1.07k, False: 0]
  |  Branch (214:22): [True: 1.07k, False: 0]
  ------------------
  215|  1.07k|        e = pkey->pmeth_engine != NULL ? pkey->pmeth_engine : pkey->engine;
  ------------------
  |  Branch (215:13): [True: 0, False: 1.07k]
  ------------------
  216|       |    /* Try to find an ENGINE which implements this method */
  217|  1.07k|    if (e != NULL) {
  ------------------
  |  Branch (217:9): [True: 0, False: 1.07k]
  ------------------
  218|      0|        if (!ENGINE_init(e)) {
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|            return NULL;
  221|      0|        }
  222|  1.07k|    } else {
  223|  1.07k|        e = ENGINE_get_pkey_meth_engine(id);
  224|  1.07k|    }
  225|       |
  226|       |    /*
  227|       |     * If an ENGINE handled this method look it up. Otherwise use internal
  228|       |     * tables.
  229|       |     */
  230|  1.07k|    if (e != NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 1.07k]
  ------------------
  231|      0|        pmeth = ENGINE_get_pkey_meth(e, id);
  232|  1.07k|    else
  233|  1.07k|# endif /* OPENSSL_NO_ENGINE */
  234|  1.07k|    if (pkey != NULL && pkey->foreign)
  ------------------
  |  Branch (234:9): [True: 1.07k, False: 0]
  |  Branch (234:25): [True: 0, False: 1.07k]
  ------------------
  235|      0|        pmeth = EVP_PKEY_meth_find(id);
  236|  1.07k|    else
  237|  1.07k|        app_pmeth = pmeth = evp_pkey_meth_find_added_by_application(id);
  238|       |
  239|       |    /* END legacy */
  240|  1.07k|#endif /* FIPS_MODULE */
  241|  1.13k| common:
  242|       |    /*
  243|       |     * If there's no engine and no app supplied pmeth and there's a name, we try
  244|       |     * fetching a provider implementation.
  245|       |     */
  246|  1.13k|    if (e == NULL && app_pmeth == NULL && keytype != NULL) {
  ------------------
  |  Branch (246:9): [True: 1.13k, False: 0]
  |  Branch (246:22): [True: 1.13k, False: 0]
  |  Branch (246:43): [True: 1.07k, False: 58]
  ------------------
  247|       |        /*
  248|       |         * If |pkey| is given and is provided, we take a reference to its
  249|       |         * keymgmt.  Otherwise, we fetch one for the keytype we got. This
  250|       |         * is to ensure that operation init functions can access what they
  251|       |         * need through this single pointer.
  252|       |         */
  253|  1.07k|        if (pkey != NULL && pkey->keymgmt != NULL) {
  ------------------
  |  Branch (253:13): [True: 1.07k, False: 0]
  |  Branch (253:29): [True: 1.07k, False: 0]
  ------------------
  254|  1.07k|            if (!EVP_KEYMGMT_up_ref(pkey->keymgmt))
  ------------------
  |  Branch (254:17): [True: 0, False: 1.07k]
  ------------------
  255|  1.07k|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  256|  1.07k|            else
  257|  1.07k|                keymgmt = pkey->keymgmt;
  258|  1.07k|        } else {
  259|      0|            keymgmt = EVP_KEYMGMT_fetch(libctx, keytype, propquery);
  260|      0|        }
  261|  1.07k|        if (keymgmt == NULL)
  ------------------
  |  Branch (261:13): [True: 0, False: 1.07k]
  ------------------
  262|      0|            return NULL;   /* EVP_KEYMGMT_fetch() recorded an error */
  263|       |
  264|  1.07k|#ifndef FIPS_MODULE
  265|       |        /*
  266|       |         * Chase down the legacy NID, as that might be needed for diverse
  267|       |         * purposes, such as ensure that EVP_PKEY_type() can return sensible
  268|       |         * values. We go through all keymgmt names, because the keytype
  269|       |         * that's passed to this function doesn't necessarily translate
  270|       |         * directly.
  271|       |         */
  272|  1.07k|        if (keymgmt != NULL) {
  ------------------
  |  Branch (272:13): [True: 1.07k, False: 0]
  ------------------
  273|  1.07k|            int tmp_id = evp_keymgmt_get_legacy_alg(keymgmt);
  274|       |
  275|  1.07k|            if (tmp_id != NID_undef) {
  ------------------
  |  |   18|  1.07k|#define NID_undef                       0
  ------------------
  |  Branch (275:17): [True: 1.07k, False: 0]
  ------------------
  276|  1.07k|                if (id == -1) {
  ------------------
  |  Branch (276:21): [True: 0, False: 1.07k]
  ------------------
  277|      0|                    id = tmp_id;
  278|  1.07k|                } else {
  279|       |                    /*
  280|       |                     * It really really shouldn't differ.  If it still does,
  281|       |                     * something is very wrong.
  282|       |                     */
  283|  1.07k|                    if (!ossl_assert(id == tmp_id)) {
  ------------------
  |  |   52|  1.07k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.07k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (283:25): [True: 0, False: 1.07k]
  ------------------
  284|      0|                        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|                        EVP_KEYMGMT_free(keymgmt);
  286|      0|                        return NULL;
  287|      0|                    }
  288|  1.07k|                }
  289|  1.07k|            }
  290|  1.07k|        }
  291|  1.07k|#endif
  292|  1.07k|    }
  293|       |
  294|  1.13k|    if (pmeth == NULL && keymgmt == NULL) {
  ------------------
  |  Branch (294:9): [True: 1.13k, False: 0]
  |  Branch (294:26): [True: 58, False: 1.07k]
  ------------------
  295|     58|        ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|     58|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     58|    (ERR_new(),                                                 \
  |  |  |  |  404|     58|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     58|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     58|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     58|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     58|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|  1.07k|    } else {
  297|  1.07k|        ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  1.07k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  298|  1.07k|    }
  299|       |
  300|  1.13k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  301|  1.13k|    if ((ret == NULL || pmeth == NULL) && e != NULL)
  ------------------
  |  Branch (301:10): [True: 58, False: 1.07k]
  |  Branch (301:25): [True: 1.07k, False: 0]
  |  Branch (301:43): [True: 0, False: 1.13k]
  ------------------
  302|      0|        ENGINE_finish(e);
  303|  1.13k|#endif
  304|       |
  305|  1.13k|    if (ret == NULL) {
  ------------------
  |  Branch (305:9): [True: 58, False: 1.07k]
  ------------------
  306|     58|        EVP_KEYMGMT_free(keymgmt);
  307|     58|        return NULL;
  308|     58|    }
  309|  1.07k|    if (propquery != NULL) {
  ------------------
  |  Branch (309:9): [True: 0, False: 1.07k]
  ------------------
  310|      0|        ret->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|      0|        if (ret->propquery == NULL) {
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|      0|            EVP_KEYMGMT_free(keymgmt);
  314|      0|            return NULL;
  315|      0|        }
  316|      0|    }
  317|  1.07k|    ret->libctx = libctx;
  318|  1.07k|    ret->keytype = keytype;
  319|  1.07k|    ret->keymgmt = keymgmt;
  320|  1.07k|    ret->legacy_keytype = id;
  321|  1.07k|    ret->engine = e;
  322|  1.07k|    ret->pmeth = pmeth;
  323|  1.07k|    ret->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|  1.07k|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  324|       |
  325|  1.07k|    if (pkey != NULL && !EVP_PKEY_up_ref(pkey)) {
  ------------------
  |  Branch (325:9): [True: 1.07k, False: 0]
  |  Branch (325:25): [True: 0, False: 1.07k]
  ------------------
  326|      0|        EVP_PKEY_CTX_free(ret);
  327|      0|        return NULL;
  328|      0|    }
  329|       |
  330|  1.07k|    ret->pkey = pkey;
  331|       |
  332|  1.07k|    if (pmeth != NULL && pmeth->init != NULL) {
  ------------------
  |  Branch (332:9): [True: 0, False: 1.07k]
  |  Branch (332:26): [True: 0, False: 0]
  ------------------
  333|      0|        if (pmeth->init(ret) <= 0) {
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            ret->pmeth = NULL;
  335|      0|            EVP_PKEY_CTX_free(ret);
  336|      0|            return NULL;
  337|      0|        }
  338|      0|    }
  339|       |
  340|  1.07k|    return ret;
  341|  1.07k|}
pmeth_lib.c:evp_pkey_ctx_ctrl_int:
 1310|  1.49k|{
 1311|  1.49k|    int ret = 0;
 1312|       |
 1313|       |    /*
 1314|       |     * If the method has a |digest_custom| function, we can relax the
 1315|       |     * operation type check, since this can be called before the operation
 1316|       |     * is initialized.
 1317|       |     */
 1318|  1.49k|    if (ctx->pmeth == NULL || ctx->pmeth->digest_custom == NULL) {
  ------------------
  |  Branch (1318:9): [True: 1.49k, False: 0]
  |  Branch (1318:31): [True: 0, False: 0]
  ------------------
 1319|  1.49k|        if (ctx->operation == EVP_PKEY_OP_UNDEFINED) {
  ------------------
  |  | 1744|  1.49k|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  |  Branch (1319:13): [True: 0, False: 1.49k]
  ------------------
 1320|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NO_OPERATION_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1321|      0|            return -1;
 1322|      0|        }
 1323|       |
 1324|  1.49k|        if ((optype != -1) && !(ctx->operation & optype)) {
  ------------------
  |  Branch (1324:13): [True: 996, False: 498]
  |  Branch (1324:31): [True: 0, False: 996]
  ------------------
 1325|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1326|      0|            return -1;
 1327|      0|        }
 1328|  1.49k|    }
 1329|       |
 1330|  1.49k|    switch (evp_pkey_ctx_state(ctx)) {
  ------------------
  |  Branch (1330:13): [True: 0, False: 1.49k]
  ------------------
 1331|  1.49k|    case EVP_PKEY_STATE_PROVIDER:
  ------------------
  |  |  948|  1.49k|# define EVP_PKEY_STATE_PROVIDER        2
  ------------------
  |  Branch (1331:5): [True: 1.49k, False: 0]
  ------------------
 1332|  1.49k|        return evp_pkey_ctx_ctrl_to_param(ctx, keytype, optype, cmd, p1, p2);
 1333|      0|    case EVP_PKEY_STATE_UNKNOWN:
  ------------------
  |  |  946|      0|# define EVP_PKEY_STATE_UNKNOWN         0
  ------------------
  |  Branch (1333:5): [True: 0, False: 1.49k]
  ------------------
 1334|      0|    case EVP_PKEY_STATE_LEGACY:
  ------------------
  |  |  947|      0|# define EVP_PKEY_STATE_LEGACY          1
  ------------------
  |  Branch (1334:5): [True: 0, False: 1.49k]
  ------------------
 1335|      0|        if (ctx->pmeth == NULL || ctx->pmeth->ctrl == NULL) {
  ------------------
  |  Branch (1335:13): [True: 0, False: 0]
  |  Branch (1335:35): [True: 0, False: 0]
  ------------------
 1336|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1337|      0|            return -2;
 1338|      0|        }
 1339|      0|        if ((keytype != -1) && (ctx->pmeth->pkey_id != keytype))
  ------------------
  |  Branch (1339:13): [True: 0, False: 0]
  |  Branch (1339:32): [True: 0, False: 0]
  ------------------
 1340|      0|            return -1;
 1341|       |
 1342|      0|        ret = ctx->pmeth->ctrl(ctx, cmd, p1, p2);
 1343|       |
 1344|      0|        if (ret == -2)
  ------------------
  |  Branch (1344:13): [True: 0, False: 0]
  ------------------
 1345|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1346|      0|        break;
 1347|  1.49k|    }
 1348|      0|    return ret;
 1349|  1.49k|}
pmeth_lib.c:evp_pkey_ctx_store_cached_data:
 1462|  1.49k|{
 1463|       |    /*
 1464|       |     * Check that it's one of the supported commands.  The ctrl commands
 1465|       |     * number cases here must correspond to the cases in the bottom switch
 1466|       |     * in this function.
 1467|       |     */
 1468|  1.49k|    switch (cmd = decode_cmd(cmd, name)) {
 1469|      0|    case EVP_PKEY_CTRL_SET1_ID:
  ------------------
  |  | 1807|      0|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
  |  Branch (1469:5): [True: 0, False: 1.49k]
  ------------------
 1470|      0|        break;
 1471|  1.49k|    default:
  ------------------
  |  Branch (1471:5): [True: 1.49k, False: 0]
  ------------------
 1472|  1.49k|        ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|  1.49k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.49k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.49k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.49k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.49k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.49k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.49k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1473|  1.49k|        return -2;
 1474|  1.49k|    }
 1475|       |
 1476|      0|    if (keytype != -1) {
  ------------------
  |  Branch (1476:9): [True: 0, False: 0]
  ------------------
 1477|      0|        switch (evp_pkey_ctx_state(ctx)) {
  ------------------
  |  Branch (1477:17): [True: 0, False: 0]
  ------------------
 1478|      0|        case EVP_PKEY_STATE_PROVIDER:
  ------------------
  |  |  948|      0|# define EVP_PKEY_STATE_PROVIDER        2
  ------------------
  |  Branch (1478:9): [True: 0, False: 0]
  ------------------
 1479|      0|            if (ctx->keymgmt == NULL) {
  ------------------
  |  Branch (1479:17): [True: 0, False: 0]
  ------------------
 1480|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1481|      0|                return -2;
 1482|      0|            }
 1483|      0|            if (!EVP_KEYMGMT_is_a(ctx->keymgmt,
  ------------------
  |  Branch (1483:17): [True: 0, False: 0]
  ------------------
 1484|      0|                                  evp_pkey_type2name(keytype))) {
 1485|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1486|      0|                return -1;
 1487|      0|            }
 1488|      0|            break;
 1489|      0|        case EVP_PKEY_STATE_UNKNOWN:
  ------------------
  |  |  946|      0|# define EVP_PKEY_STATE_UNKNOWN         0
  ------------------
  |  Branch (1489:9): [True: 0, False: 0]
  ------------------
 1490|      0|        case EVP_PKEY_STATE_LEGACY:
  ------------------
  |  |  947|      0|# define EVP_PKEY_STATE_LEGACY          1
  ------------------
  |  Branch (1490:9): [True: 0, False: 0]
  ------------------
 1491|      0|            if (ctx->pmeth == NULL) {
  ------------------
  |  Branch (1491:17): [True: 0, False: 0]
  ------------------
 1492|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1493|      0|                return -2;
 1494|      0|            }
 1495|      0|            if (EVP_PKEY_type(ctx->pmeth->pkey_id) != EVP_PKEY_type(keytype)) {
  ------------------
  |  Branch (1495:17): [True: 0, False: 0]
  ------------------
 1496|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1497|      0|                return -1;
 1498|      0|            }
 1499|      0|            break;
 1500|      0|        }
 1501|      0|    }
 1502|      0|    if (optype != -1 && (ctx->operation & optype) == 0) {
  ------------------
  |  Branch (1502:9): [True: 0, False: 0]
  |  Branch (1502:25): [True: 0, False: 0]
  ------------------
 1503|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1504|      0|        return -1;
 1505|      0|    }
 1506|       |
 1507|      0|    switch (cmd) {
  ------------------
  |  Branch (1507:13): [True: 0, False: 0]
  ------------------
 1508|      0|    case EVP_PKEY_CTRL_SET1_ID:
  ------------------
  |  | 1807|      0|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
  |  Branch (1508:5): [True: 0, False: 0]
  ------------------
 1509|      0|        evp_pkey_ctx_free_cached_data(ctx, cmd, name);
 1510|      0|        if (name != NULL) {
  ------------------
  |  Branch (1510:13): [True: 0, False: 0]
  ------------------
 1511|      0|            ctx->cached_parameters.dist_id_name = OPENSSL_strdup(name);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1512|      0|            if (ctx->cached_parameters.dist_id_name == NULL)
  ------------------
  |  Branch (1512:17): [True: 0, False: 0]
  ------------------
 1513|      0|                return 0;
 1514|      0|        }
 1515|      0|        if (data_len > 0) {
  ------------------
  |  Branch (1515:13): [True: 0, False: 0]
  ------------------
 1516|      0|            ctx->cached_parameters.dist_id = OPENSSL_memdup(data, data_len);
  ------------------
  |  |  117|      0|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1517|      0|            if (ctx->cached_parameters.dist_id == NULL)
  ------------------
  |  Branch (1517:17): [True: 0, False: 0]
  ------------------
 1518|      0|                return 0;
 1519|      0|        }
 1520|      0|        ctx->cached_parameters.dist_id_set = 1;
 1521|      0|        ctx->cached_parameters.dist_id_len = data_len;
 1522|      0|        break;
 1523|      0|    }
 1524|      0|    return 1;
 1525|      0|}
pmeth_lib.c:decode_cmd:
 1443|  3.53k|{
 1444|  3.53k|    if (cmd == -1) {
  ------------------
  |  Branch (1444:9): [True: 0, False: 3.53k]
  ------------------
 1445|       |        /*
 1446|       |         * The consequence of the assertion not being true is that this
 1447|       |         * function will return -1, which will cause the calling functions
 1448|       |         * to signal that the command is unsupported...  in non-debug mode.
 1449|       |         */
 1450|      0|        if (ossl_assert(name != 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__)
  ------------------
 1451|      0|            if (strcmp(name, "distid") == 0 || strcmp(name, "hexdistid") == 0)
  ------------------
  |  Branch (1451:17): [True: 0, False: 0]
  |  Branch (1451:48): [True: 0, False: 0]
  ------------------
 1452|      0|                cmd = EVP_PKEY_CTRL_SET1_ID;
  ------------------
  |  | 1807|      0|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
 1453|      0|    }
 1454|       |
 1455|  3.53k|    return cmd;
 1456|  3.53k|}
pmeth_lib.c:evp_pkey_ctx_free_cached_data:
 1529|  2.04k|{
 1530|  2.04k|    cmd = decode_cmd(cmd, name);
 1531|  2.04k|    switch (cmd) {
  ------------------
  |  Branch (1531:13): [True: 0, False: 2.04k]
  ------------------
 1532|  2.04k|    case EVP_PKEY_CTRL_SET1_ID:
  ------------------
  |  | 1807|  2.04k|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
  |  Branch (1532:5): [True: 2.04k, False: 0]
  ------------------
 1533|  2.04k|        OPENSSL_free(ctx->cached_parameters.dist_id);
  ------------------
  |  |  115|  2.04k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.04k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.04k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1534|  2.04k|        OPENSSL_free(ctx->cached_parameters.dist_id_name);
  ------------------
  |  |  115|  2.04k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.04k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.04k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1535|  2.04k|        ctx->cached_parameters.dist_id = NULL;
 1536|  2.04k|        ctx->cached_parameters.dist_id_name = NULL;
 1537|  2.04k|        break;
 1538|  2.04k|    }
 1539|  2.04k|}
pmeth_lib.c:evp_pkey_ctx_free_all_cached_data:
 1542|  2.04k|{
 1543|  2.04k|    evp_pkey_ctx_free_cached_data(ctx, EVP_PKEY_CTRL_SET1_ID, NULL);
  ------------------
  |  | 1807|  2.04k|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
 1544|  2.04k|}

EVP_SIGNATURE_free:
  460|  3.04k|{
  461|  3.04k|    int i;
  462|       |
  463|  3.04k|    if (signature == NULL)
  ------------------
  |  Branch (463:9): [True: 982, False: 2.06k]
  ------------------
  464|    982|        return;
  465|  2.06k|    CRYPTO_DOWN_REF(&signature->refcnt, &i);
  466|  2.06k|    if (i > 0)
  ------------------
  |  Branch (466:9): [True: 2.00k, False: 59]
  ------------------
  467|  2.00k|        return;
  468|     59|    OPENSSL_free(signature->type_name);
  ------------------
  |  |  115|     59|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  469|     59|    ossl_provider_free(signature->prov);
  470|     59|    CRYPTO_FREE_REF(&signature->refcnt);
  471|     59|    OPENSSL_free(signature);
  ------------------
  |  |  115|     59|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  472|     59|}
EVP_SIGNATURE_up_ref:
  475|  2.00k|{
  476|  2.00k|    int ref = 0;
  477|       |
  478|  2.00k|    CRYPTO_UP_REF(&signature->refcnt, &ref);
  479|  2.00k|    return 1;
  480|  2.00k|}
EVP_SIGNATURE_get0_provider:
  483|  2.47k|{
  484|  2.47k|    return signature->prov;
  485|  2.47k|}
EVP_SIGNATURE_fetch:
  489|    982|{
  490|    982|    return evp_generic_fetch(ctx, OSSL_OP_SIGNATURE, algorithm, properties,
  ------------------
  |  |  317|    982|# define OSSL_OP_SIGNATURE                          12
  ------------------
  491|    982|                             evp_signature_from_algorithm,
  492|    982|                             evp_signature_up_ref,
  493|    982|                             evp_signature_free);
  494|    982|}
signature.c:evp_signature_from_algorithm:
   55|     59|{
   56|     59|    const OSSL_DISPATCH *fns = algodef->implementation;
   57|     59|    EVP_SIGNATURE *signature = NULL;
   58|     59|    const char *desc;
   59|       |    /* Counts newctx / freectx */
   60|     59|    int ctxfncnt = 0;
   61|       |    /* Counts all init functions  */
   62|     59|    int initfncnt = 0;
   63|       |    /* Counts all parameter functions */
   64|     59|    int gparamfncnt = 0, sparamfncnt = 0, gmdparamfncnt = 0, smdparamfncnt = 0;
   65|     59|    int valid = 0;
   66|       |
   67|     59|    if ((signature = evp_signature_new(prov)) == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 59]
  ------------------
   68|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   69|      0|        goto err;
   70|      0|    }
   71|       |
   72|     59|    signature->name_id = name_id;
   73|     59|    if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 59]
  ------------------
   74|      0|        goto err;
   75|     59|    signature->description = algodef->algorithm_description;
   76|     59|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (76:12): [True: 12, False: 47]
  ------------------
   77|       |
   78|  1.08k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (78:12): [True: 1.02k, False: 59]
  ------------------
   79|  1.02k|        switch (fns->function_id) {
  ------------------
  |  Branch (79:17): [True: 0, False: 1.02k]
  ------------------
   80|     59|        case OSSL_FUNC_SIGNATURE_NEWCTX:
  ------------------
  |  |  792|     59|# define OSSL_FUNC_SIGNATURE_NEWCTX                  1
  ------------------
  |  Branch (80:9): [True: 59, False: 962]
  ------------------
   81|     59|            if (signature->newctx != NULL)
  ------------------
  |  Branch (81:17): [True: 0, False: 59]
  ------------------
   82|      0|                break;
   83|     59|            signature->newctx = OSSL_FUNC_signature_newctx(fns);
   84|     59|            ctxfncnt++;
   85|     59|            break;
   86|     42|        case OSSL_FUNC_SIGNATURE_SIGN_INIT:
  ------------------
  |  |  793|     42|# define OSSL_FUNC_SIGNATURE_SIGN_INIT               2
  ------------------
  |  Branch (86:9): [True: 42, False: 979]
  ------------------
   87|     42|            if (signature->sign_init != NULL)
  ------------------
  |  Branch (87:17): [True: 2, False: 40]
  ------------------
   88|      2|                break;
   89|     40|            signature->sign_init = OSSL_FUNC_signature_sign_init(fns);
   90|     40|            initfncnt++;
   91|     40|            break;
   92|     55|        case OSSL_FUNC_SIGNATURE_SIGN:
  ------------------
  |  |  794|     55|# define OSSL_FUNC_SIGNATURE_SIGN                    3
  ------------------
  |  Branch (92:9): [True: 55, False: 966]
  ------------------
   93|     55|            if (signature->sign != NULL)
  ------------------
  |  Branch (93:17): [True: 0, False: 55]
  ------------------
   94|      0|                break;
   95|     55|            signature->sign = OSSL_FUNC_signature_sign(fns);
   96|     55|            break;
   97|     51|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT:
  ------------------
  |  |  818|     51|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT      27
  ------------------
  |  Branch (97:9): [True: 51, False: 970]
  ------------------
   98|     51|            if (signature->sign_message_init != NULL)
  ------------------
  |  Branch (98:17): [True: 0, False: 51]
  ------------------
   99|      0|                break;
  100|     51|            signature->sign_message_init
  101|     51|                = OSSL_FUNC_signature_sign_message_init(fns);
  102|     51|            initfncnt++;
  103|     51|            break;
  104|     34|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE:
  ------------------
  |  |  819|     34|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE    28
  ------------------
  |  Branch (104:9): [True: 34, False: 987]
  ------------------
  105|     34|            if (signature->sign_message_update != NULL)
  ------------------
  |  Branch (105:17): [True: 0, False: 34]
  ------------------
  106|      0|                break;
  107|     34|            signature->sign_message_update
  108|     34|                = OSSL_FUNC_signature_sign_message_update(fns);
  109|     34|            break;
  110|     34|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL:
  ------------------
  |  |  820|     34|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL     29
  ------------------
  |  Branch (110:9): [True: 34, False: 987]
  ------------------
  111|     34|            if (signature->sign_message_final != NULL)
  ------------------
  |  Branch (111:17): [True: 0, False: 34]
  ------------------
  112|      0|                break;
  113|     34|            signature->sign_message_final
  114|     34|                = OSSL_FUNC_signature_sign_message_final(fns);
  115|     34|            break;
  116|     42|        case OSSL_FUNC_SIGNATURE_VERIFY_INIT:
  ------------------
  |  |  795|     42|# define OSSL_FUNC_SIGNATURE_VERIFY_INIT             4
  ------------------
  |  Branch (116:9): [True: 42, False: 979]
  ------------------
  117|     42|            if (signature->verify_init != NULL)
  ------------------
  |  Branch (117:17): [True: 2, False: 40]
  ------------------
  118|      2|                break;
  119|     40|            signature->verify_init = OSSL_FUNC_signature_verify_init(fns);
  120|     40|            initfncnt++;
  121|     40|            break;
  122|     55|        case OSSL_FUNC_SIGNATURE_VERIFY:
  ------------------
  |  |  796|     55|# define OSSL_FUNC_SIGNATURE_VERIFY                  5
  ------------------
  |  Branch (122:9): [True: 55, False: 966]
  ------------------
  123|     55|            if (signature->verify != NULL)
  ------------------
  |  Branch (123:17): [True: 0, False: 55]
  ------------------
  124|      0|                break;
  125|     55|            signature->verify = OSSL_FUNC_signature_verify(fns);
  126|     55|            break;
  127|     51|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT:
  ------------------
  |  |  821|     51|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT    30
  ------------------
  |  Branch (127:9): [True: 51, False: 970]
  ------------------
  128|     51|            if (signature->verify_message_init != NULL)
  ------------------
  |  Branch (128:17): [True: 0, False: 51]
  ------------------
  129|      0|                break;
  130|     51|            signature->verify_message_init
  131|     51|                = OSSL_FUNC_signature_verify_message_init(fns);
  132|     51|            initfncnt++;
  133|     51|            break;
  134|     34|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE:
  ------------------
  |  |  822|     34|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE  31
  ------------------
  |  Branch (134:9): [True: 34, False: 987]
  ------------------
  135|     34|            if (signature->verify_message_update != NULL)
  ------------------
  |  Branch (135:17): [True: 0, False: 34]
  ------------------
  136|      0|                break;
  137|     34|            signature->verify_message_update
  138|     34|                = OSSL_FUNC_signature_verify_message_update(fns);
  139|     34|            break;
  140|     34|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL:
  ------------------
  |  |  823|     34|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL   32
  ------------------
  |  Branch (140:9): [True: 34, False: 987]
  ------------------
  141|     34|            if (signature->verify_message_final != NULL)
  ------------------
  |  Branch (141:17): [True: 0, False: 34]
  ------------------
  142|      0|                break;
  143|     34|            signature->verify_message_final
  144|     34|                = OSSL_FUNC_signature_verify_message_final(fns);
  145|     34|            break;
  146|     14|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT:
  ------------------
  |  |  797|     14|# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT     6
  ------------------
  |  Branch (146:9): [True: 14, False: 1.00k]
  ------------------
  147|     14|            if (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (147:17): [True: 0, False: 14]
  ------------------
  148|      0|                break;
  149|     14|            signature->verify_recover_init
  150|     14|                = OSSL_FUNC_signature_verify_recover_init(fns);
  151|     14|            initfncnt++;
  152|     14|            break;
  153|     14|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER:
  ------------------
  |  |  798|     14|# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER          7
  ------------------
  |  Branch (153:9): [True: 14, False: 1.00k]
  ------------------
  154|     14|            if (signature->verify_recover != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 14]
  ------------------
  155|      0|                break;
  156|     14|            signature->verify_recover
  157|     14|                = OSSL_FUNC_signature_verify_recover(fns);
  158|     14|            break;
  159|     25|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT:
  ------------------
  |  |  799|     25|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT        8
  ------------------
  |  Branch (159:9): [True: 25, False: 996]
  ------------------
  160|     25|            if (signature->digest_sign_init != NULL)
  ------------------
  |  Branch (160:17): [True: 0, False: 25]
  ------------------
  161|      0|                break;
  162|     25|            signature->digest_sign_init
  163|     25|                = OSSL_FUNC_signature_digest_sign_init(fns);
  164|     25|            initfncnt++;
  165|     25|            break;
  166|      8|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE:
  ------------------
  |  |  800|      8|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE      9
  ------------------
  |  Branch (166:9): [True: 8, False: 1.01k]
  ------------------
  167|      8|            if (signature->digest_sign_update != NULL)
  ------------------
  |  Branch (167:17): [True: 0, False: 8]
  ------------------
  168|      0|                break;
  169|      8|            signature->digest_sign_update
  170|      8|                = OSSL_FUNC_signature_digest_sign_update(fns);
  171|      8|            break;
  172|      8|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL:
  ------------------
  |  |  801|      8|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL      10
  ------------------
  |  Branch (172:9): [True: 8, False: 1.01k]
  ------------------
  173|      8|            if (signature->digest_sign_final != NULL)
  ------------------
  |  Branch (173:17): [True: 0, False: 8]
  ------------------
  174|      0|                break;
  175|      8|            signature->digest_sign_final
  176|      8|                = OSSL_FUNC_signature_digest_sign_final(fns);
  177|      8|            break;
  178|     17|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN:
  ------------------
  |  |  802|     17|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN            11
  ------------------
  |  Branch (178:9): [True: 17, False: 1.00k]
  ------------------
  179|     17|            if (signature->digest_sign != NULL)
  ------------------
  |  Branch (179:17): [True: 0, False: 17]
  ------------------
  180|      0|                break;
  181|     17|            signature->digest_sign
  182|     17|                = OSSL_FUNC_signature_digest_sign(fns);
  183|     17|            break;
  184|     21|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT:
  ------------------
  |  |  803|     21|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT     12
  ------------------
  |  Branch (184:9): [True: 21, False: 1.00k]
  ------------------
  185|     21|            if (signature->digest_verify_init != NULL)
  ------------------
  |  Branch (185:17): [True: 0, False: 21]
  ------------------
  186|      0|                break;
  187|     21|            signature->digest_verify_init
  188|     21|                = OSSL_FUNC_signature_digest_verify_init(fns);
  189|     21|            initfncnt++;
  190|     21|            break;
  191|      4|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE:
  ------------------
  |  |  804|      4|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE   13
  ------------------
  |  Branch (191:9): [True: 4, False: 1.01k]
  ------------------
  192|      4|            if (signature->digest_verify_update != NULL)
  ------------------
  |  Branch (192:17): [True: 0, False: 4]
  ------------------
  193|      0|                break;
  194|      4|            signature->digest_verify_update
  195|      4|                = OSSL_FUNC_signature_digest_verify_update(fns);
  196|      4|            break;
  197|      4|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL:
  ------------------
  |  |  805|      4|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL    14
  ------------------
  |  Branch (197:9): [True: 4, False: 1.01k]
  ------------------
  198|      4|            if (signature->digest_verify_final != NULL)
  ------------------
  |  Branch (198:17): [True: 0, False: 4]
  ------------------
  199|      0|                break;
  200|      4|            signature->digest_verify_final
  201|      4|                = OSSL_FUNC_signature_digest_verify_final(fns);
  202|      4|            break;
  203|     17|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY:
  ------------------
  |  |  806|     17|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY          15
  ------------------
  |  Branch (203:9): [True: 17, False: 1.00k]
  ------------------
  204|     17|            if (signature->digest_verify != NULL)
  ------------------
  |  Branch (204:17): [True: 0, False: 17]
  ------------------
  205|      0|                break;
  206|     17|            signature->digest_verify
  207|     17|                = OSSL_FUNC_signature_digest_verify(fns);
  208|     17|            break;
  209|     59|        case OSSL_FUNC_SIGNATURE_FREECTX:
  ------------------
  |  |  807|     59|# define OSSL_FUNC_SIGNATURE_FREECTX                16
  ------------------
  |  Branch (209:9): [True: 59, False: 962]
  ------------------
  210|     59|            if (signature->freectx != NULL)
  ------------------
  |  Branch (210:17): [True: 0, False: 59]
  ------------------
  211|      0|                break;
  212|     59|            signature->freectx = OSSL_FUNC_signature_freectx(fns);
  213|     59|            ctxfncnt++;
  214|     59|            break;
  215|     59|        case OSSL_FUNC_SIGNATURE_DUPCTX:
  ------------------
  |  |  808|     59|# define OSSL_FUNC_SIGNATURE_DUPCTX                 17
  ------------------
  |  Branch (215:9): [True: 59, False: 962]
  ------------------
  216|     59|            if (signature->dupctx != NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 59]
  ------------------
  217|      0|                break;
  218|     59|            signature->dupctx = OSSL_FUNC_signature_dupctx(fns);
  219|     59|            break;
  220|     55|        case OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS:
  ------------------
  |  |  809|     55|# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS         18
  ------------------
  |  Branch (220:9): [True: 55, False: 966]
  ------------------
  221|     55|            if (signature->get_ctx_params != NULL)
  ------------------
  |  Branch (221:17): [True: 0, False: 55]
  ------------------
  222|      0|                break;
  223|     55|            signature->get_ctx_params
  224|     55|                = OSSL_FUNC_signature_get_ctx_params(fns);
  225|     55|            gparamfncnt++;
  226|     55|            break;
  227|     55|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  810|     55|# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS    19
  ------------------
  |  Branch (227:9): [True: 55, False: 966]
  ------------------
  228|     55|            if (signature->gettable_ctx_params != NULL)
  ------------------
  |  Branch (228:17): [True: 0, False: 55]
  ------------------
  229|      0|                break;
  230|     55|            signature->gettable_ctx_params
  231|     55|                = OSSL_FUNC_signature_gettable_ctx_params(fns);
  232|     55|            gparamfncnt++;
  233|     55|            break;
  234|     59|        case OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS:
  ------------------
  |  |  811|     59|# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS         20
  ------------------
  |  Branch (234:9): [True: 59, False: 962]
  ------------------
  235|     59|            if (signature->set_ctx_params != NULL)
  ------------------
  |  Branch (235:17): [True: 0, False: 59]
  ------------------
  236|      0|                break;
  237|     59|            signature->set_ctx_params
  238|     59|                = OSSL_FUNC_signature_set_ctx_params(fns);
  239|     59|            sparamfncnt++;
  240|     59|            break;
  241|     59|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  812|     59|# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS    21
  ------------------
  |  Branch (241:9): [True: 59, False: 962]
  ------------------
  242|     59|            if (signature->settable_ctx_params != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 59]
  ------------------
  243|      0|                break;
  244|     59|            signature->settable_ctx_params
  245|     59|                = OSSL_FUNC_signature_settable_ctx_params(fns);
  246|     59|            sparamfncnt++;
  247|     59|            break;
  248|      4|        case OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS:
  ------------------
  |  |  813|      4|# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS      22
  ------------------
  |  Branch (248:9): [True: 4, False: 1.01k]
  ------------------
  249|      4|            if (signature->get_ctx_md_params != NULL)
  ------------------
  |  Branch (249:17): [True: 0, False: 4]
  ------------------
  250|      0|                break;
  251|      4|            signature->get_ctx_md_params
  252|      4|                = OSSL_FUNC_signature_get_ctx_md_params(fns);
  253|      4|            gmdparamfncnt++;
  254|      4|            break;
  255|      4|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  814|      4|# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
  ------------------
  |  Branch (255:9): [True: 4, False: 1.01k]
  ------------------
  256|      4|            if (signature->gettable_ctx_md_params != NULL)
  ------------------
  |  Branch (256:17): [True: 0, False: 4]
  ------------------
  257|      0|                break;
  258|      4|            signature->gettable_ctx_md_params
  259|      4|                = OSSL_FUNC_signature_gettable_ctx_md_params(fns);
  260|      4|            gmdparamfncnt++;
  261|      4|            break;
  262|      4|        case OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS:
  ------------------
  |  |  815|      4|# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS      24
  ------------------
  |  Branch (262:9): [True: 4, False: 1.01k]
  ------------------
  263|      4|            if (signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (263:17): [True: 0, False: 4]
  ------------------
  264|      0|                break;
  265|      4|            signature->set_ctx_md_params
  266|      4|                = OSSL_FUNC_signature_set_ctx_md_params(fns);
  267|      4|            smdparamfncnt++;
  268|      4|            break;
  269|      4|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  816|      4|# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
  ------------------
  |  Branch (269:9): [True: 4, False: 1.01k]
  ------------------
  270|      4|            if (signature->settable_ctx_md_params != NULL)
  ------------------
  |  Branch (270:17): [True: 0, False: 4]
  ------------------
  271|      0|                break;
  272|      4|            signature->settable_ctx_md_params
  273|      4|                = OSSL_FUNC_signature_settable_ctx_md_params(fns);
  274|      4|            smdparamfncnt++;
  275|      4|            break;
  276|     36|        case OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES:
  ------------------
  |  |  817|     36|# define OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES        26
  ------------------
  |  Branch (276:9): [True: 36, False: 985]
  ------------------
  277|     36|            if (signature->query_key_types != NULL)
  ------------------
  |  Branch (277:17): [True: 0, False: 36]
  ------------------
  278|      0|                break;
  279|     36|            signature->query_key_types
  280|     36|                = OSSL_FUNC_signature_query_key_types(fns);
  281|     36|            break;
  282|  1.02k|        }
  283|  1.02k|    }
  284|       |    /*
  285|       |     * In order to be a consistent set of functions we must have at least
  286|       |     * a set of context functions (newctx and freectx) as well as a set of
  287|       |     * "signature" functions.  Because there's an overlap between some sets
  288|       |     * of functions, counters don't always cut it, we must test known
  289|       |     * combinations.
  290|       |     * We start by assuming the implementation is valid, and then look for
  291|       |     * reasons it's not.
  292|       |     */
  293|     59|    valid = 1;
  294|       |    /* Start with the ones where counters say enough */
  295|     59|    if (ctxfncnt != 2) {
  ------------------
  |  Branch (295:9): [True: 0, False: 59]
  ------------------
  296|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  297|      0|                       "missing %s newctx or freectx:%s", signature->type_name, desc);
  298|      0|        valid = 0;
  299|      0|    }
  300|     59|    if (valid
  ------------------
  |  Branch (300:9): [True: 59, False: 0]
  ------------------
  301|     59|        && ((gparamfncnt != 0 && gparamfncnt != 2)
  ------------------
  |  Branch (301:14): [True: 55, False: 4]
  |  Branch (301:34): [True: 0, False: 55]
  ------------------
  302|     59|            || (sparamfncnt != 0 && sparamfncnt != 2)
  ------------------
  |  Branch (302:17): [True: 59, False: 0]
  |  Branch (302:37): [True: 0, False: 59]
  ------------------
  303|     59|            || (gmdparamfncnt != 0 && gmdparamfncnt != 2)
  ------------------
  |  Branch (303:17): [True: 4, False: 55]
  |  Branch (303:39): [True: 0, False: 4]
  ------------------
  304|     59|            || (smdparamfncnt != 0 && smdparamfncnt != 2))) {
  ------------------
  |  Branch (304:17): [True: 4, False: 55]
  |  Branch (304:39): [True: 0, False: 4]
  ------------------
  305|       |        /*
  306|       |         * Params functions are optional, but if defined, they must
  307|       |         * be pairwise complete sets, i.e. a getter must have an
  308|       |         * associated gettable, etc
  309|       |         */
  310|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  311|      0|                       "missing %s params getter or setter:%s", signature->type_name, desc);
  312|      0|        valid = 0;
  313|      0|    }
  314|     59|    if (valid && initfncnt == 0) {
  ------------------
  |  Branch (314:9): [True: 59, False: 0]
  |  Branch (314:18): [True: 0, False: 59]
  ------------------
  315|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  316|      0|                       "missing %s init:%s", signature->type_name, desc);
  317|      0|        valid = 0;
  318|      0|    }
  319|       |
  320|       |    /* Now we check for function combinations */
  321|     59|    if (valid
  ------------------
  |  Branch (321:9): [True: 59, False: 0]
  ------------------
  322|     59|        && ((signature->sign_init != NULL
  ------------------
  |  Branch (322:14): [True: 40, False: 19]
  ------------------
  323|     59|             && signature->sign == NULL)
  ------------------
  |  Branch (323:17): [True: 0, False: 40]
  ------------------
  324|     59|            || (signature->sign_message_init != NULL
  ------------------
  |  Branch (324:17): [True: 51, False: 8]
  ------------------
  325|     59|                && signature->sign == NULL
  ------------------
  |  Branch (325:20): [True: 0, False: 51]
  ------------------
  326|     59|                && (signature->sign_message_update == NULL
  ------------------
  |  Branch (326:21): [True: 0, False: 0]
  ------------------
  327|      0|                    || signature->sign_message_final == NULL)))) {
  ------------------
  |  Branch (327:24): [True: 0, False: 0]
  ------------------
  328|       |        /* sign_init function(s) with no signing function?  That's weird */
  329|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  330|      0|                       "missing %s signing function:%s", signature->type_name, desc);
  331|      0|        valid = 0;
  332|      0|    }
  333|     59|    if (valid
  ------------------
  |  Branch (333:9): [True: 59, False: 0]
  ------------------
  334|     59|        && (signature->sign != NULL
  ------------------
  |  Branch (334:13): [True: 55, False: 4]
  ------------------
  335|     59|            || signature->sign_message_update != NULL
  ------------------
  |  Branch (335:16): [True: 0, False: 4]
  ------------------
  336|     59|            || signature->sign_message_final != NULL)
  ------------------
  |  Branch (336:16): [True: 0, False: 4]
  ------------------
  337|     59|        && signature->sign_init == NULL
  ------------------
  |  Branch (337:12): [True: 15, False: 40]
  ------------------
  338|     59|        && signature->sign_message_init == NULL) {
  ------------------
  |  Branch (338:12): [True: 0, False: 15]
  ------------------
  339|       |        /* signing function(s) with no sign_init? That's odd */
  340|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  341|      0|                       "missing %s sign_init or sign_message_init:%s", signature->type_name, desc);
  342|      0|        valid = 0;
  343|      0|    }
  344|       |
  345|     59|    if (valid
  ------------------
  |  Branch (345:9): [True: 59, False: 0]
  ------------------
  346|     59|        && ((signature->verify_init != NULL
  ------------------
  |  Branch (346:14): [True: 40, False: 19]
  ------------------
  347|     59|             && signature->verify == NULL)
  ------------------
  |  Branch (347:17): [True: 0, False: 40]
  ------------------
  348|     59|            || (signature->verify_message_init != NULL
  ------------------
  |  Branch (348:17): [True: 51, False: 8]
  ------------------
  349|     59|                && signature->verify == NULL
  ------------------
  |  Branch (349:20): [True: 0, False: 51]
  ------------------
  350|     59|                && (signature->verify_message_update == NULL
  ------------------
  |  Branch (350:21): [True: 0, False: 0]
  ------------------
  351|      0|                    || signature->verify_message_final == NULL)))) {
  ------------------
  |  Branch (351:24): [True: 0, False: 0]
  ------------------
  352|       |        /* verify_init function(s) with no verification function?  That's weird */
  353|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  354|      0|                       "missing %s verification function:%s", signature->type_name, desc);
  355|      0|        valid = 0;
  356|      0|    }
  357|     59|    if (valid
  ------------------
  |  Branch (357:9): [True: 59, False: 0]
  ------------------
  358|     59|        && (signature->verify != NULL
  ------------------
  |  Branch (358:13): [True: 55, False: 4]
  ------------------
  359|     59|            || signature->verify_message_update != NULL
  ------------------
  |  Branch (359:16): [True: 0, False: 4]
  ------------------
  360|     59|            || signature->verify_message_final != NULL)
  ------------------
  |  Branch (360:16): [True: 0, False: 4]
  ------------------
  361|     59|        && signature->verify_init == NULL
  ------------------
  |  Branch (361:12): [True: 15, False: 40]
  ------------------
  362|     59|            && signature->verify_message_init == NULL) {
  ------------------
  |  Branch (362:16): [True: 0, False: 15]
  ------------------
  363|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  364|      0|                       "missing %s verify_init or verify_message_init:%s",
  365|      0|                       signature->type_name, desc);
  366|       |        /* verification function(s) with no verify_init? That's odd */
  367|      0|        valid = 0;
  368|      0|    }
  369|       |
  370|     59|    if (valid
  ------------------
  |  Branch (370:9): [True: 59, False: 0]
  ------------------
  371|     59|        && (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (371:12): [True: 14, False: 45]
  ------------------
  372|     59|            && (signature->verify_recover == NULL)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 14]
  ------------------
  373|       |        /* verify_recover_init function with no verify_recover?  How quaint */
  374|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  375|      0|                       "missing %s verify_recover:%s", signature->type_name, desc);
  376|      0|        valid = 0;
  377|      0|    }
  378|       |
  379|     59|    if (valid
  ------------------
  |  Branch (379:9): [True: 59, False: 0]
  ------------------
  380|     59|        && (signature->digest_sign_init != NULL
  ------------------
  |  Branch (380:13): [True: 25, False: 34]
  ------------------
  381|     59|            && signature->digest_sign == NULL
  ------------------
  |  Branch (381:16): [True: 8, False: 17]
  ------------------
  382|     59|            && (signature->digest_sign_update == NULL
  ------------------
  |  Branch (382:17): [True: 0, False: 8]
  ------------------
  383|      8|                || signature->digest_sign_final == NULL))) {
  ------------------
  |  Branch (383:20): [True: 0, False: 8]
  ------------------
  384|       |        /* You can't have a digest_sign_init without *some* performing functions */
  385|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  386|      0|                       "missing %s digest_sign function:%s", signature->type_name, desc);
  387|      0|        valid = 0;
  388|      0|    }
  389|       |
  390|     59|    if (valid
  ------------------
  |  Branch (390:9): [True: 59, False: 0]
  ------------------
  391|     59|        && ((signature->digest_verify_init != NULL
  ------------------
  |  Branch (391:14): [True: 21, False: 38]
  ------------------
  392|     59|             && signature->digest_verify == NULL
  ------------------
  |  Branch (392:17): [True: 4, False: 17]
  ------------------
  393|     59|             && (signature->digest_verify_update == NULL
  ------------------
  |  Branch (393:18): [True: 0, False: 4]
  ------------------
  394|      4|                 || signature->digest_verify_final == NULL)))) {
  ------------------
  |  Branch (394:21): [True: 0, False: 4]
  ------------------
  395|       |        /* You can't have a digest_verify_init without *some* performing functions */
  396|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  397|      0|                       "missing %s digest_verify function:%s", signature->type_name, desc);
  398|      0|        valid = 0;
  399|      0|    }
  400|       |
  401|     59|    if (!valid)
  ------------------
  |  Branch (401:9): [True: 0, False: 59]
  ------------------
  402|      0|        goto err;
  403|       |
  404|     59|    if ((signature->digest_sign != NULL
  ------------------
  |  Branch (404:10): [True: 17, False: 42]
  ------------------
  405|     59|         || signature->digest_sign_update != NULL
  ------------------
  |  Branch (405:13): [True: 8, False: 34]
  ------------------
  406|     59|         || signature->digest_sign_final != NULL)
  ------------------
  |  Branch (406:13): [True: 0, False: 34]
  ------------------
  407|     59|        && signature->digest_sign_init == NULL) {
  ------------------
  |  Branch (407:12): [True: 0, False: 25]
  ------------------
  408|       |        /* digest signing function(s) with no digest_sign_init? That's odd */
  409|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  410|      0|                       "missing %s digest_sign_init:%s", signature->type_name, desc);
  411|      0|        goto err;
  412|      0|    }
  413|       |
  414|     59|    if ((signature->digest_verify != NULL
  ------------------
  |  Branch (414:10): [True: 17, False: 42]
  ------------------
  415|     59|         || signature->digest_verify_update != NULL
  ------------------
  |  Branch (415:13): [True: 4, False: 38]
  ------------------
  416|     59|         || signature->digest_verify_final != NULL)
  ------------------
  |  Branch (416:13): [True: 0, False: 38]
  ------------------
  417|     59|        && signature->digest_verify_init == NULL) {
  ------------------
  |  Branch (417:12): [True: 0, False: 21]
  ------------------
  418|       |        /* digest verification function(s) with no digest_verify_init? That's odd */
  419|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  420|      0|                       "missing %s digest_verify_init:%s", signature->type_name, desc);
  421|      0|        goto err;
  422|      0|    }
  423|       |
  424|     59|    if ((signature->sign_message_update == NULL) !=
  ------------------
  |  Branch (424:9): [True: 0, False: 59]
  ------------------
  425|     59|        (signature->sign_message_final == NULL)) {
  426|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  427|      0|                       "only one of %s message signing update and final available:%s",
  428|      0|                       signature->type_name, desc);
  429|      0|        goto err;
  430|      0|    }
  431|     59|    if ((signature->verify_message_update == NULL) !=
  ------------------
  |  Branch (431:9): [True: 0, False: 59]
  ------------------
  432|     59|        (signature->verify_message_final == NULL)) {
  433|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  434|      0|                       "only one of %s message verification update and final available:%s",
  435|      0|                       signature->type_name, desc);
  436|      0|        goto err;
  437|      0|    }
  438|     59|    if ((signature->digest_sign_update == NULL) !=
  ------------------
  |  Branch (438:9): [True: 0, False: 59]
  ------------------
  439|     59|        (signature->digest_sign_final == NULL)) {
  440|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  441|      0|                       "only one of %s digest signing update and final available:%s",
  442|      0|                       signature->type_name, desc);
  443|      0|        goto err;
  444|      0|    }
  445|     59|    if ((signature->digest_verify_update == NULL) !=
  ------------------
  |  Branch (445:9): [True: 0, False: 59]
  ------------------
  446|     59|        (signature->digest_verify_final == NULL)) {
  447|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  448|      0|                       "only one of %s digest verification update and final available:%s",
  449|      0|                       signature->type_name, desc);
  450|      0|        goto err;
  451|      0|    }
  452|       |
  453|     59|    return signature;
  454|      0| err:
  455|      0|    EVP_SIGNATURE_free(signature);
  456|      0|    return NULL;
  457|     59|}
signature.c:evp_signature_new:
   34|     59|{
   35|     59|    EVP_SIGNATURE *signature = OPENSSL_zalloc(sizeof(EVP_SIGNATURE));
  ------------------
  |  |  104|     59|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|       |
   37|     59|    if (signature == NULL)
  ------------------
  |  Branch (37:9): [True: 0, False: 59]
  ------------------
   38|      0|        return NULL;
   39|       |
   40|     59|    if (!CRYPTO_NEW_REF(&signature->refcnt, 1)
  ------------------
  |  Branch (40:9): [True: 0, False: 59]
  ------------------
   41|     59|        || !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (41:12): [True: 0, False: 59]
  ------------------
   42|      0|        CRYPTO_FREE_REF(&signature->refcnt);
   43|      0|        OPENSSL_free(signature);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|     59|    signature->prov = prov;
   48|       |
   49|     59|    return signature;
   50|     59|}
signature.c:evp_signature_up_ref:
   29|  1.04k|{
   30|  1.04k|    return EVP_SIGNATURE_up_ref(data);
   31|  1.04k|}
signature.c:evp_signature_free:
   24|    120|{
   25|    120|    EVP_SIGNATURE_free(data);
   26|    120|}

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

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

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

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

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

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

HMAC_Init_ex:
   27|     60|{
   28|     60|    int rv = 0, reset = 0;
   29|     60|    int i, j;
   30|     60|    unsigned char pad[HMAC_MAX_MD_CBLOCK_SIZE];
   31|     60|    unsigned int keytmp_length;
   32|     60|    unsigned char keytmp[HMAC_MAX_MD_CBLOCK_SIZE];
   33|       |
   34|       |    /* If we are changing MD then we must have a key */
   35|     60|    if (md != NULL && md != ctx->md && (key == NULL || len < 0))
  ------------------
  |  Branch (35:9): [True: 60, False: 0]
  |  Branch (35:23): [True: 60, False: 0]
  |  Branch (35:41): [True: 0, False: 60]
  |  Branch (35:56): [True: 0, False: 60]
  ------------------
   36|      0|        return 0;
   37|       |
   38|     60|    if (md != NULL)
  ------------------
  |  Branch (38:9): [True: 60, False: 0]
  ------------------
   39|     60|        ctx->md = md;
   40|      0|    else if (ctx->md != NULL)
  ------------------
  |  Branch (40:14): [True: 0, False: 0]
  ------------------
   41|      0|        md = ctx->md;
   42|      0|    else
   43|      0|        return 0;
   44|       |
   45|       |    /*
   46|       |     * The HMAC construction is not allowed to be used with the
   47|       |     * extendable-output functions (XOF) shake128 and shake256.
   48|       |     */
   49|     60|    if (EVP_MD_xof(md))
  ------------------
  |  Branch (49:9): [True: 0, False: 60]
  ------------------
   50|      0|        return 0;
   51|       |
   52|       |#ifdef OPENSSL_HMAC_S390X
   53|       |    rv = s390x_HMAC_init(ctx, key, len, impl);
   54|       |    if (rv >= 1)
   55|       |        return rv;
   56|       |#endif
   57|       |
   58|     60|    if (key != NULL) {
  ------------------
  |  Branch (58:9): [True: 60, False: 0]
  ------------------
   59|     60|        reset = 1;
   60|       |
   61|     60|        j = EVP_MD_get_block_size(md);
   62|     60|        if (!ossl_assert(j <= (int)sizeof(keytmp)))
  ------------------
  |  |   52|     60|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     60|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (62:13): [True: 0, False: 60]
  ------------------
   63|      0|            return 0;
   64|     60|        if (j < 0)
  ------------------
  |  Branch (64:13): [True: 0, False: 60]
  ------------------
   65|      0|            return 0;
   66|     60|        if (j < len) {
  ------------------
  |  Branch (66:13): [True: 0, False: 60]
  ------------------
   67|      0|            if (!EVP_DigestInit_ex(ctx->md_ctx, md, impl)
  ------------------
  |  Branch (67:17): [True: 0, False: 0]
  ------------------
   68|      0|                    || !EVP_DigestUpdate(ctx->md_ctx, key, len)
  ------------------
  |  Branch (68:24): [True: 0, False: 0]
  ------------------
   69|      0|                    || !EVP_DigestFinal_ex(ctx->md_ctx, keytmp,
  ------------------
  |  Branch (69:24): [True: 0, False: 0]
  ------------------
   70|      0|                                           &keytmp_length))
   71|      0|                return 0;
   72|     60|        } else {
   73|     60|            if (len < 0 || len > (int)sizeof(keytmp))
  ------------------
  |  Branch (73:17): [True: 0, False: 60]
  |  Branch (73:28): [True: 0, False: 60]
  ------------------
   74|      0|                return 0;
   75|     60|            memcpy(keytmp, key, len);
   76|     60|            keytmp_length = len;
   77|     60|        }
   78|     60|        if (keytmp_length != HMAC_MAX_MD_CBLOCK_SIZE)
  ------------------
  |  |   18|     60|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
  |  Branch (78:13): [True: 60, False: 0]
  ------------------
   79|     60|            memset(&keytmp[keytmp_length], 0,
   80|     60|                   HMAC_MAX_MD_CBLOCK_SIZE - keytmp_length);
  ------------------
  |  |   18|     60|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
   81|       |
   82|  8.70k|        for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
  ------------------
  |  |   18|  8.70k|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
  |  Branch (82:21): [True: 8.64k, False: 60]
  ------------------
   83|  8.64k|            pad[i] = 0x36 ^ keytmp[i];
   84|     60|        if (!EVP_DigestInit_ex(ctx->i_ctx, md, impl)
  ------------------
  |  Branch (84:13): [True: 0, False: 60]
  ------------------
   85|     60|                || !EVP_DigestUpdate(ctx->i_ctx, pad,
  ------------------
  |  Branch (85:20): [True: 0, False: 60]
  ------------------
   86|     60|                                     EVP_MD_get_block_size(md)))
   87|      0|            goto err;
   88|       |
   89|  8.70k|        for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
  ------------------
  |  |   18|  8.70k|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
  |  Branch (89:21): [True: 8.64k, False: 60]
  ------------------
   90|  8.64k|            pad[i] = 0x5c ^ keytmp[i];
   91|     60|        if (!EVP_DigestInit_ex(ctx->o_ctx, md, impl)
  ------------------
  |  Branch (91:13): [True: 0, False: 60]
  ------------------
   92|     60|                || !EVP_DigestUpdate(ctx->o_ctx, pad,
  ------------------
  |  Branch (92:20): [True: 0, False: 60]
  ------------------
   93|     60|                                     EVP_MD_get_block_size(md)))
   94|      0|            goto err;
   95|     60|    }
   96|     60|    if (!EVP_MD_CTX_copy_ex(ctx->md_ctx, ctx->i_ctx))
  ------------------
  |  Branch (96:9): [True: 0, False: 60]
  ------------------
   97|      0|        goto err;
   98|     60|    rv = 1;
   99|     60| err:
  100|     60|    if (reset) {
  ------------------
  |  Branch (100:9): [True: 60, False: 0]
  ------------------
  101|     60|        OPENSSL_cleanse(keytmp, sizeof(keytmp));
  102|     60|        OPENSSL_cleanse(pad, sizeof(pad));
  103|     60|    }
  104|     60|    return rv;
  105|     60|}
HMAC_Update:
  117|     60|{
  118|     60|    if (!ctx->md)
  ------------------
  |  Branch (118:9): [True: 0, False: 60]
  ------------------
  119|      0|        return 0;
  120|       |
  121|       |#ifdef OPENSSL_HMAC_S390X
  122|       |    if (ctx->plat.s390x.fc)
  123|       |        return s390x_HMAC_update(ctx, data, len);
  124|       |#endif
  125|       |
  126|     60|    return EVP_DigestUpdate(ctx->md_ctx, data, len);
  127|     60|}
HMAC_Final:
  130|     60|{
  131|     60|    unsigned int i;
  132|     60|    unsigned char buf[EVP_MAX_MD_SIZE];
  133|       |
  134|     60|    if (!ctx->md)
  ------------------
  |  Branch (134:9): [True: 0, False: 60]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |#ifdef OPENSSL_HMAC_S390X
  138|       |    if (ctx->plat.s390x.fc)
  139|       |        return s390x_HMAC_final(ctx, md, len);
  140|       |#endif
  141|       |
  142|     60|    if (!EVP_DigestFinal_ex(ctx->md_ctx, buf, &i))
  ------------------
  |  Branch (142:9): [True: 0, False: 60]
  ------------------
  143|      0|        goto err;
  144|     60|    if (!EVP_MD_CTX_copy_ex(ctx->md_ctx, ctx->o_ctx))
  ------------------
  |  Branch (144:9): [True: 0, False: 60]
  ------------------
  145|      0|        goto err;
  146|     60|    if (!EVP_DigestUpdate(ctx->md_ctx, buf, i))
  ------------------
  |  Branch (146:9): [True: 0, False: 60]
  ------------------
  147|      0|        goto err;
  148|     60|    if (!EVP_DigestFinal_ex(ctx->md_ctx, md, len))
  ------------------
  |  Branch (148:9): [True: 0, False: 60]
  ------------------
  149|      0|        goto err;
  150|     60|    return 1;
  151|      0| err:
  152|      0|    return 0;
  153|     60|}
HMAC_size:
  156|     60|{
  157|     60|    int size = EVP_MD_get_size((ctx)->md);
  158|       |
  159|     60|    return (size < 0) ? 0 : size;
  ------------------
  |  Branch (159:12): [True: 0, False: 60]
  ------------------
  160|     60|}
HMAC_CTX_new:
  163|     68|{
  164|     68|    HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
  ------------------
  |  |  104|     68|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|       |
  166|     68|    if (ctx != NULL) {
  ------------------
  |  Branch (166:9): [True: 68, False: 0]
  ------------------
  167|     68|        if (!HMAC_CTX_reset(ctx)) {
  ------------------
  |  Branch (167:13): [True: 0, False: 68]
  ------------------
  168|      0|            HMAC_CTX_free(ctx);
  169|      0|            return NULL;
  170|      0|        }
  171|     68|    }
  172|     68|    return ctx;
  173|     68|}
HMAC_CTX_free:
  188|     68|{
  189|     68|    if (ctx != NULL) {
  ------------------
  |  Branch (189:9): [True: 68, False: 0]
  ------------------
  190|     68|        hmac_ctx_cleanup(ctx);
  191|     68|        EVP_MD_CTX_free(ctx->i_ctx);
  192|     68|        EVP_MD_CTX_free(ctx->o_ctx);
  193|     68|        EVP_MD_CTX_free(ctx->md_ctx);
  194|     68|        OPENSSL_free(ctx);
  ------------------
  |  |  115|     68|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  195|     68|    }
  196|     68|}
HMAC_CTX_reset:
  216|     68|{
  217|     68|    hmac_ctx_cleanup(ctx);
  218|     68|    if (!hmac_ctx_alloc_mds(ctx)) {
  ------------------
  |  Branch (218:9): [True: 0, False: 68]
  ------------------
  219|      0|        hmac_ctx_cleanup(ctx);
  220|      0|        return 0;
  221|      0|    }
  222|     68|    return 1;
  223|     68|}
hmac.c:hmac_ctx_cleanup:
  176|    136|{
  177|    136|    EVP_MD_CTX_reset(ctx->i_ctx);
  178|    136|    EVP_MD_CTX_reset(ctx->o_ctx);
  179|    136|    EVP_MD_CTX_reset(ctx->md_ctx);
  180|    136|    ctx->md = NULL;
  181|       |
  182|       |#ifdef OPENSSL_HMAC_S390X
  183|       |    s390x_HMAC_CTX_cleanup(ctx);
  184|       |#endif
  185|    136|}
hmac.c:hmac_ctx_alloc_mds:
  199|     68|{
  200|     68|    if (ctx->i_ctx == NULL)
  ------------------
  |  Branch (200:9): [True: 68, False: 0]
  ------------------
  201|     68|        ctx->i_ctx = EVP_MD_CTX_new();
  202|     68|    if (ctx->i_ctx == NULL)
  ------------------
  |  Branch (202:9): [True: 0, False: 68]
  ------------------
  203|      0|        return 0;
  204|     68|    if (ctx->o_ctx == NULL)
  ------------------
  |  Branch (204:9): [True: 68, False: 0]
  ------------------
  205|     68|        ctx->o_ctx = EVP_MD_CTX_new();
  206|     68|    if (ctx->o_ctx == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 68]
  ------------------
  207|      0|        return 0;
  208|     68|    if (ctx->md_ctx == NULL)
  ------------------
  |  Branch (208:9): [True: 68, False: 0]
  ------------------
  209|     68|        ctx->md_ctx = EVP_MD_CTX_new();
  210|     68|    if (ctx->md_ctx == NULL)
  ------------------
  |  Branch (210:9): [True: 0, False: 68]
  ------------------
  211|      0|        return 0;
  212|     68|    return 1;
  213|     68|}

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

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

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

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

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

MD5_Init:
   30|     62|{
   31|     62|    memset(c, 0, sizeof(*c));
   32|     62|    c->A = INIT_DATA_A;
  ------------------
  |  |   24|     62|#define INIT_DATA_A (unsigned long)0x67452301L
  ------------------
   33|     62|    c->B = INIT_DATA_B;
  ------------------
  |  |   25|     62|#define INIT_DATA_B (unsigned long)0xefcdab89L
  ------------------
   34|     62|    c->C = INIT_DATA_C;
  ------------------
  |  |   26|     62|#define INIT_DATA_C (unsigned long)0x98badcfeL
  ------------------
   35|     62|    c->D = INIT_DATA_D;
  ------------------
  |  |   27|     62|#define INIT_DATA_D (unsigned long)0x10325476L
  ------------------
   36|     62|    return 1;
   37|     62|}

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

CRYPTO_secure_malloc_done:
  132|      2|{
  133|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        sh_done();
  136|      2|        secure_mem_initialized = 0;
  137|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      2|        sec_malloc_lock = NULL;
  139|      2|        return 1;
  140|      2|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      2|}
CRYPTO_secure_malloc:
  155|     60|{
  156|     60|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|     60|    void *ret = NULL;
  158|     60|    size_t actual_size;
  159|     60|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|     60|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|     60|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 60, False: 0]
  ------------------
  162|     60|        return CRYPTO_malloc(num, file, line);
  163|     60|    }
  164|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  327|      0|# define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  |  |  ------------------
  |  |               # define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|      0|        goto err;
  167|      0|    }
  168|      0|    ret = sh_malloc(num);
  169|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (169:19): [True: 0, False: 0]
  ------------------
  170|      0|    secure_mem_used += actual_size;
  171|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  172|      0| err:
  173|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  |  Branch (173:25): [True: 0, False: 0]
  |  Branch (173:41): [True: 0, False: 0]
  ------------------
  174|      0|        ERR_new();
  175|      0|        ERR_set_debug(file, line, NULL);
  176|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
  177|      0|    }
  178|      0|    return ret;
  179|       |#else
  180|       |    return CRYPTO_malloc(num, file, line);
  181|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  182|      0|}
CRYPTO_secure_clear_free:
  219|     77|{
  220|     77|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|     77|    size_t actual_size;
  222|       |
  223|     77|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 17, False: 60]
  ------------------
  224|     17|        return;
  225|     60|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 60, False: 0]
  ------------------
  226|     60|        OPENSSL_cleanse(ptr, num);
  227|     60|        CRYPTO_free(ptr, file, line);
  228|     60|        return;
  229|     60|    }
  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|     60|{
  247|     60|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|     60|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 60, False: 0]
  ------------------
  249|     60|        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|     60|}
mem_sec.c:sh_done:
  599|      2|{
  600|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  602|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  603|      2|#if !defined(_WIN32)
  604|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 2, False: 0]
  |  Branch (604:40): [True: 0, False: 2]
  ------------------
  605|      0|        munmap(sh.map_result, sh.map_size);
  606|       |#else
  607|       |    if (sh.map_result != NULL && sh.map_size)
  608|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  609|       |#endif
  610|      2|    memset(&sh, 0, sizeof(sh));
  611|      2|}

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

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

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

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

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

OPENSSL_gmtime:
   15|  10.7k|{
   16|  10.7k|    struct tm *ts = NULL;
   17|       |
   18|       |#if defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_VMS)
   19|       |    {
   20|       |        /*
   21|       |         * On VMS, gmtime_r() takes a 32-bit pointer as second argument.
   22|       |         * Since we can't know that |result| is in a space that can easily
   23|       |         * translate to a 32-bit pointer, we must store temporarily on stack
   24|       |         * and copy the result.  The stack is always reachable with 32-bit
   25|       |         * pointers.
   26|       |         */
   27|       |#if defined(OPENSSL_SYS_VMS) && __INITIAL_POINTER_SIZE
   28|       |# pragma pointer_size save
   29|       |# pragma pointer_size 32
   30|       |#endif
   31|       |        struct tm data, *ts2 = &data;
   32|       |#if defined OPENSSL_SYS_VMS && __INITIAL_POINTER_SIZE
   33|       |# pragma pointer_size restore
   34|       |#endif
   35|       |        if (gmtime_r(timer, ts2) == NULL)
   36|       |            return NULL;
   37|       |        memcpy(result, ts2, sizeof(struct tm));
   38|       |        ts = result;
   39|       |    }
   40|       |#elif defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_MACOSX)
   41|  10.7k|    if (gmtime_r(timer, result) == NULL)
  ------------------
  |  Branch (41:9): [True: 0, False: 10.7k]
  ------------------
   42|      0|        return NULL;
   43|  10.7k|    ts = result;
   44|       |#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_WIN32_WCE)
   45|       |    if (gmtime_s(result, timer))
   46|       |        return NULL;
   47|       |    ts = result;
   48|       |#else
   49|       |    ts = gmtime(timer);
   50|       |    if (ts == NULL)
   51|       |        return NULL;
   52|       |
   53|       |    memcpy(result, ts, sizeof(struct tm));
   54|       |    ts = result;
   55|       |#endif
   56|  10.7k|    return ts;
   57|  10.7k|}
OPENSSL_gmtime_adj:
   73|     51|{
   74|     51|    int time_sec, time_year, time_month, time_day;
   75|     51|    long time_jd;
   76|       |
   77|       |    /* Convert time and offset into Julian day and seconds */
   78|     51|    if (!julian_adj(tm, off_day, offset_sec, &time_jd, &time_sec))
  ------------------
  |  Branch (78:9): [True: 0, False: 51]
  ------------------
   79|      0|        return 0;
   80|       |
   81|       |    /* Convert Julian day back to date */
   82|       |
   83|     51|    julian_to_date(time_jd, &time_year, &time_month, &time_day);
   84|       |
   85|     51|    if (time_year < 1900 || time_year > 9999)
  ------------------
  |  Branch (85:9): [True: 4, False: 47]
  |  Branch (85:29): [True: 0, False: 47]
  ------------------
   86|      4|        return 0;
   87|       |
   88|       |    /* Update tm structure */
   89|       |
   90|     47|    tm->tm_year = time_year - 1900;
   91|     47|    tm->tm_mon = time_month - 1;
   92|     47|    tm->tm_mday = time_day;
   93|       |
   94|     47|    tm->tm_hour = time_sec / 3600;
   95|     47|    tm->tm_min = (time_sec / 60) % 60;
   96|     47|    tm->tm_sec = time_sec % 60;
   97|       |
   98|     47|    return 1;
   99|       |
  100|     51|}
OPENSSL_gmtime_diff:
  104|  2.46k|{
  105|  2.46k|    int from_sec, to_sec, diff_sec;
  106|  2.46k|    long from_jd, to_jd, diff_day;
  107|  2.46k|    if (!julian_adj(from, 0, 0, &from_jd, &from_sec))
  ------------------
  |  Branch (107:9): [True: 0, False: 2.46k]
  ------------------
  108|      0|        return 0;
  109|  2.46k|    if (!julian_adj(to, 0, 0, &to_jd, &to_sec))
  ------------------
  |  Branch (109:9): [True: 0, False: 2.46k]
  ------------------
  110|      0|        return 0;
  111|  2.46k|    diff_day = to_jd - from_jd;
  112|  2.46k|    diff_sec = to_sec - from_sec;
  113|       |    /* Adjust differences so both positive or both negative */
  114|  2.46k|    if (diff_day > 0 && diff_sec < 0) {
  ------------------
  |  Branch (114:9): [True: 1.93k, False: 538]
  |  Branch (114:25): [True: 1.78k, False: 145]
  ------------------
  115|  1.78k|        diff_day--;
  116|  1.78k|        diff_sec += SECS_PER_DAY;
  ------------------
  |  |   65|  1.78k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  117|  1.78k|    }
  118|  2.46k|    if (diff_day < 0 && diff_sec > 0) {
  ------------------
  |  Branch (118:9): [True: 538, False: 1.93k]
  |  Branch (118:25): [True: 72, False: 466]
  ------------------
  119|     72|        diff_day++;
  120|     72|        diff_sec -= SECS_PER_DAY;
  ------------------
  |  |   65|     72|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  121|     72|    }
  122|       |
  123|  2.46k|    if (pday)
  ------------------
  |  Branch (123:9): [True: 2.46k, False: 0]
  ------------------
  124|  2.46k|        *pday = (int)diff_day;
  125|  2.46k|    if (psec)
  ------------------
  |  Branch (125:9): [True: 2.46k, False: 0]
  ------------------
  126|  2.46k|        *psec = diff_sec;
  127|       |
  128|  2.46k|    return 1;
  129|       |
  130|  2.46k|}
o_time.c:julian_adj:
  135|  4.98k|{
  136|  4.98k|    int offset_hms;
  137|  4.98k|    long offset_day, time_jd;
  138|  4.98k|    int time_year, time_month, time_day;
  139|       |    /* split offset into days and day seconds */
  140|  4.98k|    offset_day = offset_sec / SECS_PER_DAY;
  ------------------
  |  |   65|  4.98k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  141|       |    /* Avoid sign issues with % operator */
  142|  4.98k|    offset_hms = offset_sec - (offset_day * SECS_PER_DAY);
  ------------------
  |  |   65|  4.98k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  143|  4.98k|    offset_day += off_day;
  144|       |    /* Add current time seconds to offset */
  145|  4.98k|    offset_hms += tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
  146|       |    /* Adjust day seconds if overflow */
  147|  4.98k|    if (offset_hms >= SECS_PER_DAY) {
  ------------------
  |  |   65|  4.98k|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  |  Branch (147:9): [True: 1, False: 4.98k]
  ------------------
  148|      1|        offset_day++;
  149|      1|        offset_hms -= SECS_PER_DAY;
  ------------------
  |  |   65|      1|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  150|  4.98k|    } else if (offset_hms < 0) {
  ------------------
  |  Branch (150:16): [True: 23, False: 4.96k]
  ------------------
  151|     23|        offset_day--;
  152|     23|        offset_hms += SECS_PER_DAY;
  ------------------
  |  |   65|     23|#define SECS_PER_DAY (24 * 60 * 60)
  ------------------
  153|     23|    }
  154|       |
  155|       |    /*
  156|       |     * Convert date of time structure into a Julian day number.
  157|       |     */
  158|       |
  159|  4.98k|    time_year = tm->tm_year + 1900;
  160|  4.98k|    time_month = tm->tm_mon + 1;
  161|  4.98k|    time_day = tm->tm_mday;
  162|       |
  163|  4.98k|    time_jd = date_to_julian(time_year, time_month, time_day);
  164|       |
  165|       |    /* Work out Julian day of new date */
  166|  4.98k|    time_jd += offset_day;
  167|       |
  168|  4.98k|    if (time_jd < 0)
  ------------------
  |  Branch (168:9): [True: 0, False: 4.98k]
  ------------------
  169|      0|        return 0;
  170|       |
  171|  4.98k|    *pday = time_jd;
  172|  4.98k|    *psec = offset_hms;
  173|  4.98k|    return 1;
  174|  4.98k|}
o_time.c:date_to_julian:
  180|  4.98k|{
  181|  4.98k|    return (1461 * (y + 4800 + (m - 14) / 12)) / 4 +
  182|  4.98k|        (367 * (m - 2 - 12 * ((m - 14) / 12))) / 12 -
  183|  4.98k|        (3 * ((y + 4900 + (m - 14) / 12) / 100)) / 4 + d - 32075;
  184|  4.98k|}
o_time.c:julian_to_date:
  187|     51|{
  188|     51|    long L = jd + 68569;
  189|     51|    long n = (4 * L) / 146097;
  190|     51|    long i, j;
  191|       |
  192|     51|    L = L - (146097 * n + 3) / 4;
  193|     51|    i = (4000 * (L + 1)) / 1461001;
  194|     51|    L = L - (1461 * i) / 4 + 31;
  195|     51|    j = (80 * L) / 2447;
  196|     51|    *d = L - (2447 * j) / 80;
  197|     51|    L = j / 11;
  198|     51|    *m = j + 2 - (12 * L);
  199|     51|    *y = 100 * (n - 49) + i + L;
  200|     51|}

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

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

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

OBJ_find_sigid_algs:
  104|  3.18k|{
  105|  3.18k|    return ossl_obj_find_sigid_algs(signid, pdig_nid, ppkey_nid, 1);
  106|  3.18k|}
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|}
obj_xref.c:ossl_obj_find_sigid_algs:
   68|  3.18k|{
   69|  3.18k|    nid_triple tmp;
   70|  3.18k|    const nid_triple *rv;
   71|  3.18k|    int idx;
   72|       |
   73|  3.18k|    if (signid == NID_undef)
  ------------------
  |  |   18|  3.18k|#define NID_undef                       0
  ------------------
  |  Branch (73:9): [True: 479, False: 2.70k]
  ------------------
   74|    479|        return 0;
   75|       |
   76|  2.70k|    tmp.sign_id = signid;
   77|  2.70k|    rv = OBJ_bsearch_sig(&tmp, sigoid_srt, OSSL_NELEM(sigoid_srt));
  ------------------
  |  |   14|  2.70k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   78|  2.70k|    if (rv == NULL) {
  ------------------
  |  Branch (78:9): [True: 121, False: 2.58k]
  ------------------
   79|    121|        if (!obj_sig_init())
  ------------------
  |  Branch (79:13): [True: 0, False: 121]
  ------------------
   80|      0|            return 0;
   81|    121|        if (lock && !CRYPTO_THREAD_read_lock(sig_lock)) {
  ------------------
  |  Branch (81:13): [True: 121, False: 0]
  |  Branch (81:21): [True: 0, False: 121]
  ------------------
   82|      0|            ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   83|      0|            return 0;
   84|      0|        }
   85|    121|        if (sig_app != NULL) {
  ------------------
  |  Branch (85:13): [True: 0, False: 121]
  ------------------
   86|      0|            idx = sk_nid_triple_find(sig_app, &tmp);
   87|      0|            if (idx >= 0)
  ------------------
  |  Branch (87:17): [True: 0, False: 0]
  ------------------
   88|      0|                rv = sk_nid_triple_value(sig_app, idx);
   89|      0|        }
   90|    121|        if (lock)
  ------------------
  |  Branch (90:13): [True: 121, False: 0]
  ------------------
   91|    121|            CRYPTO_THREAD_unlock(sig_lock);
   92|    121|        if (rv == NULL)
  ------------------
  |  Branch (92:13): [True: 121, False: 0]
  ------------------
   93|    121|            return 0;
   94|    121|    }
   95|       |
   96|  2.58k|    if (pdig_nid != NULL)
  ------------------
  |  Branch (96:9): [True: 1.92k, False: 660]
  ------------------
   97|  1.92k|        *pdig_nid = rv->hash_id;
   98|  2.58k|    if (ppkey_nid != NULL)
  ------------------
  |  Branch (98:9): [True: 2.58k, False: 0]
  ------------------
   99|  2.58k|        *ppkey_nid = rv->pkey_id;
  100|  2.58k|    return 1;
  101|  2.70k|}
obj_xref.c:sig_cmp:
   20|  14.9k|{
   21|  14.9k|    return a->sign_id - b->sign_id;
   22|  14.9k|}
obj_xref.c:obj_sig_init:
   62|    121|{
   63|    121|    return RUN_ONCE(&sig_init, o_sig_init);
  ------------------
  |  |  130|    121|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 121, False: 0]
  |  |  ------------------
  ------------------
   64|    121|}
obj_xref.c:o_sig_init:
   56|      1|{
   57|      1|    sig_lock = CRYPTO_THREAD_lock_new();
   58|      1|    return sig_lock != NULL;
   59|      1|}

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|      3|{
  113|      3|    OCSP_CRLID *a = in;
  114|      3|    if (a->crlUrl) {
  ------------------
  |  Branch (114:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (a->crlNum) {
  ------------------
  |  Branch (122:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (a->crlTime) {
  ------------------
  |  Branch (130:9): [True: 0, False: 3]
  ------------------
  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|      3|    return 1;
  139|      0| err:
  140|      0|    return 0;
  141|      3|}
v3_ocsp.c:i2r_ocsp_acutoff:
  145|      5|{
  146|      5|    if (BIO_printf(bp, "%*s", ind, "") <= 0)
  ------------------
  |  Branch (146:9): [True: 0, False: 5]
  ------------------
  147|      0|        return 0;
  148|      5|    if (!ASN1_GENERALIZEDTIME_print(bp, cutoff))
  ------------------
  |  Branch (148:9): [True: 5, False: 0]
  ------------------
  149|      5|        return 0;
  150|      0|    return 1;
  151|      5|}
v3_ocsp.c:i2r_object:
  155|      3|{
  156|      3|    if (BIO_printf(bp, "%*s", ind, "") <= 0)
  ------------------
  |  Branch (156:9): [True: 0, False: 3]
  ------------------
  157|      0|        return 0;
  158|      3|    if (i2a_ASN1_OBJECT(bp, oid) <= 0)
  ------------------
  |  Branch (158:9): [True: 0, False: 3]
  ------------------
  159|      0|        return 0;
  160|      3|    return 1;
  161|      3|}
v3_ocsp.c:d2i_ocsp_nonce:
  184|      9|{
  185|      9|    ASN1_OCTET_STRING *os, **pos;
  186|      9|    pos = a;
  187|      9|    if (pos == NULL || *pos == NULL) {
  ------------------
  |  Branch (187:9): [True: 9, False: 0]
  |  Branch (187:24): [True: 0, False: 0]
  ------------------
  188|      9|        os = ASN1_OCTET_STRING_new();
  189|      9|        if (os == NULL)
  ------------------
  |  Branch (189:13): [True: 0, False: 9]
  ------------------
  190|      0|            goto err;
  191|      9|    } else {
  192|      0|        os = *pos;
  193|      0|    }
  194|      9|    if (!ASN1_OCTET_STRING_set(os, *pp, length))
  ------------------
  |  Branch (194:9): [True: 0, False: 9]
  ------------------
  195|      0|        goto err;
  196|       |
  197|      9|    *pp += length;
  198|       |
  199|      9|    if (pos)
  ------------------
  |  Branch (199:9): [True: 0, False: 9]
  ------------------
  200|      0|        *pos = os;
  201|      9|    return os;
  202|       |
  203|      0| err:
  204|      0|    if ((pos == NULL) || (*pos != os))
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  |  Branch (204:26): [True: 0, False: 0]
  ------------------
  205|      0|        ASN1_OCTET_STRING_free(os);
  206|      0|    ERR_raise(ERR_LIB_OCSP, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  207|      0|    return NULL;
  208|      9|}
v3_ocsp.c:ocsp_nonce_free:
  211|      9|{
  212|      9|    ASN1_OCTET_STRING_free(a);
  213|      9|}
v3_ocsp.c:i2r_ocsp_nonce:
  217|      9|{
  218|      9|    if (BIO_printf(out, "%*s", indent, "") <= 0)
  ------------------
  |  Branch (218:9): [True: 0, False: 9]
  ------------------
  219|      0|        return 0;
  220|      9|    if (i2a_ASN1_STRING(out, nonce, V_ASN1_OCTET_STRING) <= 0)
  ------------------
  |  |   66|      9|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (220:9): [True: 0, False: 9]
  ------------------
  221|      0|        return 0;
  222|      9|    return 1;
  223|      9|}
v3_ocsp.c:i2r_ocsp_serviceloc:
  241|      3|{
  242|      3|    int i;
  243|      3|    OCSP_SERVICELOC *a = in;
  244|      3|    ACCESS_DESCRIPTION *ad;
  245|       |
  246|      3|    if (BIO_printf(bp, "%*sIssuer: ", ind, "") <= 0)
  ------------------
  |  Branch (246:9): [True: 0, False: 3]
  ------------------
  247|      0|        goto err;
  248|      3|    if (X509_NAME_print_ex(bp, a->issuer, 0, XN_FLAG_ONELINE) <= 0)
  ------------------
  |  |  358|      3|# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  |  |  ------------------
  |  |  |  |  516|      3|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  441|      3|# define ASN1_STRFLGS_ESC_2253           1
  |  |  |  |  ------------------
  |  |  |  |  517|      3|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|      3|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  |  |  ------------------
  |  |  |  |  518|      3|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  443|      3|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  |  |  ------------------
  |  |  |  |  519|      3|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  475|      3|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  |  |  ------------------
  |  |  |  |  520|      3|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  497|      3|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  |  |  ------------------
  |  |  |  |  521|      3|                                ASN1_STRFLGS_DUMP_DER)
  |  |  |  |  ------------------
  |  |  |  |  |  |  504|      3|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  359|      3|                        ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|      3|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |  360|      3|                        XN_FLAG_SEP_CPLUS_SPC | \
  |  |  ------------------
  |  |  |  |  321|      3|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  |  |  ------------------
  |  |  361|      3|                        XN_FLAG_SPC_EQ | \
  |  |  ------------------
  |  |  |  |  336|      3|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  |  |  ------------------
  |  |  362|      3|                        XN_FLAG_FN_SN)
  |  |  ------------------
  |  |  |  |  331|      3|# define XN_FLAG_FN_SN           0/* Object short name */
  |  |  ------------------
  ------------------
  |  Branch (248:9): [True: 3, False: 0]
  ------------------
  249|      3|        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|      3| err:
  263|      3|    return 0;
  264|      0|}

WPACKET_allocate_bytes:
   20|   101k|{
   21|   101k|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 101k]
  ------------------
   22|      0|        return 0;
   23|       |
   24|   101k|    pkt->written += len;
   25|   101k|    pkt->curr += len;
   26|   101k|    return 1;
   27|   101k|}
WPACKET_reserve_bytes:
   47|   101k|{
   48|       |    /* Internal API, so should not fail */
   49|   101k|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|   203k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 101k, False: 0]
  |  |  |  Branch (52:43): [True: 101k, False: 0]
  |  |  ------------------
  |  |   53|   101k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 101k]
  ------------------
   50|      0|        return 0;
   51|       |
   52|   101k|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 101k]
  ------------------
   53|      0|        return 0;
   54|       |
   55|   101k|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 656, False: 100k]
  |  Branch (55:29): [True: 82, False: 574]
  ------------------
   56|     82|        size_t newlen;
   57|     82|        size_t reflen;
   58|       |
   59|     82|        reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
  ------------------
  |  Branch (59:18): [True: 82, False: 0]
  ------------------
   60|       |
   61|     82|        if (reflen > SIZE_MAX / 2) {
  ------------------
  |  Branch (61:13): [True: 0, False: 82]
  ------------------
   62|      0|            newlen = SIZE_MAX;
   63|     82|        } else {
   64|     82|            newlen = reflen * 2;
   65|     82|            if (newlen < DEFAULT_BUF_SIZE)
  ------------------
  |  |   17|     82|#define DEFAULT_BUF_SIZE    256
  ------------------
  |  Branch (65:17): [True: 82, False: 0]
  ------------------
   66|     82|                newlen = DEFAULT_BUF_SIZE;
  ------------------
  |  |   17|     82|#define DEFAULT_BUF_SIZE    256
  ------------------
   67|     82|        }
   68|     82|        if (BUF_MEM_grow(pkt->buf, newlen) == 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 82]
  ------------------
   69|      0|            return 0;
   70|     82|    }
   71|   101k|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 101k, False: 0]
  ------------------
   72|   101k|        *allocbytes = WPACKET_get_curr(pkt);
   73|   101k|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 480, False: 101k]
  |  Branch (73:30): [True: 480, False: 0]
  ------------------
   74|    480|            *allocbytes -= len;
   75|   101k|    }
   76|       |
   77|   101k|    return 1;
   78|   101k|}
WPACKET_init_der:
  147|    160|{
  148|       |    /* Internal API, so should not fail */
  149|    160|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|    320|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 160, False: 0]
  |  |  |  Branch (52:43): [True: 160, False: 0]
  |  |  ------------------
  |  |   53|    160|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 160]
  ------------------
  150|      0|        return 0;
  151|       |
  152|    160|    pkt->staticbuf = buf;
  153|    160|    pkt->buf = NULL;
  154|    160|    pkt->maxsize = len;
  155|    160|    pkt->endfirst = 1;
  156|       |
  157|    160|    return wpacket_intern_init_len(pkt, 0);
  158|    160|}
WPACKET_init_len:
  161|     82|{
  162|       |    /* Internal API, so should not fail */
  163|     82|    if (!ossl_assert(buf != NULL))
  ------------------
  |  |   52|     82|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     82|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (163:9): [True: 0, False: 82]
  ------------------
  164|      0|        return 0;
  165|       |
  166|     82|    pkt->staticbuf = NULL;
  167|     82|    pkt->buf = buf;
  168|     82|    pkt->maxsize = maxmaxsize(lenbytes);
  169|     82|    pkt->endfirst = 0;
  170|       |
  171|     82|    return wpacket_intern_init_len(pkt, lenbytes);
  172|     82|}
WPACKET_init_null:
  180|  12.5k|{
  181|  12.5k|    pkt->staticbuf = NULL;
  182|  12.5k|    pkt->buf = NULL;
  183|  12.5k|    pkt->maxsize = maxmaxsize(lenbytes);
  184|  12.5k|    pkt->endfirst = 0;
  185|       |
  186|  12.5k|    return wpacket_intern_init_len(pkt, 0);
  187|  12.5k|}
WPACKET_close:
  335|  38.0k|{
  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|  38.0k|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 38.0k]
  |  Branch (340:30): [True: 0, False: 38.0k]
  ------------------
  341|      0|        return 0;
  342|       |
  343|  38.0k|    return wpacket_intern_close(pkt, pkt->subs, 1);
  344|  38.0k|}
WPACKET_finish:
  347|  12.8k|{
  348|  12.8k|    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|  12.8k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 12.8k]
  |  Branch (354:30): [True: 0, False: 12.8k]
  ------------------
  355|      0|        return 0;
  356|       |
  357|  12.8k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  358|  12.8k|    if (ret) {
  ------------------
  |  Branch (358:9): [True: 12.8k, False: 0]
  ------------------
  359|  12.8k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|  12.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|  12.8k|        pkt->subs = NULL;
  361|  12.8k|    }
  362|       |
  363|  12.8k|    return ret;
  364|  12.8k|}
WPACKET_start_sub_packet_len__:
  367|  38.0k|{
  368|  38.0k|    WPACKET_SUB *sub;
  369|  38.0k|    unsigned char *lenchars;
  370|       |
  371|       |    /* Internal API, so should not fail */
  372|  38.0k|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|  38.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  38.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (372:9): [True: 0, False: 38.0k]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  376|  38.0k|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (376:9): [True: 0, False: 38.0k]
  |  Branch (376:25): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|  38.0k|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |  104|  38.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  38.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  38.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 38.0k]
  ------------------
  380|      0|        return 0;
  381|       |
  382|  38.0k|    sub->parent = pkt->subs;
  383|  38.0k|    pkt->subs = sub;
  384|  38.0k|    sub->pwritten = pkt->written + lenbytes;
  385|  38.0k|    sub->lenbytes = lenbytes;
  386|       |
  387|  38.0k|    if (lenbytes == 0) {
  ------------------
  |  Branch (387:9): [True: 38.0k, False: 0]
  ------------------
  388|  38.0k|        sub->packet_len = 0;
  389|  38.0k|        return 1;
  390|  38.0k|    }
  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|  38.0k|{
  402|  38.0k|    return WPACKET_start_sub_packet_len__(pkt, 0);
  403|  38.0k|}
WPACKET_put_bytes__:
  406|  76.0k|{
  407|  76.0k|    unsigned char *data;
  408|       |
  409|       |    /* Internal API, so should not fail */
  410|  76.0k|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|   152k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   152k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (410:9): [True: 0, False: 76.0k]
  ------------------
  411|  76.0k|            || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (411:16): [True: 0, False: 76.0k]
  ------------------
  412|  76.0k|            || !put_value(data, val, size))
  ------------------
  |  Branch (412:16): [True: 0, False: 76.0k]
  ------------------
  413|      0|        return 0;
  414|       |
  415|  76.0k|    return 1;
  416|  76.0k|}
WPACKET_memcpy:
  460|    160|{
  461|    160|    unsigned char *dest;
  462|       |
  463|    160|    if (len == 0)
  ------------------
  |  Branch (463:9): [True: 0, False: 160]
  ------------------
  464|      0|        return 1;
  465|       |
  466|    160|    if (!WPACKET_allocate_bytes(pkt, len, &dest))
  ------------------
  |  Branch (466:9): [True: 0, False: 160]
  ------------------
  467|      0|        return 0;
  468|       |
  469|    160|    if (dest != NULL)
  ------------------
  |  Branch (469:9): [True: 160, False: 0]
  ------------------
  470|    160|        memcpy(dest, src, len);
  471|       |
  472|    160|    return 1;
  473|    160|}
WPACKET_get_total_written:
  487|  13.0k|{
  488|       |    /* Internal API, so should not fail */
  489|  13.0k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|  13.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  13.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (489:9): [True: 0, False: 13.0k]
  ------------------
  490|      0|        return 0;
  491|       |
  492|  13.0k|    *written = pkt->written;
  493|       |
  494|  13.0k|    return 1;
  495|  13.0k|}
WPACKET_get_length:
  498|  12.5k|{
  499|       |    /* Internal API, so should not fail */
  500|  12.5k|    if (!ossl_assert(pkt->subs != NULL && len != NULL))
  ------------------
  |  |   52|  25.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 12.5k, False: 0]
  |  |  |  Branch (52:43): [True: 12.5k, False: 0]
  |  |  ------------------
  |  |   53|  12.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (500:9): [True: 0, False: 12.5k]
  ------------------
  501|      0|        return 0;
  502|       |
  503|  12.5k|    *len = pkt->written - pkt->subs->pwritten;
  504|       |
  505|  12.5k|    return 1;
  506|  12.5k|}
WPACKET_get_curr:
  509|   101k|{
  510|   101k|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|   101k|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 640, False: 101k]
  |  |  ------------------
  |  |   41|   101k|                     ? (p)->staticbuf \
  |  |   42|   101k|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 656, False: 100k]
  |  |  ------------------
  |  |   43|   101k|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|   101k|                        : NULL))
  ------------------
  511|       |
  512|   101k|    if (buf == NULL)
  ------------------
  |  Branch (512:9): [True: 100k, False: 1.29k]
  ------------------
  513|   100k|        return NULL;
  514|       |
  515|  1.29k|    if (pkt->endfirst)
  ------------------
  |  Branch (515:9): [True: 640, False: 656]
  ------------------
  516|    640|        return buf + pkt->maxsize - pkt->curr;
  517|       |
  518|    656|    return buf + pkt->curr;
  519|  1.29k|}
WPACKET_is_null_buf:
  522|  12.5k|{
  523|  12.5k|    return pkt->buf == NULL && pkt->staticbuf == NULL;
  ------------------
  |  Branch (523:12): [True: 12.4k, False: 82]
  |  Branch (523:32): [True: 12.4k, False: 0]
  ------------------
  524|  12.5k|}
WPACKET_cleanup:
  527|    160|{
  528|    160|    WPACKET_SUB *sub, *parent;
  529|       |
  530|    160|    for (sub = pkt->subs; sub != NULL; sub = parent) {
  ------------------
  |  Branch (530:27): [True: 0, False: 160]
  ------------------
  531|      0|        parent = sub->parent;
  532|      0|        OPENSSL_free(sub);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  533|      0|    }
  534|    160|    pkt->subs = NULL;
  535|    160|}
packet.c:maxmaxsize:
   96|  12.6k|{
   97|  12.6k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 12.6k]
  |  Branch (97:39): [True: 12.6k, False: 0]
  ------------------
   98|  12.6k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|  12.6k|}
packet.c:wpacket_intern_init_len:
  104|  12.8k|{
  105|  12.8k|    unsigned char *lenchars;
  106|       |
  107|  12.8k|    pkt->curr = 0;
  108|  12.8k|    pkt->written = 0;
  109|       |
  110|  12.8k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |  104|  12.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  12.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  12.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 12.8k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|  12.8k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 12.8k, False: 0]
  ------------------
  114|  12.8k|        return 1;
  115|       |
  116|      0|    pkt->subs->pwritten = lenbytes;
  117|      0|    pkt->subs->lenbytes = lenbytes;
  118|       |
  119|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 0]
  ------------------
  120|      0|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|        pkt->subs = NULL;
  122|      0|        return 0;
  123|      0|    }
  124|      0|    pkt->subs->packet_len = 0;
  125|       |
  126|      0|    return 1;
  127|      0|}
packet.c:wpacket_intern_close:
  251|  50.8k|{
  252|  50.8k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|  50.8k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 0, False: 50.8k]
  ------------------
  255|  50.8k|            && (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
  ------------------
  |  |  686|      0|#define WPACKET_FLAGS_NON_ZERO_LENGTH           1
  ------------------
  |  Branch (255:16): [True: 0, False: 0]
  ------------------
  256|      0|        return 0;
  257|       |
  258|  50.8k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 0, False: 50.8k]
  ------------------
  259|  50.8k|            && sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  |  Branch (259:16): [True: 0, False: 0]
  ------------------
  260|       |        /* We can't handle this case. Return an error */
  261|      0|        if (!doclose)
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            return 0;
  263|       |
  264|       |        /* Deallocate any bytes allocated for the length of the WPACKET */
  265|      0|        if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            pkt->written -= sub->lenbytes;
  267|      0|            pkt->curr -= sub->lenbytes;
  268|      0|        }
  269|       |
  270|       |        /* Don't write out the packet length */
  271|      0|        sub->packet_len = 0;
  272|      0|        sub->lenbytes = 0;
  273|      0|    }
  274|       |
  275|       |    /* Write out the WPACKET length if needed */
  276|  50.8k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 50.8k]
  ------------------
  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|  50.8k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 320, False: 50.5k]
  |  Branch (293:33): [True: 160, False: 160]
  ------------------
  294|  50.8k|               && (packlen != 0
  ------------------
  |  Branch (294:20): [True: 160, False: 0]
  ------------------
  295|    160|                   || (sub->flags
  ------------------
  |  Branch (295:23): [True: 0, False: 0]
  ------------------
  296|    160|                       & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) == 0)) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  297|    160|        size_t tmplen = packlen;
  298|    160|        size_t numlenbytes = 1;
  299|       |
  300|    160|        while ((tmplen = tmplen >> 8) > 0)
  ------------------
  |  Branch (300:16): [True: 0, False: 160]
  ------------------
  301|      0|            numlenbytes++;
  302|    160|        if (!WPACKET_put_bytes__(pkt, packlen, numlenbytes))
  ------------------
  |  Branch (302:13): [True: 0, False: 160]
  ------------------
  303|      0|            return 0;
  304|    160|        if (packlen > 0x7f) {
  ------------------
  |  Branch (304:13): [True: 0, False: 160]
  ------------------
  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|    160|    }
  310|       |
  311|  50.8k|    if (doclose) {
  ------------------
  |  Branch (311:9): [True: 50.8k, False: 0]
  ------------------
  312|  50.8k|        pkt->subs = sub->parent;
  313|  50.8k|        OPENSSL_free(sub);
  ------------------
  |  |  115|  50.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  50.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  50.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|  50.8k|    }
  315|       |
  316|  50.8k|    return 1;
  317|  50.8k|}
packet.c:put_value:
  212|  76.0k|{
  213|  76.0k|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 75.2k, False: 812]
  ------------------
  214|  75.2k|        return 1;
  215|       |
  216|  1.62k|    for (data += len - 1; len > 0; len--) {
  ------------------
  |  Branch (216:27): [True: 812, False: 812]
  ------------------
  217|    812|        *data = (unsigned char)(value & 0xff);
  218|    812|        data--;
  219|    812|        value >>= 8;
  220|    812|    }
  221|       |
  222|       |    /* Check whether we could fit the value in the assigned number of bytes */
  223|    812|    if (value > 0)
  ------------------
  |  Branch (223:9): [True: 0, False: 812]
  ------------------
  224|      0|        return 0;
  225|       |
  226|    812|    return 1;
  227|    812|}

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

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

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

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

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

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

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

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

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

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

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|   353k|{
  105|   353k|    return ossl_provider_ctx(prov);
  106|   353k|}
OSSL_PROVIDER_add_builtin:
  128|      2|{
  129|      2|    OSSL_PROVIDER_INFO entry;
  130|       |
  131|      2|    if (name == NULL || init_fn == NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  |  Branch (131:25): [True: 0, False: 2]
  ------------------
  132|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|        return 0;
  134|      0|    }
  135|      2|    memset(&entry, 0, sizeof(entry));
  136|      2|    entry.name = OPENSSL_strdup(name);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|      2|    if (entry.name == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2]
  ------------------
  138|      0|        return 0;
  139|      2|    entry.init = init_fn;
  140|      2|    if (!ossl_provider_info_add_to_store(libctx, &entry)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|        ossl_provider_info_clear(&entry);
  142|      0|        return 0;
  143|      0|    }
  144|      2|    return 1;
  145|      2|}

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

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

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

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

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

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

RIPEMD160_Init:
   28|   199k|{
   29|   199k|    memset(c, 0, sizeof(*c));
   30|   199k|    c->A = RIPEMD160_A;
  ------------------
  |  |   56|   199k|#define RIPEMD160_A     0x67452301L
  ------------------
   31|   199k|    c->B = RIPEMD160_B;
  ------------------
  |  |   57|   199k|#define RIPEMD160_B     0xEFCDAB89L
  ------------------
   32|   199k|    c->C = RIPEMD160_C;
  ------------------
  |  |   58|   199k|#define RIPEMD160_C     0x98BADCFEL
  ------------------
   33|   199k|    c->D = RIPEMD160_D;
  ------------------
  |  |   59|   199k|#define RIPEMD160_D     0x10325476L
  ------------------
   34|   199k|    c->E = RIPEMD160_E;
  ------------------
  |  |   60|   199k|#define RIPEMD160_E     0xC3D2E1F0L
  ------------------
   35|   199k|    return 1;
   36|   199k|}
ripemd160_block_data_order:
   43|   199k|{
   44|   199k|    const unsigned char *data = p;
   45|   199k|    register unsigned MD32_REG_T A, B, C, D, E;
   46|   199k|    unsigned MD32_REG_T a, b, c, d, e, l;
   47|   199k|# ifndef MD32_XARRAY
   48|       |    /* See comment in crypto/sha/sha_local.h for details. */
   49|   199k|    unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
   50|   199k|        XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15;
   51|   199k|#  define X(i)   XX##i
   52|       |# else
   53|       |    RIPEMD160_LONG XX[16];
   54|       |#  define X(i)   XX[i]
   55|       |# endif
   56|       |
   57|   398k|    for (; num--;) {
  ------------------
  |  Branch (57:12): [True: 199k, False: 199k]
  ------------------
   58|       |
   59|   199k|        A = ctx->A;
   60|   199k|        B = ctx->B;
   61|   199k|        C = ctx->C;
   62|   199k|        D = ctx->D;
   63|   199k|        E = ctx->E;
   64|       |
   65|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   66|   199k|        X(0) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   67|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   68|   199k|        X(1) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   69|   199k|        RIP1(A, B, C, D, E, WL00, SL00);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   70|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   71|   199k|        X(2) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   72|   199k|        RIP1(E, A, B, C, D, WL01, SL01);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   73|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   74|   199k|        X(3) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   75|   199k|        RIP1(D, E, A, B, C, WL02, SL02);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   76|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   77|   199k|        X(4) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   78|   199k|        RIP1(C, D, E, A, B, WL03, SL03);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   79|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   80|   199k|        X(5) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   81|   199k|        RIP1(B, C, D, E, A, WL04, SL04);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   82|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   83|   199k|        X(6) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   84|   199k|        RIP1(A, B, C, D, E, WL05, SL05);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   85|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   86|   199k|        X(7) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   87|   199k|        RIP1(E, A, B, C, D, WL06, SL06);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   88|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   89|   199k|        X(8) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   90|   199k|        RIP1(D, E, A, B, C, WL07, SL07);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   91|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   92|   199k|        X(9) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   93|   199k|        RIP1(C, D, E, A, B, WL08, SL08);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   94|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   95|   199k|        X(10) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   96|   199k|        RIP1(B, C, D, E, A, WL09, SL09);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
   97|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
   98|   199k|        X(11) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
   99|   199k|        RIP1(A, B, C, D, E, WL10, SL10);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  100|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
  101|   199k|        X(12) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
  102|   199k|        RIP1(E, A, B, C, D, WL11, SL11);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  103|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
  104|   199k|        X(13) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
  105|   199k|        RIP1(D, E, A, B, C, WL12, SL12);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  106|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
  107|   199k|        X(14) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
  108|   199k|        RIP1(C, D, E, A, B, WL13, SL13);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  109|   199k|        (void)HOST_c2l(data, l);
  ------------------
  |  |  138|   199k|#  define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
  |  |  139|   199k|                         l|=(((unsigned long)(*((c)++)))<< 8),          \
  |  |  140|   199k|                         l|=(((unsigned long)(*((c)++)))<<16),          \
  |  |  141|   199k|                         l|=(((unsigned long)(*((c)++)))<<24)           )
  ------------------
  110|   199k|        X(15) = l;
  ------------------
  |  |   51|   199k|#  define X(i)   XX##i
  ------------------
  111|   199k|        RIP1(B, C, D, E, A, WL14, SL14);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  112|   199k|        RIP1(A, B, C, D, E, WL15, SL15);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  113|       |
  114|   199k|        RIP2(E, A, B, C, D, WL16, SL16, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  115|   199k|        RIP2(D, E, A, B, C, WL17, SL17, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  116|   199k|        RIP2(C, D, E, A, B, WL18, SL18, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  117|   199k|        RIP2(B, C, D, E, A, WL19, SL19, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  118|   199k|        RIP2(A, B, C, D, E, WL20, SL20, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  119|   199k|        RIP2(E, A, B, C, D, WL21, SL21, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  120|   199k|        RIP2(D, E, A, B, C, WL22, SL22, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  121|   199k|        RIP2(C, D, E, A, B, WL23, SL23, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  122|   199k|        RIP2(B, C, D, E, A, WL24, SL24, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  123|   199k|        RIP2(A, B, C, D, E, WL25, SL25, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  124|   199k|        RIP2(E, A, B, C, D, WL26, SL26, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  125|   199k|        RIP2(D, E, A, B, C, WL27, SL27, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  126|   199k|        RIP2(C, D, E, A, B, WL28, SL28, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  127|   199k|        RIP2(B, C, D, E, A, WL29, SL29, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  128|   199k|        RIP2(A, B, C, D, E, WL30, SL30, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  129|   199k|        RIP2(E, A, B, C, D, WL31, SL31, KL1);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  130|       |
  131|   199k|        RIP3(D, E, A, B, C, WL32, SL32, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  132|   199k|        RIP3(C, D, E, A, B, WL33, SL33, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  133|   199k|        RIP3(B, C, D, E, A, WL34, SL34, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  134|   199k|        RIP3(A, B, C, D, E, WL35, SL35, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  135|   199k|        RIP3(E, A, B, C, D, WL36, SL36, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  136|   199k|        RIP3(D, E, A, B, C, WL37, SL37, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  137|   199k|        RIP3(C, D, E, A, B, WL38, SL38, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  138|   199k|        RIP3(B, C, D, E, A, WL39, SL39, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  139|   199k|        RIP3(A, B, C, D, E, WL40, SL40, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  140|   199k|        RIP3(E, A, B, C, D, WL41, SL41, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  141|   199k|        RIP3(D, E, A, B, C, WL42, SL42, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  142|   199k|        RIP3(C, D, E, A, B, WL43, SL43, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  143|   199k|        RIP3(B, C, D, E, A, WL44, SL44, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  144|   199k|        RIP3(A, B, C, D, E, WL45, SL45, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  145|   199k|        RIP3(E, A, B, C, D, WL46, SL46, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  146|   199k|        RIP3(D, E, A, B, C, WL47, SL47, KL2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  147|       |
  148|   199k|        RIP4(C, D, E, A, B, WL48, SL48, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  149|   199k|        RIP4(B, C, D, E, A, WL49, SL49, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  150|   199k|        RIP4(A, B, C, D, E, WL50, SL50, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  151|   199k|        RIP4(E, A, B, C, D, WL51, SL51, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  152|   199k|        RIP4(D, E, A, B, C, WL52, SL52, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  153|   199k|        RIP4(C, D, E, A, B, WL53, SL53, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  154|   199k|        RIP4(B, C, D, E, A, WL54, SL54, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  155|   199k|        RIP4(A, B, C, D, E, WL55, SL55, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  156|   199k|        RIP4(E, A, B, C, D, WL56, SL56, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  157|   199k|        RIP4(D, E, A, B, C, WL57, SL57, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  158|   199k|        RIP4(C, D, E, A, B, WL58, SL58, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  159|   199k|        RIP4(B, C, D, E, A, WL59, SL59, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  160|   199k|        RIP4(A, B, C, D, E, WL60, SL60, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  161|   199k|        RIP4(E, A, B, C, D, WL61, SL61, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  162|   199k|        RIP4(D, E, A, B, C, WL62, SL62, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  163|   199k|        RIP4(C, D, E, A, B, WL63, SL63, KL3);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  164|       |
  165|   199k|        RIP5(B, C, D, E, A, WL64, SL64, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  166|   199k|        RIP5(A, B, C, D, E, WL65, SL65, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  167|   199k|        RIP5(E, A, B, C, D, WL66, SL66, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  168|   199k|        RIP5(D, E, A, B, C, WL67, SL67, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  169|   199k|        RIP5(C, D, E, A, B, WL68, SL68, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  170|   199k|        RIP5(B, C, D, E, A, WL69, SL69, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  171|   199k|        RIP5(A, B, C, D, E, WL70, SL70, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  172|   199k|        RIP5(E, A, B, C, D, WL71, SL71, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  173|   199k|        RIP5(D, E, A, B, C, WL72, SL72, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  174|   199k|        RIP5(C, D, E, A, B, WL73, SL73, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  175|   199k|        RIP5(B, C, D, E, A, WL74, SL74, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  176|   199k|        RIP5(A, B, C, D, E, WL75, SL75, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  177|   199k|        RIP5(E, A, B, C, D, WL76, SL76, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  178|   199k|        RIP5(D, E, A, B, C, WL77, SL77, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  179|   199k|        RIP5(C, D, E, A, B, WL78, SL78, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  180|   199k|        RIP5(B, C, D, E, A, WL79, SL79, KL4);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  181|       |
  182|   199k|        a = A;
  183|   199k|        b = B;
  184|   199k|        c = C;
  185|   199k|        d = D;
  186|   199k|        e = E;
  187|       |        /* Do other half */
  188|   199k|        A = ctx->A;
  189|   199k|        B = ctx->B;
  190|   199k|        C = ctx->C;
  191|   199k|        D = ctx->D;
  192|   199k|        E = ctx->E;
  193|       |
  194|   199k|        RIP5(A, B, C, D, E, WR00, SR00, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  195|   199k|        RIP5(E, A, B, C, D, WR01, SR01, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  196|   199k|        RIP5(D, E, A, B, C, WR02, SR02, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  197|   199k|        RIP5(C, D, E, A, B, WR03, SR03, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  198|   199k|        RIP5(B, C, D, E, A, WR04, SR04, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  199|   199k|        RIP5(A, B, C, D, E, WR05, SR05, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  200|   199k|        RIP5(E, A, B, C, D, WR06, SR06, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  201|   199k|        RIP5(D, E, A, B, C, WR07, SR07, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  202|   199k|        RIP5(C, D, E, A, B, WR08, SR08, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  203|   199k|        RIP5(B, C, D, E, A, WR09, SR09, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  204|   199k|        RIP5(A, B, C, D, E, WR10, SR10, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  205|   199k|        RIP5(E, A, B, C, D, WR11, SR11, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  206|   199k|        RIP5(D, E, A, B, C, WR12, SR12, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  207|   199k|        RIP5(C, D, E, A, B, WR13, SR13, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  208|   199k|        RIP5(B, C, D, E, A, WR14, SR14, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  209|   199k|        RIP5(A, B, C, D, E, WR15, SR15, KR0);
  ------------------
  |  |   84|   199k|#define RIP5(a,b,c,d,e,w,s,K) { \
  |  |   85|   199k|        a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   54|   199k|#define F5(x,y,z)       (((~(z)) | (y)) ^ (x))
  |  |  ------------------
  |  |                       a+=F5(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   86|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   87|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  210|       |
  211|   199k|        RIP4(E, A, B, C, D, WR16, SR16, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  212|   199k|        RIP4(D, E, A, B, C, WR17, SR17, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  213|   199k|        RIP4(C, D, E, A, B, WR18, SR18, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  214|   199k|        RIP4(B, C, D, E, A, WR19, SR19, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  215|   199k|        RIP4(A, B, C, D, E, WR20, SR20, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  216|   199k|        RIP4(E, A, B, C, D, WR21, SR21, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  217|   199k|        RIP4(D, E, A, B, C, WR22, SR22, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  218|   199k|        RIP4(C, D, E, A, B, WR23, SR23, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  219|   199k|        RIP4(B, C, D, E, A, WR24, SR24, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  220|   199k|        RIP4(A, B, C, D, E, WR25, SR25, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  221|   199k|        RIP4(E, A, B, C, D, WR26, SR26, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  222|   199k|        RIP4(D, E, A, B, C, WR27, SR27, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  223|   199k|        RIP4(C, D, E, A, B, WR28, SR28, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  224|   199k|        RIP4(B, C, D, E, A, WR29, SR29, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  225|   199k|        RIP4(A, B, C, D, E, WR30, SR30, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  226|   199k|        RIP4(E, A, B, C, D, WR31, SR31, KR1);
  ------------------
  |  |   79|   199k|#define RIP4(a,b,c,d,e,w,s,K) { \
  |  |   80|   199k|        a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   53|   199k|#define F4(x,y,z)       ((((x) ^ (y)) & (z)) ^ (y))
  |  |  ------------------
  |  |                       a+=F4(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   81|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   82|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  227|       |
  228|   199k|        RIP3(D, E, A, B, C, WR32, SR32, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  229|   199k|        RIP3(C, D, E, A, B, WR33, SR33, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  230|   199k|        RIP3(B, C, D, E, A, WR34, SR34, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  231|   199k|        RIP3(A, B, C, D, E, WR35, SR35, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  232|   199k|        RIP3(E, A, B, C, D, WR36, SR36, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  233|   199k|        RIP3(D, E, A, B, C, WR37, SR37, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  234|   199k|        RIP3(C, D, E, A, B, WR38, SR38, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  235|   199k|        RIP3(B, C, D, E, A, WR39, SR39, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  236|   199k|        RIP3(A, B, C, D, E, WR40, SR40, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  237|   199k|        RIP3(E, A, B, C, D, WR41, SR41, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  238|   199k|        RIP3(D, E, A, B, C, WR42, SR42, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  239|   199k|        RIP3(C, D, E, A, B, WR43, SR43, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  240|   199k|        RIP3(B, C, D, E, A, WR44, SR44, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  241|   199k|        RIP3(A, B, C, D, E, WR45, SR45, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  242|   199k|        RIP3(E, A, B, C, D, WR46, SR46, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  243|   199k|        RIP3(D, E, A, B, C, WR47, SR47, KR2);
  ------------------
  |  |   74|   199k|#define RIP3(a,b,c,d,e,w,s,K) { \
  |  |   75|   199k|        a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   52|   199k|#define F3(x,y,z)       (((~(y)) | (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F3(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   76|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   77|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  244|       |
  245|   199k|        RIP2(C, D, E, A, B, WR48, SR48, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  246|   199k|        RIP2(B, C, D, E, A, WR49, SR49, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  247|   199k|        RIP2(A, B, C, D, E, WR50, SR50, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  248|   199k|        RIP2(E, A, B, C, D, WR51, SR51, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  249|   199k|        RIP2(D, E, A, B, C, WR52, SR52, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  250|   199k|        RIP2(C, D, E, A, B, WR53, SR53, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  251|   199k|        RIP2(B, C, D, E, A, WR54, SR54, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  252|   199k|        RIP2(A, B, C, D, E, WR55, SR55, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  253|   199k|        RIP2(E, A, B, C, D, WR56, SR56, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  254|   199k|        RIP2(D, E, A, B, C, WR57, SR57, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  255|   199k|        RIP2(C, D, E, A, B, WR58, SR58, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  256|   199k|        RIP2(B, C, D, E, A, WR59, SR59, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  257|   199k|        RIP2(A, B, C, D, E, WR60, SR60, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  258|   199k|        RIP2(E, A, B, C, D, WR61, SR61, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  259|   199k|        RIP2(D, E, A, B, C, WR62, SR62, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  260|   199k|        RIP2(C, D, E, A, B, WR63, SR63, KR3);
  ------------------
  |  |   69|   199k|#define RIP2(a,b,c,d,e,w,s,K) { \
  |  |   70|   199k|        a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#define F2(x,y,z)       ((((y) ^ (z)) & (x)) ^ (z))
  |  |  ------------------
  |  |                       a+=F2(b,c,d)+X(w)+K; \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   71|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   72|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  261|       |
  262|   199k|        RIP1(B, C, D, E, A, WR64, SR64);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  263|   199k|        RIP1(A, B, C, D, E, WR65, SR65);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  264|   199k|        RIP1(E, A, B, C, D, WR66, SR66);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  265|   199k|        RIP1(D, E, A, B, C, WR67, SR67);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  266|   199k|        RIP1(C, D, E, A, B, WR68, SR68);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  267|   199k|        RIP1(B, C, D, E, A, WR69, SR69);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  268|   199k|        RIP1(A, B, C, D, E, WR70, SR70);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  269|   199k|        RIP1(E, A, B, C, D, WR71, SR71);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  270|   199k|        RIP1(D, E, A, B, C, WR72, SR72);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  271|   199k|        RIP1(C, D, E, A, B, WR73, SR73);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  272|   199k|        RIP1(B, C, D, E, A, WR74, SR74);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  273|   199k|        RIP1(A, B, C, D, E, WR75, SR75);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  274|   199k|        RIP1(E, A, B, C, D, WR76, SR76);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  275|   199k|        RIP1(D, E, A, B, C, WR77, SR77);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  276|   199k|        RIP1(C, D, E, A, B, WR78, SR78);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  277|   199k|        RIP1(B, C, D, E, A, WR79, SR79);
  ------------------
  |  |   64|   199k|#define RIP1(a,b,c,d,e,w,s) { \
  |  |   65|   199k|        a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   50|   199k|#define F1(x,y,z)       ((x) ^ (y) ^ (z))
  |  |  ------------------
  |  |                       a+=F1(b,c,d)+X(w); \
  |  |  ------------------
  |  |  |  |   51|   199k|#  define X(i)   XX##i
  |  |  ------------------
  |  |   66|   199k|        a=ROTATE(a,s)+e; \
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  |  |   67|   199k|        c=ROTATE(c,10); }
  |  |  ------------------
  |  |  |  |  100|   199k|# define ROTATE(a,n)     (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
  |  |  ------------------
  ------------------
  278|       |
  279|   199k|        D = ctx->B + c + D;
  280|   199k|        ctx->B = ctx->C + d + E;
  281|   199k|        ctx->C = ctx->D + e + A;
  282|   199k|        ctx->D = ctx->E + a + B;
  283|   199k|        ctx->E = ctx->A + b + C;
  284|   199k|        ctx->A = D;
  285|       |
  286|   199k|    }
  287|   199k|}

ossl_rsa_pss_to_ctx:
  543|    510|{
  544|    510|    int rv = -1;
  545|    510|    int saltlen;
  546|    510|    const EVP_MD *mgf1md = NULL, *md = NULL;
  547|    510|    RSA_PSS_PARAMS *pss;
  548|       |
  549|       |    /* Sanity check: make sure it is PSS */
  550|    510|    if (OBJ_obj2nid(sigalg->algorithm) != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   65|    510|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|    510|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (550:9): [True: 0, False: 510]
  ------------------
  551|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  552|      0|        return -1;
  553|      0|    }
  554|       |    /* Decode PSS parameters */
  555|    510|    pss = ossl_rsa_pss_decode(sigalg);
  556|       |
  557|    510|    if (!ossl_rsa_pss_get_param(pss, &md, &mgf1md, &saltlen)) {
  ------------------
  |  Branch (557:9): [True: 9, False: 501]
  ------------------
  558|      9|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS);
  ------------------
  |  |  401|      9|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      9|    (ERR_new(),                                                 \
  |  |  |  |  404|      9|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      9|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      9|     ERR_set_error)
  |  |  ------------------
  ------------------
  559|      9|        goto err;
  560|      9|    }
  561|       |
  562|       |    /* We have all parameters now set up context */
  563|    501|    if (pkey) {
  ------------------
  |  Branch (563:9): [True: 501, False: 0]
  ------------------
  564|    501|        if (!EVP_DigestVerifyInit(ctx, &pkctx, md, NULL, pkey))
  ------------------
  |  Branch (564:13): [True: 3, False: 498]
  ------------------
  565|      3|            goto err;
  566|    501|    } else {
  567|      0|        const EVP_MD *checkmd;
  568|      0|        if (EVP_PKEY_CTX_get_signature_md(pkctx, &checkmd) <= 0)
  ------------------
  |  Branch (568:13): [True: 0, False: 0]
  ------------------
  569|      0|            goto err;
  570|      0|        if (EVP_MD_get_type(md) != EVP_MD_get_type(checkmd)) {
  ------------------
  |  Branch (570:13): [True: 0, False: 0]
  ------------------
  571|      0|            ERR_raise(ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  572|      0|            goto err;
  573|      0|        }
  574|      0|    }
  575|       |
  576|    498|    if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_PSS_PADDING) <= 0)
  ------------------
  |  |  200|    498|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (576:9): [True: 0, False: 498]
  ------------------
  577|      0|        goto err;
  578|       |
  579|    498|    if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkctx, saltlen) <= 0)
  ------------------
  |  Branch (579:9): [True: 0, False: 498]
  ------------------
  580|      0|        goto err;
  581|       |
  582|    498|    if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkctx, mgf1md) <= 0)
  ------------------
  |  Branch (582:9): [True: 0, False: 498]
  ------------------
  583|      0|        goto err;
  584|       |    /* Carry on */
  585|    498|    rv = 1;
  586|       |
  587|    510| err:
  588|    510|    RSA_PSS_PARAMS_free(pss);
  589|    510|    return rv;
  590|    498|}
ossl_rsa_pss_get_param:
  612|    555|{
  613|       |    /*
  614|       |     * Callers do not care about the trailer field, and yet, we must
  615|       |     * pass it from get_param to verify_param, since the latter checks
  616|       |     * its value.
  617|       |     *
  618|       |     * When callers start caring, it's a simple thing to add another
  619|       |     * argument to this function.
  620|       |     */
  621|    555|    int trailerField = 0;
  622|       |
  623|    555|    return ossl_rsa_pss_get_param_unverified(pss, pmd, pmgf1md, psaltlen,
  ------------------
  |  Branch (623:12): [True: 505, False: 50]
  ------------------
  624|    555|                                             &trailerField)
  625|    555|        && rsa_pss_verify_param(pmd, pmgf1md, psaltlen, &trailerField);
  ------------------
  |  Branch (625:12): [True: 505, False: 0]
  ------------------
  626|    555|}
rsa_ameth.c:rsa_pss_verify_param:
  594|    505|{
  595|    505|    if (psaltlen != NULL && *psaltlen < 0) {
  ------------------
  |  Branch (595:9): [True: 505, False: 0]
  |  Branch (595:29): [True: 0, False: 505]
  ------------------
  596|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  597|      0|        return 0;
  598|      0|    }
  599|       |    /*
  600|       |     * low-level routines support only trailer field 0xbc (value 1) and
  601|       |     * PKCS#1 says we should reject any other value anyway.
  602|       |     */
  603|    505|    if (ptrailerField != NULL && *ptrailerField != 1) {
  ------------------
  |  Branch (603:9): [True: 505, False: 0]
  |  Branch (603:34): [True: 0, False: 505]
  ------------------
  604|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_TRAILER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  605|      0|        return 0;
  606|      0|    }
  607|    505|    return 1;
  608|    505|}
rsa_ameth.c:rsa_pub_decode:
   77|  11.2k|{
   78|  11.2k|    const unsigned char *p;
   79|  11.2k|    int pklen;
   80|  11.2k|    X509_ALGOR *alg;
   81|  11.2k|    RSA *rsa = NULL;
   82|       |
   83|  11.2k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &alg, pubkey))
  ------------------
  |  Branch (83:9): [True: 0, False: 11.2k]
  ------------------
   84|      0|        return 0;
   85|  11.2k|    if ((rsa = d2i_RSAPublicKey(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (85:9): [True: 3.32k, False: 7.90k]
  ------------------
   86|  3.32k|        return 0;
   87|  7.90k|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (87:9): [True: 1.28k, False: 6.62k]
  ------------------
   88|  1.28k|        RSA_free(rsa);
   89|  1.28k|        return 0;
   90|  1.28k|    }
   91|       |
   92|  6.62k|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|  6.62k|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
   93|  6.62k|    switch (pkey->ameth->pkey_id) {
   94|  2.38k|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|  2.38k|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  2.38k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (94:5): [True: 2.38k, False: 4.23k]
  ------------------
   95|  2.38k|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|  2.38k|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
   96|  2.38k|        break;
   97|  4.23k|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|  4.23k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  4.23k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 4.23k, False: 2.38k]
  ------------------
   98|  4.23k|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|  4.23k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
   99|  4.23k|        break;
  100|      0|    default:
  ------------------
  |  Branch (100:5): [True: 0, False: 6.62k]
  ------------------
  101|       |        /* Leave the type bits zero */
  102|      0|        break;
  103|  6.62k|    }
  104|       |
  105|  6.62k|    if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 6.62k]
  ------------------
  106|      0|        RSA_free(rsa);
  107|      0|        return 0;
  108|      0|    }
  109|  6.62k|    return 1;
  110|  6.62k|}
rsa_ameth.c:int_rsa_free:
  201|  11.2k|{
  202|  11.2k|    RSA_free(pkey->pkey.rsa);
  203|  11.2k|}
rsa_ameth.c:rsa_sig_info_set:
  724|     45|{
  725|     45|    int rv = 0;
  726|     45|    int mdnid, saltlen, md_size;
  727|     45|    uint32_t flags;
  728|     45|    const EVP_MD *mgf1md = NULL, *md = NULL;
  729|     45|    RSA_PSS_PARAMS *pss;
  730|     45|    int secbits;
  731|       |
  732|       |    /* Sanity check: make sure it is PSS */
  733|     45|    if (OBJ_obj2nid(sigalg->algorithm) != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   65|     45|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|     45|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (733:9): [True: 0, False: 45]
  ------------------
  734|      0|        return 0;
  735|       |    /* Decode PSS parameters */
  736|     45|    pss = ossl_rsa_pss_decode(sigalg);
  737|     45|    if (!ossl_rsa_pss_get_param(pss, &md, &mgf1md, &saltlen))
  ------------------
  |  Branch (737:9): [True: 41, False: 4]
  ------------------
  738|     41|        goto err;
  739|      4|    md_size = EVP_MD_get_size(md);
  740|      4|    if (md_size <= 0)
  ------------------
  |  Branch (740:9): [True: 0, False: 4]
  ------------------
  741|      0|        goto err;
  742|      4|    mdnid = EVP_MD_get_type(md);
  743|       |    /*
  744|       |     * For TLS need SHA256, SHA384 or SHA512, digest and MGF1 digest must
  745|       |     * match and salt length must equal digest size
  746|       |     */
  747|      4|    if ((mdnid == NID_sha256 || mdnid == NID_sha384 || mdnid == NID_sha512)
  ------------------
  |  | 3264|      8|#define NID_sha256              672
  ------------------
                  if ((mdnid == NID_sha256 || mdnid == NID_sha384 || mdnid == NID_sha512)
  ------------------
  |  | 3269|      8|#define NID_sha384              673
  ------------------
                  if ((mdnid == NID_sha256 || mdnid == NID_sha384 || mdnid == NID_sha512)
  ------------------
  |  | 3274|      4|#define NID_sha512              674
  ------------------
  |  Branch (747:10): [True: 0, False: 4]
  |  Branch (747:33): [True: 0, False: 4]
  |  Branch (747:56): [True: 0, False: 4]
  ------------------
  748|      4|            && mdnid == EVP_MD_get_type(mgf1md)
  ------------------
  |  Branch (748:16): [True: 0, False: 0]
  ------------------
  749|      4|            && saltlen == md_size)
  ------------------
  |  Branch (749:16): [True: 0, False: 0]
  ------------------
  750|      0|        flags = X509_SIG_INFO_TLS;
  ------------------
  |  |  162|      0|# define X509_SIG_INFO_TLS       0x2
  ------------------
  751|      4|    else
  752|      4|        flags = 0;
  753|       |    /* Note: security bits half number of digest bits */
  754|      4|    secbits = md_size * 4;
  755|       |    /*
  756|       |     * SHA1 and MD5 are known to be broken. Reduce security bits so that
  757|       |     * they're no longer accepted at security level 1. The real values don't
  758|       |     * really matter as long as they're lower than 80, which is our security
  759|       |     * level 1.
  760|       |     * https://eprint.iacr.org/2020/014 puts a chosen-prefix attack for SHA1 at
  761|       |     * 2^63.4
  762|       |     * https://documents.epfl.ch/users/l/le/lenstra/public/papers/lat.pdf
  763|       |     * puts a chosen-prefix attack for MD5 at 2^39.
  764|       |     */
  765|      4|    if (mdnid == NID_sha1)
  ------------------
  |  | 2321|      4|#define NID_sha1                64
  ------------------
  |  Branch (765:9): [True: 4, False: 0]
  ------------------
  766|      4|        secbits = 64;
  767|      0|    else if (mdnid == NID_md5_sha1)
  ------------------
  |  | 1220|      0|#define NID_md5_sha1            114
  ------------------
  |  Branch (767:14): [True: 0, False: 0]
  ------------------
  768|      0|        secbits = 68;
  769|      0|    else if (mdnid == NID_md5)
  ------------------
  |  | 1215|      0|#define NID_md5         4
  ------------------
  |  Branch (769:14): [True: 0, False: 0]
  ------------------
  770|      0|        secbits = 39;
  771|      4|    X509_SIG_INFO_set(siginf, mdnid, EVP_PKEY_RSA_PSS, secbits,
  ------------------
  |  |   65|      4|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      4|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  772|      4|                      flags);
  773|      4|    rv = 1;
  774|     45|    err:
  775|     45|    RSA_PSS_PARAMS_free(pss);
  776|     45|    return rv;
  777|      4|}

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

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

RSA_bits:
   24|  6.64k|{
   25|  6.64k|    return BN_num_bits(r->n);
   26|  6.64k|}
RSA_size:
   29|  8.35k|{
   30|  8.35k|    return BN_num_bytes(r->n);
  ------------------
  |  |  189|  8.35k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
   31|  8.35k|}
RSA_public_decrypt:
   53|    782|{
   54|    782|    return rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding);
   55|    782|}

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|  9.12k|{
   36|  9.12k|    return rsa_new_intern(NULL, NULL);
   37|  9.12k|}
RSA_get_method:
   40|  6.62k|{
   41|  6.62k|    return rsa->meth;
   42|  6.62k|}
RSA_free:
  137|  34.1k|{
  138|  34.1k|    int i;
  139|       |
  140|  34.1k|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 16.7k, False: 17.3k]
  ------------------
  141|  16.7k|        return;
  142|       |
  143|  17.3k|    CRYPTO_DOWN_REF(&r->references, &i);
  144|  17.3k|    REF_PRINT_COUNT("RSA", i, r);
  ------------------
  |  |  301|  17.3k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  17.3k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  17.3k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.3k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  17.3k|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 8.24k, False: 9.12k]
  ------------------
  146|  8.24k|        return;
  147|  9.12k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  9.12k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 9.12k]
  |  |  ------------------
  ------------------
  148|       |
  149|  9.12k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 9.12k, False: 0]
  |  Branch (149:28): [True: 9.12k, False: 0]
  ------------------
  150|  9.12k|        r->meth->finish(r);
  151|  9.12k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  152|  9.12k|    ENGINE_finish(r->engine);
  153|  9.12k|#endif
  154|       |
  155|  9.12k|#ifndef FIPS_MODULE
  156|  9.12k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
  ------------------
  |  |  238|  9.12k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  157|  9.12k|#endif
  158|       |
  159|  9.12k|    CRYPTO_THREAD_lock_free(r->lock);
  160|  9.12k|    CRYPTO_FREE_REF(&r->references);
  161|       |
  162|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
  163|       |    BN_clear_free(r->n);
  164|       |    BN_clear_free(r->e);
  165|       |#else
  166|  9.12k|    BN_free(r->n);
  167|  9.12k|    BN_free(r->e);
  168|  9.12k|#endif
  169|  9.12k|    BN_clear_free(r->d);
  170|  9.12k|    BN_clear_free(r->p);
  171|  9.12k|    BN_clear_free(r->q);
  172|  9.12k|    BN_clear_free(r->dmp1);
  173|  9.12k|    BN_clear_free(r->dmq1);
  174|  9.12k|    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|  9.12k|#ifndef FIPS_MODULE
  181|  9.12k|    RSA_PSS_PARAMS_free(r->pss);
  182|  9.12k|    sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
  183|  9.12k|#endif
  184|  9.12k|    BN_BLINDING_free(r->blinding);
  185|  9.12k|    BN_BLINDING_free(r->mt_blinding);
  186|  9.12k|    OPENSSL_free(r);
  ------------------
  |  |  115|  9.12k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  9.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  9.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  187|  9.12k|}
RSA_up_ref:
  190|  8.24k|{
  191|  8.24k|    int i;
  192|       |
  193|  8.24k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (193:9): [True: 0, False: 8.24k]
  ------------------
  194|      0|        return 0;
  195|       |
  196|  8.24k|    REF_PRINT_COUNT("RSA", i, r);
  ------------------
  |  |  301|  8.24k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  8.24k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  8.24k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  8.24k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  8.24k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  8.24k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 8.24k]
  |  |  ------------------
  ------------------
  198|  8.24k|    return i > 1 ? 1 : 0;
  ------------------
  |  Branch (198:12): [True: 8.24k, False: 0]
  ------------------
  199|  8.24k|}
ossl_rsa_set0_libctx:
  207|  6.62k|{
  208|  6.62k|    r->libctx = libctx;
  209|  6.62k|}
ossl_ifc_ffc_compute_security_bits:
  323|  6.62k|{
  324|  6.62k|    uint64_t x;
  325|  6.62k|    uint32_t lx;
  326|  6.62k|    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|  6.62k|    switch (n) {
  ------------------
  |  Branch (333:13): [True: 5.90k, False: 717]
  ------------------
  334|    716|    case 2048:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (334:5): [True: 716, False: 5.90k]
  ------------------
  335|    716|        return 112;
  336|      0|    case 3072:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (336:5): [True: 0, False: 6.62k]
  ------------------
  337|      0|        return 128;
  338|      1|    case 4096:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (338:5): [True: 1, False: 6.61k]
  ------------------
  339|      1|        return 152;
  340|      0|    case 6144:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (340:5): [True: 0, False: 6.62k]
  ------------------
  341|      0|        return 176;
  342|      0|    case 7680:      /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (342:5): [True: 0, False: 6.62k]
  ------------------
  343|      0|        return 192;
  344|      0|    case 8192:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (344:5): [True: 0, False: 6.62k]
  ------------------
  345|      0|        return 200;
  346|      0|    case 15360:     /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (346:5): [True: 0, False: 6.62k]
  ------------------
  347|      0|        return 256;
  348|  6.62k|    }
  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|  5.90k|    if (n >= 687737)
  ------------------
  |  Branch (356:9): [True: 0, False: 5.90k]
  ------------------
  357|      0|        return 1200;
  358|  5.90k|    if (n < 8)
  ------------------
  |  Branch (358:9): [True: 2.47k, False: 3.43k]
  ------------------
  359|  2.47k|        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|  3.43k|    if (n <= 7680)
  ------------------
  |  Branch (366:9): [True: 3.43k, False: 0]
  ------------------
  367|  3.43k|        cap = 192;
  368|      0|    else if (n <= 15360)
  ------------------
  |  Branch (368:14): [True: 0, False: 0]
  ------------------
  369|      0|        cap = 256;
  370|      0|    else
  371|      0|        cap = 1200;
  372|       |
  373|  3.43k|    x = n * (uint64_t)log_2;
  374|  3.43k|    lx = ilog_e(x);
  375|  3.43k|    y = (uint16_t)((mul2(c1_923, icbrt64(mul2(mul2(x, lx), lx))) - c4_690)
  376|  3.43k|                   / log_2);
  377|  3.43k|    y = (y + 4) & ~7;
  378|  3.43k|    if (y > cap)
  ------------------
  |  Branch (378:9): [True: 0, False: 3.43k]
  ------------------
  379|      0|        y = cap;
  380|  3.43k|    return y;
  381|  5.90k|}
RSA_security_bits:
  386|  6.62k|{
  387|  6.62k|    int bits = BN_num_bits(rsa->n);
  388|       |
  389|  6.62k|#ifndef FIPS_MODULE
  390|  6.62k|    if (rsa->version == RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|  6.62k|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (390:9): [True: 0, False: 6.62k]
  ------------------
  391|       |        /* This ought to mean that we have private key at hand. */
  392|      0|        int ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos);
  393|       |
  394|      0|        if (ex_primes <= 0 || (ex_primes + 2) > ossl_rsa_multip_cap(bits))
  ------------------
  |  Branch (394:13): [True: 0, False: 0]
  |  Branch (394:31): [True: 0, False: 0]
  ------------------
  395|      0|            return 0;
  396|      0|    }
  397|  6.62k|#endif
  398|  6.62k|    return ossl_ifc_ffc_compute_security_bits(bits);
  399|  6.62k|}
RSA_get0_key:
  556|  6.62k|{
  557|  6.62k|    if (n != NULL)
  ------------------
  |  Branch (557:9): [True: 6.62k, False: 0]
  ------------------
  558|  6.62k|        *n = r->n;
  559|  6.62k|    if (e != NULL)
  ------------------
  |  Branch (559:9): [True: 6.62k, False: 0]
  ------------------
  560|  6.62k|        *e = r->e;
  561|  6.62k|    if (d != NULL)
  ------------------
  |  Branch (561:9): [True: 6.62k, False: 0]
  ------------------
  562|  6.62k|        *d = r->d;
  563|  6.62k|}
RSA_get0_n:
  646|  19.8k|{
  647|  19.8k|    return r->n;
  648|  19.8k|}
RSA_get0_d:
  656|  6.62k|{
  657|  6.62k|    return r->d;
  658|  6.62k|}
RSA_get0_p:
  661|  13.2k|{
  662|  13.2k|    return r->p;
  663|  13.2k|}
RSA_get0_pss_params:
  686|  2.43k|{
  687|       |#ifdef FIPS_MODULE
  688|       |    return NULL;
  689|       |#else
  690|  2.43k|    return r->pss;
  691|  2.43k|#endif
  692|  2.43k|}
ossl_rsa_set0_pss_params:
  696|  2.43k|{
  697|       |#ifdef FIPS_MODULE
  698|       |    return 0;
  699|       |#else
  700|  2.43k|    RSA_PSS_PARAMS_free(r->pss);
  701|  2.43k|    r->pss = pss;
  702|  2.43k|    return 1;
  703|  2.43k|#endif
  704|  2.43k|}
ossl_rsa_get0_pss_params_30:
  708|  9.09k|{
  709|  9.09k|    return &r->pss_params;
  710|  9.09k|}
RSA_clear_flags:
  713|  6.62k|{
  714|  6.62k|    r->flags &= ~flags;
  715|  6.62k|}
RSA_test_flags:
  718|  20.6k|{
  719|  20.6k|    return r->flags & flags;
  720|  20.6k|}
RSA_set_flags:
  723|  6.62k|{
  724|  6.62k|    r->flags |= flags;
  725|  6.62k|}
RSA_pkey_ctx_ctrl:
  740|  1.49k|{
  741|       |    /* If key type not RSA or RSA-PSS return error */
  742|  1.49k|    if (ctx != NULL && ctx->pmeth != NULL
  ------------------
  |  Branch (742:9): [True: 1.49k, False: 0]
  |  Branch (742:24): [True: 0, False: 1.49k]
  ------------------
  743|  1.49k|        && ctx->pmeth->pkey_id != EVP_PKEY_RSA
  ------------------
  |  |   63|      0|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  1.49k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (743:12): [True: 0, False: 0]
  ------------------
  744|  1.49k|        && ctx->pmeth->pkey_id != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   65|      0|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      0|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (744:12): [True: 0, False: 0]
  ------------------
  745|      0|        return -1;
  746|  1.49k|     return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, p1, p2);
  747|  1.49k|}
ossl_rsa_get0_all_params:
  877|  13.2k|{
  878|  13.2k|#ifndef FIPS_MODULE
  879|  13.2k|    RSA_PRIME_INFO *pinfo;
  880|  13.2k|    int i, pnum;
  881|  13.2k|#endif
  882|       |
  883|  13.2k|    if (r == NULL)
  ------------------
  |  Branch (883:9): [True: 0, False: 13.2k]
  ------------------
  884|      0|        return 0;
  885|       |
  886|       |    /* If |p| is NULL, there are no CRT parameters */
  887|  13.2k|    if (RSA_get0_p(r) == NULL)
  ------------------
  |  Branch (887:9): [True: 13.2k, False: 0]
  ------------------
  888|  13.2k|        return 1;
  889|       |
  890|      0|    sk_BIGNUM_const_push(primes, RSA_get0_p(r));
  891|      0|    sk_BIGNUM_const_push(primes, RSA_get0_q(r));
  892|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));
  893|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmq1(r));
  894|      0|    sk_BIGNUM_const_push(coeffs, RSA_get0_iqmp(r));
  895|       |
  896|      0|#ifndef FIPS_MODULE
  897|      0|    pnum = RSA_get_multi_prime_extra_count(r);
  898|      0|    for (i = 0; i < pnum; i++) {
  ------------------
  |  Branch (898:17): [True: 0, False: 0]
  ------------------
  899|      0|        pinfo = sk_RSA_PRIME_INFO_value(r->prime_infos, i);
  900|      0|        sk_BIGNUM_const_push(primes, pinfo->r);
  901|      0|        sk_BIGNUM_const_push(exps, pinfo->d);
  902|      0|        sk_BIGNUM_const_push(coeffs, pinfo->t);
  903|      0|    }
  904|      0|#endif
  905|       |
  906|      0|    return 1;
  907|  13.2k|}
ossl_rsa_check_factors:
  911|  6.62k|{
  912|  6.62k|    int valid = 0;
  913|  6.62k|    int n, i, bits;
  914|  6.62k|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|  6.62k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  915|  6.62k|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|  6.62k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  916|  6.62k|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|  6.62k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  917|       |
  918|  6.62k|    if (factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (918:9): [True: 0, False: 6.62k]
  |  Branch (918:28): [True: 0, False: 6.62k]
  |  Branch (918:44): [True: 0, False: 6.62k]
  ------------------
  919|      0|        goto done;
  920|       |
  921|       |    /*
  922|       |     * Simple sanity check for RSA key. All RSA key parameters
  923|       |     * must be less-than/equal-to RSA parameter n.
  924|       |     */
  925|  6.62k|    ossl_rsa_get0_all_params(r, factors, exps, coeffs);
  926|  6.62k|    n = safe_BN_num_bits(RSA_get0_n(r));
  ------------------
  |  |  909|  6.62k|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 6.62k]
  |  |  ------------------
  ------------------
  927|       |
  928|  6.62k|    if (safe_BN_num_bits(RSA_get0_d(r)) > n)
  ------------------
  |  |  909|  6.62k|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 6.62k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (928:9): [True: 0, False: 6.62k]
  ------------------
  929|      0|        goto done;
  930|       |
  931|  6.62k|    for (i = 0; i < sk_BIGNUM_const_num(exps); i++) {
  ------------------
  |  Branch (931:17): [True: 0, False: 6.62k]
  ------------------
  932|      0|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(exps, i));
  ------------------
  |  |  909|      0|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  933|      0|        if (bits > n)
  ------------------
  |  Branch (933:13): [True: 0, False: 0]
  ------------------
  934|      0|            goto done;
  935|      0|    }
  936|       |
  937|  6.62k|    for (i = 0; i < sk_BIGNUM_const_num(factors); i++) {
  ------------------
  |  Branch (937:17): [True: 0, False: 6.62k]
  ------------------
  938|      0|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(factors, i));
  ------------------
  |  |  909|      0|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  939|      0|        if (bits > n)
  ------------------
  |  Branch (939:13): [True: 0, False: 0]
  ------------------
  940|      0|            goto done;
  941|      0|    }
  942|       |
  943|  6.62k|    for (i = 0; i < sk_BIGNUM_const_num(coeffs); i++) {
  ------------------
  |  Branch (943:17): [True: 0, False: 6.62k]
  ------------------
  944|      0|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(coeffs, i));
  ------------------
  |  |  909|      0|#define safe_BN_num_bits(_k_)  (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (909:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  945|      0|        if (bits > n)
  ------------------
  |  Branch (945:13): [True: 0, False: 0]
  ------------------
  946|      0|            goto done;
  947|      0|    }
  948|       |
  949|  6.62k|    valid = 1;
  950|       |
  951|  6.62k|done:
  952|  6.62k|    sk_BIGNUM_const_free(factors);
  953|  6.62k|    sk_BIGNUM_const_free(exps);
  954|  6.62k|    sk_BIGNUM_const_free(coeffs);
  955|       |
  956|  6.62k|    return valid;
  957|  6.62k|}
EVP_PKEY_CTX_set_rsa_padding:
 1041|    498|{
 1042|    498|    return RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_RSA_PADDING,
  ------------------
  |  |  173|    498|# define EVP_PKEY_CTRL_RSA_PADDING       (EVP_PKEY_ALG_CTRL + 1)
  |  |  ------------------
  |  |  |  | 1811|    498|# define EVP_PKEY_ALG_CTRL               0x1000
  |  |  ------------------
  ------------------
 1043|    498|                             pad_mode, NULL);
 1044|    498|}
EVP_PKEY_CTX_set_rsa_mgf1_md:
 1125|    498|{
 1126|    498|    return RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT,
  ------------------
  |  | 1764|    498|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1748|    498|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1758|    498|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  ------------------
  |  | 1765|    498|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1749|    498|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1759|    498|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  ------------------
  |  | 1766|    498|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  ------------------
  |  |  |  | 1750|    498|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  ------------------
  |  | 1767|    498|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1751|    498|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1752|    498|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  ------------------
  ------------------
                  return RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT,
  ------------------
  |  | 1770|    498|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  ------------------
  |  |  |  | 1753|    498|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  ------------------
  |  |  |  | 1754|    498|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  ------------------
  ------------------
 1127|    498|                             EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md));
  ------------------
  |  |  178|    498|# define EVP_PKEY_CTRL_RSA_MGF1_MD       (EVP_PKEY_ALG_CTRL + 5)
  |  |  ------------------
  |  |  |  | 1811|    498|# define EVP_PKEY_ALG_CTRL               0x1000
  |  |  ------------------
  ------------------
 1128|    498|}
EVP_PKEY_CTX_set_rsa_pss_saltlen:
 1248|    498|{
 1249|       |    /*
 1250|       |     * For some reason, the optype was set to this:
 1251|       |     *
 1252|       |     * EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY
 1253|       |     *
 1254|       |     * However, we do use RSA-PSS with the whole gamut of diverse signature
 1255|       |     * and verification operations, so the optype gets upgraded to this:
 1256|       |     *
 1257|       |     * EVP_PKEY_OP_TYPE_SIG
 1258|       |     */
 1259|    498|    return RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG,
  ------------------
  |  | 1764|    498|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1748|    498|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1758|    498|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  ------------------
  |  | 1765|    498|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1749|    498|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1759|    498|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  ------------------
  |  | 1766|    498|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  ------------------
  |  |  |  | 1750|    498|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  ------------------
  |  | 1767|    498|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1751|    498|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1752|    498|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  ------------------
  ------------------
 1260|    498|                             EVP_PKEY_CTRL_RSA_PSS_SALTLEN, saltlen, NULL);
  ------------------
  |  |  174|    498|# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN   (EVP_PKEY_ALG_CTRL + 2)
  |  |  ------------------
  |  |  |  | 1811|    498|# define EVP_PKEY_ALG_CTRL               0x1000
  |  |  ------------------
  ------------------
 1261|    498|}
rsa_lib.c:rsa_new_intern:
   76|  9.12k|{
   77|  9.12k|    RSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  9.12k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  9.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  9.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |
   79|  9.12k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 9.12k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  9.12k|    ret->lock = CRYPTO_THREAD_lock_new();
   83|  9.12k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (83:9): [True: 0, False: 9.12k]
  ------------------
   84|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   85|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|       |
   89|  9.12k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 9.12k]
  ------------------
   90|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   91|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|      0|        return NULL;
   93|      0|    }
   94|       |
   95|  9.12k|    ret->libctx = libctx;
   96|  9.12k|    ret->meth = RSA_get_default_method();
   97|  9.12k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   98|  9.12k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  9.12k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
   99|  9.12k|    if (engine) {
  ------------------
  |  Branch (99:9): [True: 0, False: 9.12k]
  ------------------
  100|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|            goto err;
  103|      0|        }
  104|      0|        ret->engine = engine;
  105|  9.12k|    } else {
  106|  9.12k|        ret->engine = ENGINE_get_default_RSA();
  107|  9.12k|    }
  108|  9.12k|    if (ret->engine) {
  ------------------
  |  Branch (108:9): [True: 0, False: 9.12k]
  ------------------
  109|      0|        ret->meth = ENGINE_get_RSA(ret->engine);
  110|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (110:13): [True: 0, False: 0]
  ------------------
  111|      0|            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|      0|            goto err;
  113|      0|        }
  114|      0|    }
  115|  9.12k|#endif
  116|       |
  117|  9.12k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  9.12k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  118|  9.12k|#ifndef FIPS_MODULE
  119|  9.12k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
  ------------------
  |  |  238|  9.12k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  |  Branch (119:9): [True: 0, False: 9.12k]
  ------------------
  120|      0|        goto err;
  121|      0|    }
  122|  9.12k|#endif
  123|       |
  124|  9.12k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 9.12k, False: 0]
  |  Branch (124:38): [True: 0, False: 9.12k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |
  129|  9.12k|    return ret;
  130|       |
  131|      0| err:
  132|      0|    RSA_free(ret);
  133|      0|    return NULL;
  134|  9.12k|}
rsa_lib.c:ilog_e:
  280|  3.43k|{
  281|  3.43k|    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|  24.2k|    while (v >= 2 * scale) {
  ------------------
  |  Branch (290:12): [True: 20.7k, False: 3.43k]
  ------------------
  291|  20.7k|        v >>= 1;
  292|  20.7k|        r += scale;
  293|  20.7k|    }
  294|  65.2k|    for (i = scale / 2; i != 0; i /= 2) {
  ------------------
  |  Branch (294:25): [True: 61.7k, False: 3.43k]
  ------------------
  295|  61.7k|        v = mul2(v, v);
  296|  61.7k|        if (v >= 2 * scale) {
  ------------------
  |  Branch (296:13): [True: 29.1k, False: 32.6k]
  ------------------
  297|  29.1k|            v >>= 1;
  298|  29.1k|            r += i;
  299|  29.1k|        }
  300|  61.7k|    }
  301|  3.43k|    r = (r * (uint64_t)scale) / log_e;
  302|  3.43k|    return r;
  303|  3.43k|}
rsa_lib.c:mul2:
  244|  72.0k|{
  245|  72.0k|    return a * b / scale;
  246|  72.0k|}
rsa_lib.c:icbrt64:
  256|  3.43k|{
  257|  3.43k|    uint64_t r = 0;
  258|  3.43k|    uint64_t b;
  259|  3.43k|    int s;
  260|       |
  261|  78.9k|    for (s = 63; s >= 0; s -= 3) {
  ------------------
  |  Branch (261:18): [True: 75.5k, False: 3.43k]
  ------------------
  262|  75.5k|        r <<= 1;
  263|  75.5k|        b = 3 * r * (r + 1) + 1;
  264|  75.5k|        if ((x >> s) >= b) {
  ------------------
  |  Branch (264:13): [True: 14.6k, False: 60.9k]
  ------------------
  265|  14.6k|            x -= b << s;
  266|  14.6k|            r++;
  267|  14.6k|        }
  268|  75.5k|    }
  269|  3.43k|    return r * cbrt_scale;
  270|  3.43k|}

PKCS1_MGF1:
  352|     15|{
  353|     15|    long i, outlen = 0;
  354|     15|    unsigned char cnt[4];
  355|     15|    EVP_MD_CTX *c = EVP_MD_CTX_new();
  356|     15|    unsigned char md[EVP_MAX_MD_SIZE];
  357|     15|    int mdlen;
  358|     15|    int rv = -1;
  359|       |
  360|     15|    if (c == NULL)
  ------------------
  |  Branch (360:9): [True: 0, False: 15]
  ------------------
  361|      0|        goto err;
  362|     15|    mdlen = EVP_MD_get_size(dgst);
  363|     15|    if (mdlen <= 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 15]
  ------------------
  364|      0|        goto err;
  365|       |    /* step 4 */
  366|    195|    for (i = 0; outlen < len; i++) {
  ------------------
  |  Branch (366:17): [True: 180, False: 15]
  ------------------
  367|       |        /* step 4a: D = I2BS(counter, 4) */
  368|    180|        cnt[0] = (unsigned char)((i >> 24) & 255);
  369|    180|        cnt[1] = (unsigned char)((i >> 16) & 255);
  370|    180|        cnt[2] = (unsigned char)((i >> 8)) & 255;
  371|    180|        cnt[3] = (unsigned char)(i & 255);
  372|       |        /* step 4b: T =T || hash(mgfSeed || D) */
  373|    180|        if (!EVP_DigestInit_ex(c, dgst, NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 180]
  ------------------
  374|    180|            || !EVP_DigestUpdate(c, seed, seedlen)
  ------------------
  |  Branch (374:16): [True: 0, False: 180]
  ------------------
  375|    180|            || !EVP_DigestUpdate(c, cnt, 4))
  ------------------
  |  Branch (375:16): [True: 0, False: 180]
  ------------------
  376|      0|            goto err;
  377|    180|        if (outlen + mdlen <= len) {
  ------------------
  |  Branch (377:13): [True: 165, False: 15]
  ------------------
  378|    165|            if (!EVP_DigestFinal_ex(c, mask + outlen, NULL))
  ------------------
  |  Branch (378:17): [True: 0, False: 165]
  ------------------
  379|      0|                goto err;
  380|    165|            outlen += mdlen;
  381|    165|        } else {
  382|     15|            if (!EVP_DigestFinal_ex(c, md, NULL))
  ------------------
  |  Branch (382:17): [True: 0, False: 15]
  ------------------
  383|      0|                goto err;
  384|     15|            memcpy(mask + outlen, md, len - outlen);
  385|     15|            outlen = len;
  386|     15|        }
  387|    180|    }
  388|     15|    rv = 0;
  389|     15| err:
  390|     15|    OPENSSL_cleanse(md, sizeof(md));
  391|     15|    EVP_MD_CTX_free(c);
  392|     15|    return rv;
  393|     15|}

RSA_get_default_method:
   85|  9.12k|{
   86|  9.12k|    return default_RSA_meth;
   87|  9.12k|}
RSA_PKCS1_OpenSSL:
   90|  6.62k|{
   91|  6.62k|    return &rsa_pkcs1_ossl_meth;
   92|  6.62k|}
rsa_ossl.c:rsa_ossl_public_decrypt:
  708|    782|{
  709|    782|    BIGNUM *f, *ret;
  710|    782|    int i, num = 0, r = -1;
  711|    782|    unsigned char *buf = NULL;
  712|    782|    BN_CTX *ctx = NULL;
  713|       |
  714|    782|    if (BN_num_bits(rsa->n) > OPENSSL_RSA_MAX_MODULUS_BITS) {
  ------------------
  |  |   39|    782|#  define OPENSSL_RSA_MAX_MODULUS_BITS   16384
  ------------------
  |  Branch (714:9): [True: 0, False: 782]
  ------------------
  715|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  716|      0|        return -1;
  717|      0|    }
  718|       |
  719|    782|    if (BN_ucmp(rsa->n, rsa->e) <= 0) {
  ------------------
  |  Branch (719:9): [True: 1, False: 781]
  ------------------
  720|      1|        ERR_raise(ERR_LIB_RSA, RSA_R_BAD_E_VALUE);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  721|      1|        return -1;
  722|      1|    }
  723|       |
  724|       |    /* for large moduli, enforce exponent limit */
  725|    781|    if (BN_num_bits(rsa->n) > OPENSSL_RSA_SMALL_MODULUS_BITS) {
  ------------------
  |  |   51|    781|#   define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
  ------------------
  |  Branch (725:9): [True: 0, False: 781]
  ------------------
  726|      0|        if (BN_num_bits(rsa->e) > OPENSSL_RSA_MAX_PUBEXP_BITS) {
  ------------------
  |  |   56|      0|#   define OPENSSL_RSA_MAX_PUBEXP_BITS    64
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  ------------------
  727|      0|            ERR_raise(ERR_LIB_RSA, RSA_R_BAD_E_VALUE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  728|      0|            return -1;
  729|      0|        }
  730|      0|    }
  731|       |
  732|    781|    if ((ctx = BN_CTX_new_ex(rsa->libctx)) == NULL)
  ------------------
  |  Branch (732:9): [True: 0, False: 781]
  ------------------
  733|      0|        goto err;
  734|    781|    BN_CTX_start(ctx);
  735|    781|    f = BN_CTX_get(ctx);
  736|    781|    ret = BN_CTX_get(ctx);
  737|    781|    if (ret == NULL) {
  ------------------
  |  Branch (737:9): [True: 0, False: 781]
  ------------------
  738|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  739|      0|        goto err;
  740|      0|    }
  741|    781|    num = BN_num_bytes(rsa->n);
  ------------------
  |  |  189|    781|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  742|    781|    buf = OPENSSL_malloc(num);
  ------------------
  |  |  102|    781|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    781|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    781|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  743|    781|    if (buf == NULL)
  ------------------
  |  Branch (743:9): [True: 0, False: 781]
  ------------------
  744|      0|        goto err;
  745|       |
  746|       |    /*
  747|       |     * This check was for equality but PGP does evil things and chops off the
  748|       |     * top '0' bytes
  749|       |     */
  750|    781|    if (flen > num) {
  ------------------
  |  Branch (750:9): [True: 16, False: 765]
  ------------------
  751|     16|        ERR_raise(ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN);
  ------------------
  |  |  401|     16|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     16|    (ERR_new(),                                                 \
  |  |  |  |  404|     16|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     16|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     16|     ERR_set_error)
  |  |  ------------------
  ------------------
  752|     16|        goto err;
  753|     16|    }
  754|       |
  755|    765|    if (BN_bin2bn(from, flen, f) == NULL)
  ------------------
  |  Branch (755:9): [True: 0, False: 765]
  ------------------
  756|      0|        goto err;
  757|       |
  758|    765|    if (BN_ucmp(f, rsa->n) >= 0) {
  ------------------
  |  Branch (758:9): [True: 15, False: 750]
  ------------------
  759|     15|        ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS);
  ------------------
  |  |  401|     15|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     15|    (ERR_new(),                                                 \
  |  |  |  |  404|     15|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     15|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     15|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     15|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     15|     ERR_set_error)
  |  |  ------------------
  ------------------
  760|     15|        goto err;
  761|     15|    }
  762|       |
  763|    750|    if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
  ------------------
  |  |   65|    750|#  define RSA_FLAG_CACHE_PUBLIC           0x0002
  ------------------
  |  Branch (763:9): [True: 750, False: 0]
  ------------------
  764|    750|        if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, rsa->lock,
  ------------------
  |  Branch (764:13): [True: 119, False: 631]
  ------------------
  765|    750|                                    rsa->n, ctx))
  766|    119|            goto err;
  767|       |
  768|    631|    if (!rsa->meth->bn_mod_exp(ret, f, rsa->e, rsa->n, ctx,
  ------------------
  |  Branch (768:9): [True: 0, False: 631]
  ------------------
  769|    631|                               rsa->_method_mod_n))
  770|      0|        goto err;
  771|       |
  772|       |    /* For X9.31: Assuming e is odd it does a 12 mod 16 test */
  773|    631|    if ((padding == RSA_X931_PADDING) && ((bn_get_words(ret)[0] & 0xf) != 12))
  ------------------
  |  |  197|    631|# define RSA_X931_PADDING           5
  ------------------
  |  Branch (773:9): [True: 0, False: 631]
  |  Branch (773:42): [True: 0, False: 0]
  ------------------
  774|      0|        if (!BN_sub(ret, rsa->n, ret))
  ------------------
  |  Branch (774:13): [True: 0, False: 0]
  ------------------
  775|      0|            goto err;
  776|       |
  777|    631|    i = BN_bn2binpad(ret, buf, num);
  778|    631|    if (i < 0)
  ------------------
  |  Branch (778:9): [True: 0, False: 631]
  ------------------
  779|      0|        goto err;
  780|       |
  781|    631|    switch (padding) {
  782|    224|    case RSA_PKCS1_PADDING:
  ------------------
  |  |  194|    224|# define RSA_PKCS1_PADDING          1
  ------------------
  |  Branch (782:5): [True: 224, False: 407]
  ------------------
  783|    224|        r = RSA_padding_check_PKCS1_type_1(to, num, buf, i, num);
  784|    224|        break;
  785|      0|    case RSA_X931_PADDING:
  ------------------
  |  |  197|      0|# define RSA_X931_PADDING           5
  ------------------
  |  Branch (785:5): [True: 0, False: 631]
  ------------------
  786|      0|        r = RSA_padding_check_X931(to, num, buf, i, num);
  787|      0|        break;
  788|    407|    case RSA_NO_PADDING:
  ------------------
  |  |  195|    407|# define RSA_NO_PADDING             3
  ------------------
  |  Branch (788:5): [True: 407, False: 224]
  ------------------
  789|    407|        memcpy(to, buf, (r = i));
  790|    407|        break;
  791|      0|    default:
  ------------------
  |  Branch (791:5): [True: 0, False: 631]
  ------------------
  792|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  793|      0|        goto err;
  794|    631|    }
  795|    631|    if (r < 0)
  ------------------
  |  Branch (795:9): [True: 158, False: 473]
  ------------------
  796|    631|        ERR_raise(ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED);
  ------------------
  |  |  401|    158|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    158|    (ERR_new(),                                                 \
  |  |  |  |  404|    158|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    158|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    158|     ERR_set_error)
  |  |  ------------------
  ------------------
  797|       |
  798|    781| err:
  799|    781|    BN_CTX_end(ctx);
  800|    781|    BN_CTX_free(ctx);
  801|    781|    OPENSSL_clear_free(buf, num);
  ------------------
  |  |  113|    781|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    781|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    781|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  802|    781|    return r;
  803|    631|}
rsa_ossl.c:rsa_ossl_init:
 1177|  9.12k|{
 1178|  9.12k|    rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   65|  9.12k|#  define RSA_FLAG_CACHE_PUBLIC           0x0002
  ------------------
                  rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   66|  9.12k|#  define RSA_FLAG_CACHE_PRIVATE          0x0004
  ------------------
 1179|  9.12k|    return 1;
 1180|  9.12k|}
rsa_ossl.c:rsa_ossl_finish:
 1183|  9.12k|{
 1184|  9.12k|#ifndef FIPS_MODULE
 1185|  9.12k|    int i;
 1186|  9.12k|    RSA_PRIME_INFO *pinfo;
 1187|       |
 1188|  9.12k|    for (i = 0; i < sk_RSA_PRIME_INFO_num(rsa->prime_infos); i++) {
  ------------------
  |  Branch (1188:17): [True: 0, False: 9.12k]
  ------------------
 1189|      0|        pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);
 1190|      0|        BN_MONT_CTX_free(pinfo->m);
 1191|      0|    }
 1192|  9.12k|#endif
 1193|       |
 1194|  9.12k|    BN_MONT_CTX_free(rsa->_method_mod_n);
 1195|  9.12k|    BN_MONT_CTX_free(rsa->_method_mod_p);
 1196|  9.12k|    BN_MONT_CTX_free(rsa->_method_mod_q);
 1197|  9.12k|    return 1;
 1198|  9.12k|}

RSA_padding_check_PKCS1_type_1:
   60|    224|{
   61|    224|    int i, j;
   62|    224|    const unsigned char *p;
   63|       |
   64|    224|    p = from;
   65|       |
   66|       |    /*
   67|       |     * The format is
   68|       |     * 00 || 01 || PS || 00 || D
   69|       |     * PS - padding string, at least 8 bytes of FF
   70|       |     * D  - data.
   71|       |     */
   72|       |
   73|    224|    if (num < RSA_PKCS1_PADDING_SIZE)
  ------------------
  |  |  206|    224|# define RSA_PKCS1_PADDING_SIZE    11
  ------------------
  |  Branch (73:9): [True: 0, False: 224]
  ------------------
   74|      0|        return -1;
   75|       |
   76|       |    /* Accept inputs with and without the leading 0-byte. */
   77|    224|    if (num == flen) {
  ------------------
  |  Branch (77:9): [True: 224, False: 0]
  ------------------
   78|    224|        if ((*p++) != 0x00) {
  ------------------
  |  Branch (78:13): [True: 120, False: 104]
  ------------------
   79|    120|            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    120|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    120|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    120|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    120|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|    120|            return -1;
   81|    120|        }
   82|    104|        flen--;
   83|    104|    }
   84|       |
   85|    104|    if ((num != (flen + 1)) || (*(p++) != 0x01)) {
  ------------------
  |  Branch (85:9): [True: 0, False: 104]
  |  Branch (85:32): [True: 28, False: 76]
  ------------------
   86|     28|        ERR_raise(ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     28|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     28|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|     28|        return -1;
   88|     28|    }
   89|       |
   90|       |    /* scan over padding data */
   91|     76|    j = flen - 1;               /* one for type. */
   92|  12.7k|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (92:17): [True: 12.7k, False: 0]
  ------------------
   93|  12.7k|        if (*p != 0xff) {       /* should decrypt to 0xff */
  ------------------
  |  Branch (93:13): [True: 76, False: 12.6k]
  ------------------
   94|     76|            if (*p == 0) {
  ------------------
  |  Branch (94:17): [True: 71, False: 5]
  ------------------
   95|     71|                p++;
   96|     71|                break;
   97|     71|            } else {
   98|      5|                ERR_raise(ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
   99|      5|                return -1;
  100|      5|            }
  101|     76|        }
  102|  12.6k|        p++;
  103|  12.6k|    }
  104|       |
  105|     71|    if (i == j) {
  ------------------
  |  Branch (105:9): [True: 0, False: 71]
  ------------------
  106|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|        return -1;
  108|      0|    }
  109|       |
  110|     71|    if (i < 8) {
  ------------------
  |  Branch (110:9): [True: 5, False: 66]
  ------------------
  111|      5|        ERR_raise(ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|      5|        return -1;
  113|      5|    }
  114|     66|    i++;                        /* Skip over the '\0' */
  115|     66|    j -= i;
  116|     66|    if (j > tlen) {
  ------------------
  |  Branch (116:9): [True: 0, False: 66]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        return -1;
  119|      0|    }
  120|     66|    memcpy(to, p, (unsigned int)j);
  121|       |
  122|     66|    return j;
  123|     66|}

ossl_rsa_verify_PKCS1_PSS_mgf1:
   48|    407|{
   49|    407|    int i;
   50|    407|    int ret = 0;
   51|    407|    int sLen = *sLenOut;
   52|    407|    int hLen, maskedDBLen, MSBits, emLen;
   53|    407|    const unsigned char *H;
   54|    407|    unsigned char *DB = NULL;
   55|    407|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
   56|    407|    unsigned char H_[EVP_MAX_MD_SIZE];
   57|       |
   58|    407|    if (ctx == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 407]
  ------------------
   59|      0|        goto err;
   60|       |
   61|    407|    if (mgf1Hash == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 407]
  ------------------
   62|      0|        mgf1Hash = Hash;
   63|       |
   64|    407|    hLen = EVP_MD_get_size(Hash);
   65|    407|    if (hLen <= 0)
  ------------------
  |  Branch (65:9): [True: 0, False: 407]
  ------------------
   66|      0|        goto err;
   67|       |    /*-
   68|       |     * Negative sLen has special meanings:
   69|       |     *      -1      sLen == hLen
   70|       |     *      -2      salt length is autorecovered from signature
   71|       |     *      -3      salt length is maximized
   72|       |     *      -4      salt length is autorecovered from signature
   73|       |     *      -N      reserved
   74|       |     */
   75|    407|    if (sLen == RSA_PSS_SALTLEN_DIGEST) {
  ------------------
  |  |  138|    407|# define RSA_PSS_SALTLEN_DIGEST -1
  ------------------
  |  Branch (75:9): [True: 0, False: 407]
  ------------------
   76|      0|        sLen = hLen;
   77|    407|    } else if (sLen < RSA_PSS_SALTLEN_AUTO_DIGEST_MAX) {
  ------------------
  |  |  145|    407|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
  |  Branch (77:16): [True: 0, False: 407]
  ------------------
   78|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   79|      0|        goto err;
   80|      0|    }
   81|       |
   82|    407|    MSBits = (BN_num_bits(rsa->n) - 1) & 0x7;
   83|    407|    emLen = RSA_size(rsa);
   84|    407|    if (EM[0] & (0xFF << MSBits)) {
  ------------------
  |  Branch (84:9): [True: 39, False: 368]
  ------------------
   85|     39|        ERR_raise(ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     39|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     39|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     39|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     39|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|     39|        goto err;
   87|     39|    }
   88|    368|    if (MSBits == 0) {
  ------------------
  |  Branch (88:9): [True: 14, False: 354]
  ------------------
   89|     14|        EM++;
   90|     14|        emLen--;
   91|     14|    }
   92|    368|    if (emLen < hLen + 2) {
  ------------------
  |  Branch (92:9): [True: 0, False: 368]
  ------------------
   93|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   94|      0|        goto err;
   95|      0|    }
   96|    368|    if (sLen == RSA_PSS_SALTLEN_MAX) {
  ------------------
  |  |  142|    368|# define RSA_PSS_SALTLEN_MAX    -3
  ------------------
  |  Branch (96:9): [True: 0, False: 368]
  ------------------
   97|      0|        sLen = emLen - hLen - 2;
   98|    368|    } else if (sLen > emLen - hLen - 2) { /* sLen can be small negative */
  ------------------
  |  Branch (98:16): [True: 0, False: 368]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        goto err;
  101|      0|    }
  102|    368|    if (EM[emLen - 1] != 0xbc) {
  ------------------
  |  Branch (102:9): [True: 353, False: 15]
  ------------------
  103|    353|        ERR_raise(ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID);
  ------------------
  |  |  401|    353|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    353|    (ERR_new(),                                                 \
  |  |  |  |  404|    353|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    353|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    353|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    353|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    353|     ERR_set_error)
  |  |  ------------------
  ------------------
  104|    353|        goto err;
  105|    353|    }
  106|     15|    maskedDBLen = emLen - hLen - 1;
  107|     15|    H = EM + maskedDBLen;
  108|     15|    DB = OPENSSL_malloc(maskedDBLen);
  ------------------
  |  |  102|     15|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     15|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     15|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|     15|    if (DB == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 15]
  ------------------
  110|      0|        goto err;
  111|     15|    if (PKCS1_MGF1(DB, maskedDBLen, H, hLen, mgf1Hash) < 0)
  ------------------
  |  Branch (111:9): [True: 0, False: 15]
  ------------------
  112|      0|        goto err;
  113|  3.54k|    for (i = 0; i < maskedDBLen; i++)
  ------------------
  |  Branch (113:17): [True: 3.53k, False: 15]
  ------------------
  114|  3.53k|        DB[i] ^= EM[i];
  115|     15|    if (MSBits)
  ------------------
  |  Branch (115:9): [True: 12, False: 3]
  ------------------
  116|     12|        DB[0] &= 0xFF >> (8 - MSBits);
  117|     18|    for (i = 0; DB[i] == 0 && i < (maskedDBLen - 1); i++) ;
  ------------------
  |  Branch (117:17): [True: 3, False: 15]
  |  Branch (117:31): [True: 3, False: 0]
  ------------------
  118|     15|    if (DB[i++] != 0x1) {
  ------------------
  |  Branch (118:9): [True: 11, False: 4]
  ------------------
  119|     11|        ERR_raise(ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED);
  ------------------
  |  |  401|     11|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     11|    (ERR_new(),                                                 \
  |  |  |  |  404|     11|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     11|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     11|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     11|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     11|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|     11|        goto err;
  121|     11|    }
  122|      4|    if (sLen != RSA_PSS_SALTLEN_AUTO
  ------------------
  |  |  140|      8|# define RSA_PSS_SALTLEN_AUTO   -2
  ------------------
  |  Branch (122:9): [True: 4, False: 0]
  ------------------
  123|      4|            && sLen != RSA_PSS_SALTLEN_AUTO_DIGEST_MAX
  ------------------
  |  |  145|      8|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
  |  Branch (123:16): [True: 4, False: 0]
  ------------------
  124|      4|            && (maskedDBLen - i) != sLen) {
  ------------------
  |  Branch (124:16): [True: 4, False: 0]
  ------------------
  125|      4|        ERR_raise_data(ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED,
  ------------------
  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      4|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED,
  ------------------
  |  |   74|      4|# define ERR_LIB_RSA             4
  ------------------
                      ERR_raise_data(ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED,
  ------------------
  |  |   91|      4|# define RSA_R_SLEN_CHECK_FAILED                          136
  ------------------
  126|      4|                       "expected: %d retrieved: %d", sLen,
  127|      4|                       maskedDBLen - i);
  128|      4|        goto err;
  129|      4|    } else {
  130|      0|        sLen = maskedDBLen - i;
  131|      0|    }
  132|      0|    if (!EVP_DigestInit_ex(ctx, Hash, NULL)
  ------------------
  |  Branch (132:9): [True: 0, False: 0]
  ------------------
  133|      0|        || !EVP_DigestUpdate(ctx, zeroes, sizeof(zeroes))
  ------------------
  |  Branch (133:12): [True: 0, False: 0]
  ------------------
  134|      0|        || !EVP_DigestUpdate(ctx, mHash, hLen))
  ------------------
  |  Branch (134:12): [True: 0, False: 0]
  ------------------
  135|      0|        goto err;
  136|      0|    if (sLen != 0) {
  ------------------
  |  Branch (136:9): [True: 0, False: 0]
  ------------------
  137|      0|        if (!EVP_DigestUpdate(ctx, DB + i, sLen))
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  ------------------
  138|      0|            goto err;
  139|      0|    }
  140|      0|    if (!EVP_DigestFinal_ex(ctx, H_, NULL))
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|        goto err;
  142|      0|    if (memcmp(H_, H, hLen)) {
  ------------------
  |  Branch (142:9): [True: 0, False: 0]
  ------------------
  143|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_BAD_SIGNATURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  144|      0|        ret = 0;
  145|      0|    } else {
  146|      0|        ret = 1;
  147|      0|    }
  148|       |
  149|      0|    *sLenOut = sLen;
  150|    407| err:
  151|    407|    OPENSSL_free(DB);
  ------------------
  |  |  115|    407|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    407|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    407|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|    407|    EVP_MD_CTX_free(ctx);
  153|       |
  154|    407|    return ret;
  155|       |
  156|      0|}
ossl_rsa_pss_params_30_set_defaults:
  326|  5.42k|{
  327|  5.42k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 5.42k]
  ------------------
  328|      0|        return 0;
  329|  5.42k|    *rsa_pss_params = default_RSASSA_PSS_params;
  330|  5.42k|    return 1;
  331|  5.42k|}
ossl_rsa_pss_params_30_is_unrestricted:
  334|  4.27k|{
  335|  4.27k|    static RSA_PSS_PARAMS_30 pss_params_cmp = { 0, };
  336|       |
  337|  4.27k|    return rsa_pss_params == NULL
  ------------------
  |  Branch (337:12): [True: 0, False: 4.27k]
  ------------------
  338|  4.27k|        || memcmp(rsa_pss_params, &pss_params_cmp,
  ------------------
  |  Branch (338:12): [True: 1.81k, False: 2.45k]
  ------------------
  339|  4.27k|                  sizeof(*rsa_pss_params)) == 0;
  340|  4.27k|}
ossl_rsa_pss_params_30_set_hashalg:
  351|  2.43k|{
  352|  2.43k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 2.43k]
  ------------------
  353|      0|        return 0;
  354|  2.43k|    rsa_pss_params->hash_algorithm_nid = hashalg_nid;
  355|  2.43k|    return 1;
  356|  2.43k|}
ossl_rsa_pss_params_30_set_maskgenhashalg:
  360|  2.43k|{
  361|  2.43k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (361:9): [True: 0, False: 2.43k]
  ------------------
  362|      0|        return 0;
  363|  2.43k|    rsa_pss_params->mask_gen.hash_algorithm_nid = maskgenhashalg_nid;
  364|  2.43k|    return 1;
  365|  2.43k|}
ossl_rsa_pss_params_30_set_saltlen:
  369|  2.43k|{
  370|  2.43k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (370:9): [True: 0, False: 2.43k]
  ------------------
  371|      0|        return 0;
  372|  2.43k|    rsa_pss_params->salt_len = saltlen;
  373|  2.43k|    return 1;
  374|  2.43k|}
ossl_rsa_pss_params_30_set_trailerfield:
  378|  2.43k|{
  379|  2.43k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (379:9): [True: 0, False: 2.43k]
  ------------------
  380|      0|        return 0;
  381|  2.43k|    rsa_pss_params->trailer_field = trailerfield;
  382|  2.43k|    return 1;
  383|  2.43k|}
ossl_rsa_pss_params_30_hashalg:
  386|  4.89k|{
  387|  4.89k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (387:9): [True: 2.43k, False: 2.45k]
  ------------------
  388|  2.43k|        return default_RSASSA_PSS_params.hash_algorithm_nid;
  389|  2.45k|    return rsa_pss_params->hash_algorithm_nid;
  390|  4.89k|}
ossl_rsa_pss_params_30_maskgenalg:
  393|  4.86k|{
  394|  4.86k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (394:9): [True: 2.43k, False: 2.43k]
  ------------------
  395|  2.43k|        return default_RSASSA_PSS_params.mask_gen.algorithm_nid;
  396|  2.43k|    return rsa_pss_params->mask_gen.algorithm_nid;
  397|  4.86k|}
ossl_rsa_pss_params_30_maskgenhashalg:
  400|  4.89k|{
  401|  4.89k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (401:9): [True: 2.43k, False: 2.45k]
  ------------------
  402|  2.43k|        return default_RSASSA_PSS_params.hash_algorithm_nid;
  403|  2.45k|    return rsa_pss_params->mask_gen.hash_algorithm_nid;
  404|  4.89k|}
ossl_rsa_pss_params_30_saltlen:
  407|  5.39k|{
  408|  5.39k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 5.39k]
  ------------------
  409|      0|        return default_RSASSA_PSS_params.salt_len;
  410|  5.39k|    return rsa_pss_params->salt_len;
  411|  5.39k|}
ossl_rsa_pss_params_30_trailerfield:
  414|  2.93k|{
  415|  2.93k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (415:9): [True: 0, False: 2.93k]
  ------------------
  416|      0|        return default_RSASSA_PSS_params.trailer_field;
  417|  2.93k|    return rsa_pss_params->trailer_field;
  418|  2.93k|}

ossl_rsa_oaeppss_nid2name:
   77|     50|{
   78|     50|    return nid2name(md, oaeppss_name_nid_map, OSSL_NELEM(oaeppss_name_nid_map));
  ------------------
  |  |   14|     50|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   79|     50|}
rsa_schemes.c:nid2name:
   31|     50|{
   32|     50|    size_t i;
   33|       |
   34|     50|    for (i = 0; i < items_n; i++)
  ------------------
  |  Branch (34:17): [True: 50, False: 0]
  ------------------
   35|     50|        if (meth == (int)items[i].id)
  ------------------
  |  Branch (35:13): [True: 50, False: 0]
  ------------------
   36|     50|            return items[i].ptr;
   37|      0|    return NULL;
   38|     50|}

ossl_rsa_digestinfo_encoding:
  167|     66|{
  168|     66|    switch (md_nid) {
  169|      0|#ifndef FIPS_MODULE
  170|      0|# ifndef OPENSSL_NO_MDC2
  171|      0|    MD_CASE(mdc2)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  172|      0|# endif
  173|      0|# ifndef OPENSSL_NO_MD2
  174|      0|    MD_CASE(md2)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  175|      0|# endif
  176|      0|# ifndef OPENSSL_NO_MD4
  177|      0|    MD_CASE(md4)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  178|      0|# endif
  179|      0|# ifndef OPENSSL_NO_MD5
  180|      3|    MD_CASE(md5)
  ------------------
  |  |  162|      3|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 3, False: 63]
  |  |  ------------------
  |  |  163|      3|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      3|        return digestinfo_##name##_der;
  ------------------
  181|      0|# endif
  182|      0|# ifndef OPENSSL_NO_RMD160
  183|      0|    MD_CASE(ripemd160)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  184|      0|# endif
  185|      0|# ifndef OPENSSL_NO_SM3
  186|      0|    MD_CASE(sm3)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  187|      0|# endif
  188|      0|#endif /* FIPS_MODULE */
  189|      4|    MD_CASE(sha1)
  ------------------
  |  |  162|      4|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 4, False: 62]
  |  |  ------------------
  |  |  163|      4|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      4|        return digestinfo_##name##_der;
  ------------------
  190|      6|    MD_CASE(sha224)
  ------------------
  |  |  162|      6|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 6, False: 60]
  |  |  ------------------
  |  |  163|      6|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      6|        return digestinfo_##name##_der;
  ------------------
  191|     27|    MD_CASE(sha256)
  ------------------
  |  |  162|     27|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 27, False: 39]
  |  |  ------------------
  |  |  163|     27|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|     27|        return digestinfo_##name##_der;
  ------------------
  192|      8|    MD_CASE(sha384)
  ------------------
  |  |  162|      8|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 8, False: 58]
  |  |  ------------------
  |  |  163|      8|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      8|        return digestinfo_##name##_der;
  ------------------
  193|      6|    MD_CASE(sha512)
  ------------------
  |  |  162|      6|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 6, False: 60]
  |  |  ------------------
  |  |  163|      6|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      6|        return digestinfo_##name##_der;
  ------------------
  194|      0|    MD_CASE(sha512_224)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  195|      0|    MD_CASE(sha512_256)
  ------------------
  |  |  162|      0|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 0, False: 66]
  |  |  ------------------
  |  |  163|      0|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      0|        return digestinfo_##name##_der;
  ------------------
  196|      3|    MD_CASE(sha3_224)
  ------------------
  |  |  162|      3|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 3, False: 63]
  |  |  ------------------
  |  |  163|      3|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      3|        return digestinfo_##name##_der;
  ------------------
  197|      3|    MD_CASE(sha3_256)
  ------------------
  |  |  162|      3|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 3, False: 63]
  |  |  ------------------
  |  |  163|      3|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      3|        return digestinfo_##name##_der;
  ------------------
  198|      3|    MD_CASE(sha3_384)
  ------------------
  |  |  162|      3|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 3, False: 63]
  |  |  ------------------
  |  |  163|      3|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      3|        return digestinfo_##name##_der;
  ------------------
  199|      3|    MD_CASE(sha3_512)
  ------------------
  |  |  162|      3|    case NID_##name:                                                           \
  |  |  ------------------
  |  |  |  Branch (162:5): [True: 3, False: 63]
  |  |  ------------------
  |  |  163|      3|        *len = sizeof(digestinfo_##name##_der);                                \
  |  |  164|      3|        return digestinfo_##name##_der;
  ------------------
  200|      0|    default:
  ------------------
  |  Branch (200:5): [True: 0, False: 66]
  ------------------
  201|      0|        return NULL;
  202|     66|    }
  203|     66|}
ossl_rsa_verify:
  348|    307|{
  349|    307|    int len, ret = 0;
  350|    307|    size_t decrypt_len, encoded_len = 0;
  351|    307|    unsigned char *decrypt_buf = NULL, *encoded = NULL;
  352|       |
  353|    307|    if (siglen != (size_t)RSA_size(rsa)) {
  ------------------
  |  Branch (353:9): [True: 22, False: 285]
  ------------------
  354|     22|        ERR_raise(ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH);
  ------------------
  |  |  401|     22|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     22|    (ERR_new(),                                                 \
  |  |  |  |  404|     22|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     22|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     22|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     22|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     22|     ERR_set_error)
  |  |  ------------------
  ------------------
  355|     22|        return 0;
  356|     22|    }
  357|       |
  358|       |    /* Recover the encoded digest. */
  359|    285|    decrypt_buf = OPENSSL_malloc(siglen);
  ------------------
  |  |  102|    285|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    285|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    285|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|    285|    if (decrypt_buf == NULL)
  ------------------
  |  Branch (360:9): [True: 0, False: 285]
  ------------------
  361|      0|        goto err;
  362|       |
  363|    285|    len = RSA_public_decrypt((int)siglen, sigbuf, decrypt_buf, rsa,
  364|    285|                             RSA_PKCS1_PADDING);
  ------------------
  |  |  194|    285|# define RSA_PKCS1_PADDING          1
  ------------------
  365|    285|    if (len <= 0)
  ------------------
  |  Branch (365:9): [True: 219, False: 66]
  ------------------
  366|    219|        goto err;
  367|     66|    decrypt_len = len;
  368|       |
  369|     66|#ifndef FIPS_MODULE
  370|     66|    if (type == NID_md5_sha1) {
  ------------------
  |  | 1220|     66|#define NID_md5_sha1            114
  ------------------
  |  Branch (370:9): [True: 0, False: 66]
  ------------------
  371|       |        /*
  372|       |         * NID_md5_sha1 corresponds to the MD5/SHA1 combination in TLS 1.1 and
  373|       |         * earlier. It has no DigestInfo wrapper but otherwise is
  374|       |         * RSASSA-PKCS1-v1_5.
  375|       |         */
  376|      0|        if (decrypt_len != SSL_SIG_LENGTH) {
  ------------------
  |  |  247|      0|#define SSL_SIG_LENGTH  36
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            ERR_raise(ERR_LIB_RSA, RSA_R_BAD_SIGNATURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  378|      0|            goto err;
  379|      0|        }
  380|       |
  381|      0|        if (rm != NULL) {
  ------------------
  |  Branch (381:13): [True: 0, False: 0]
  ------------------
  382|      0|            memcpy(rm, decrypt_buf, SSL_SIG_LENGTH);
  ------------------
  |  |  247|      0|#define SSL_SIG_LENGTH  36
  ------------------
  383|      0|            *prm_len = SSL_SIG_LENGTH;
  ------------------
  |  |  247|      0|#define SSL_SIG_LENGTH  36
  ------------------
  384|      0|        } else {
  385|      0|            if (m_len != SSL_SIG_LENGTH) {
  ------------------
  |  |  247|      0|#define SSL_SIG_LENGTH  36
  ------------------
  |  Branch (385:17): [True: 0, False: 0]
  ------------------
  386|      0|                ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  387|      0|                goto err;
  388|      0|            }
  389|       |
  390|      0|            if (memcmp(decrypt_buf, m, SSL_SIG_LENGTH) != 0) {
  ------------------
  |  |  247|      0|#define SSL_SIG_LENGTH  36
  ------------------
  |  Branch (390:17): [True: 0, False: 0]
  ------------------
  391|      0|                ERR_raise(ERR_LIB_RSA, RSA_R_BAD_SIGNATURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|                goto err;
  393|      0|            }
  394|      0|        }
  395|     66|    } else if (type == NID_mdc2 && decrypt_len == 2 + 16
  ------------------
  |  | 2643|    132|#define NID_mdc2                95
  ------------------
  |  Branch (395:16): [True: 0, False: 66]
  |  Branch (395:36): [True: 0, False: 0]
  ------------------
  396|     66|               && decrypt_buf[0] == 0x04 && decrypt_buf[1] == 0x10) {
  ------------------
  |  Branch (396:19): [True: 0, False: 0]
  |  Branch (396:45): [True: 0, False: 0]
  ------------------
  397|       |        /*
  398|       |         * Oddball MDC2 case: signature can be OCTET STRING. check for correct
  399|       |         * tag and length octets.
  400|       |         */
  401|      0|        if (rm != NULL) {
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|            memcpy(rm, decrypt_buf + 2, 16);
  403|      0|            *prm_len = 16;
  404|      0|        } else {
  405|      0|            if (m_len != 16) {
  ------------------
  |  Branch (405:17): [True: 0, False: 0]
  ------------------
  406|      0|                ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  407|      0|                goto err;
  408|      0|            }
  409|       |
  410|      0|            if (memcmp(m, decrypt_buf + 2, 16) != 0) {
  ------------------
  |  Branch (410:17): [True: 0, False: 0]
  ------------------
  411|      0|                ERR_raise(ERR_LIB_RSA, RSA_R_BAD_SIGNATURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  412|      0|                goto err;
  413|      0|            }
  414|      0|        }
  415|      0|    } else
  416|     66|#endif /* FIPS_MODULE */
  417|     66|    {
  418|       |        /*
  419|       |         * If recovering the digest, extract a digest-sized output from the end
  420|       |         * of |decrypt_buf| for |encode_pkcs1|, then compare the decryption
  421|       |         * output as in a standard verification.
  422|       |         */
  423|     66|        if (rm != NULL) {
  ------------------
  |  Branch (423:13): [True: 0, False: 66]
  ------------------
  424|      0|            len = digest_sz_from_nid(type);
  425|       |
  426|      0|            if (len <= 0)
  ------------------
  |  Branch (426:17): [True: 0, False: 0]
  ------------------
  427|      0|                goto err;
  428|      0|            m_len = (unsigned int)len;
  429|      0|            if (m_len > decrypt_len) {
  ------------------
  |  Branch (429:17): [True: 0, False: 0]
  ------------------
  430|      0|                ERR_raise(ERR_LIB_RSA, RSA_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|                goto err;
  432|      0|            }
  433|      0|            m = decrypt_buf + decrypt_len - m_len;
  434|      0|        }
  435|       |
  436|       |        /* Construct the encoded digest and ensure it matches. */
  437|     66|        if (!encode_pkcs1(&encoded, &encoded_len, type, m, m_len))
  ------------------
  |  Branch (437:13): [True: 0, False: 66]
  ------------------
  438|      0|            goto err;
  439|       |
  440|     66|        if (encoded_len != decrypt_len
  ------------------
  |  Branch (440:13): [True: 35, False: 31]
  ------------------
  441|     66|                || memcmp(encoded, decrypt_buf, encoded_len) != 0) {
  ------------------
  |  Branch (441:20): [True: 8, False: 23]
  ------------------
  442|     43|            ERR_raise(ERR_LIB_RSA, RSA_R_BAD_SIGNATURE);
  ------------------
  |  |  401|     43|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     43|    (ERR_new(),                                                 \
  |  |  |  |  404|     43|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     43|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     43|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     43|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     43|     ERR_set_error)
  |  |  ------------------
  ------------------
  443|     43|            goto err;
  444|     43|        }
  445|       |
  446|       |        /* Output the recovered digest. */
  447|     23|        if (rm != NULL) {
  ------------------
  |  Branch (447:13): [True: 0, False: 23]
  ------------------
  448|      0|            memcpy(rm, m, m_len);
  449|      0|            *prm_len = m_len;
  450|      0|        }
  451|     23|    }
  452|       |
  453|     23|    ret = 1;
  454|       |
  455|    285|err:
  456|    285|    OPENSSL_clear_free(encoded, encoded_len);
  ------------------
  |  |  113|    285|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    285|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    285|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  457|    285|    OPENSSL_clear_free(decrypt_buf, siglen);
  ------------------
  |  |  113|    285|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    285|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    285|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|    285|    return ret;
  459|     23|}
RSA_verify:
  463|    307|{
  464|       |
  465|    307|    if (rsa->meth->rsa_verify != NULL)
  ------------------
  |  Branch (465:9): [True: 0, False: 307]
  ------------------
  466|      0|        return rsa->meth->rsa_verify(type, m, m_len, sigbuf, siglen, rsa);
  467|       |
  468|    307|    return ossl_rsa_verify(type, m, m_len, NULL, NULL, sigbuf, siglen, rsa);
  469|    307|}
rsa_sign.c:encode_pkcs1:
  260|     66|{
  261|     66|    size_t di_prefix_len, dig_info_len;
  262|     66|    const unsigned char *di_prefix;
  263|     66|    unsigned char *dig_info;
  264|       |
  265|     66|    if (type == NID_undef) {
  ------------------
  |  |   18|     66|#define NID_undef                       0
  ------------------
  |  Branch (265:9): [True: 0, False: 66]
  ------------------
  266|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  267|      0|        return 0;
  268|      0|    }
  269|     66|    di_prefix = ossl_rsa_digestinfo_encoding(type, &di_prefix_len);
  270|     66|    if (di_prefix == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 66]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_RSA,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|                  RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD);
  273|      0|        return 0;
  274|      0|    }
  275|     66|    dig_info_len = di_prefix_len + m_len;
  276|     66|    dig_info = OPENSSL_malloc(dig_info_len);
  ------------------
  |  |  102|     66|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     66|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     66|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  277|     66|    if (dig_info == NULL)
  ------------------
  |  Branch (277:9): [True: 0, False: 66]
  ------------------
  278|      0|        return 0;
  279|     66|    memcpy(dig_info, di_prefix, di_prefix_len);
  280|     66|    memcpy(dig_info + di_prefix_len, m, m_len);
  281|       |
  282|     66|    *out = dig_info;
  283|     66|    *out_len = dig_info_len;
  284|     66|    return 1;
  285|     66|}

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

SHA224_Init:
   28|  52.2k|{
   29|  52.2k|    memset(c, 0, sizeof(*c));
   30|  52.2k|    c->h[0] = 0xc1059ed8UL;
   31|  52.2k|    c->h[1] = 0x367cd507UL;
   32|  52.2k|    c->h[2] = 0x3070dd17UL;
   33|  52.2k|    c->h[3] = 0xf70e5939UL;
   34|  52.2k|    c->h[4] = 0xffc00b31UL;
   35|  52.2k|    c->h[5] = 0x68581511UL;
   36|  52.2k|    c->h[6] = 0x64f98fa7UL;
   37|  52.2k|    c->h[7] = 0xbefa4fa4UL;
   38|  52.2k|    c->md_len = SHA224_DIGEST_LENGTH;
  ------------------
  |  |   85|  52.2k|# define SHA224_DIGEST_LENGTH    28
  ------------------
   39|  52.2k|    return 1;
   40|  52.2k|}
SHA256_Init:
   43|  21.9k|{
   44|  21.9k|    memset(c, 0, sizeof(*c));
   45|  21.9k|    c->h[0] = 0x6a09e667UL;
   46|  21.9k|    c->h[1] = 0xbb67ae85UL;
   47|  21.9k|    c->h[2] = 0x3c6ef372UL;
   48|  21.9k|    c->h[3] = 0xa54ff53aUL;
   49|  21.9k|    c->h[4] = 0x510e527fUL;
   50|  21.9k|    c->h[5] = 0x9b05688cUL;
   51|  21.9k|    c->h[6] = 0x1f83d9abUL;
   52|  21.9k|    c->h[7] = 0x5be0cd19UL;
   53|  21.9k|    c->md_len = SHA256_DIGEST_LENGTH;
  ------------------
  |  |   86|  21.9k|# define SHA256_DIGEST_LENGTH    32
  ------------------
   54|  21.9k|    return 1;
   55|  21.9k|}
SHA224_Update:
   65|  52.3k|{
   66|  52.3k|    return SHA256_Update(c, data, len);
   67|  52.3k|}
SHA224_Final:
   70|  52.2k|{
   71|  52.2k|    return SHA256_Final(md, c);
   72|  52.2k|}

ossl_sha3_reset:
   19|  13.3k|{
   20|       |#if defined(__s390x__) && defined(OPENSSL_CPUID_OBJ)
   21|       |    if (!(OPENSSL_s390xcap_P.stfle[1] & S390X_CAPBIT(S390X_MSA12)))
   22|       |#endif
   23|  13.3k|        memset(ctx->A, 0, sizeof(ctx->A));
   24|  13.3k|    ctx->bufsz = 0;
   25|  13.3k|    ctx->xof_state = XOF_STATE_INIT;
  ------------------
  |  |   35|  13.3k|#define XOF_STATE_INIT    0
  ------------------
   26|  13.3k|}
ossl_sha3_init:
   29|     60|{
   30|     60|    size_t bsz = SHA3_BLOCKSIZE(bitlen);
  ------------------
  |  |   21|     60|# define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8
  |  |  ------------------
  |  |  |  |   18|     60|# define KECCAK1600_WIDTH 1600
  |  |  ------------------
  ------------------
   31|       |
   32|     60|    if (bsz <= sizeof(ctx->buf)) {
  ------------------
  |  Branch (32:9): [True: 60, False: 0]
  ------------------
   33|     60|        ossl_sha3_reset(ctx);
   34|     60|        ctx->block_size = bsz;
   35|     60|        ctx->md_size = bitlen / 8;
   36|     60|        ctx->pad = pad;
   37|     60|        return 1;
   38|     60|    }
   39|       |
   40|      0|    return 0;
   41|     60|}
ossl_keccak_init:
   44|      3|{
   45|      3|    int ret = ossl_sha3_init(ctx, pad, bitlen);
   46|       |
   47|      3|    if (ret)
  ------------------
  |  Branch (47:9): [True: 3, False: 0]
  ------------------
   48|      3|        ctx->md_size = mdlen / 8;
   49|      3|    return ret;
   50|      3|}
ossl_sha3_final:
  104|  13.2k|{
  105|  13.2k|    size_t bsz = ctx->block_size;
  106|  13.2k|    size_t num = ctx->bufsz;
  107|       |
  108|  13.2k|    if (outlen == 0)
  ------------------
  |  Branch (108:9): [True: 0, False: 13.2k]
  ------------------
  109|      0|        return 1;
  110|  13.2k|    if (ctx->xof_state == XOF_STATE_SQUEEZE
  ------------------
  |  |   38|  26.5k|#define XOF_STATE_SQUEEZE 3
  ------------------
  |  Branch (110:9): [True: 0, False: 13.2k]
  ------------------
  111|  13.2k|        || ctx->xof_state == XOF_STATE_FINAL)
  ------------------
  |  |   37|  13.2k|#define XOF_STATE_FINAL   2
  ------------------
  |  Branch (111:12): [True: 0, False: 13.2k]
  ------------------
  112|      0|        return 0;
  113|       |
  114|       |    /*
  115|       |     * Pad the data with 10*1. Note that |num| can be |bsz - 1|
  116|       |     * in which case both byte operations below are performed on
  117|       |     * same byte...
  118|       |     */
  119|  13.2k|    memset(ctx->buf + num, 0, bsz - num);
  120|  13.2k|    ctx->buf[num] = ctx->pad;
  121|  13.2k|    ctx->buf[bsz - 1] |= 0x80;
  122|       |
  123|  13.2k|    (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
  124|       |
  125|  13.2k|    ctx->xof_state = XOF_STATE_FINAL;
  ------------------
  |  |   37|  13.2k|#define XOF_STATE_FINAL   2
  ------------------
  126|  13.2k|    SHA3_squeeze(ctx->A, out, outlen, bsz, 0);
  127|  13.2k|    return 1;
  128|  13.2k|}

sha512_224_init:
   79|  43.8k|{
   80|  43.8k|    c->h[0] = U64(0x8c3d37c819544da2);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   81|  43.8k|    c->h[1] = U64(0x73e1996689dcd4d6);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   82|  43.8k|    c->h[2] = U64(0x1dfab7ae32ff9c82);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   83|  43.8k|    c->h[3] = U64(0x679dd514582f9fcf);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   84|  43.8k|    c->h[4] = U64(0x0f6d2b697bd44da8);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   85|  43.8k|    c->h[5] = U64(0x77e36f7304c48942);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   86|  43.8k|    c->h[6] = U64(0x3f9d85a86a1d36c8);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   87|  43.8k|    c->h[7] = U64(0x1112e6ad91d692a1);
  ------------------
  |  |   75|  43.8k|# define U64(C)     C##ULL
  ------------------
   88|       |
   89|  43.8k|    c->Nl = 0;
   90|  43.8k|    c->Nh = 0;
   91|  43.8k|    c->num = 0;
   92|  43.8k|    c->md_len = SHA224_DIGEST_LENGTH;
  ------------------
  |  |   85|  43.8k|# define SHA224_DIGEST_LENGTH    28
  ------------------
   93|  43.8k|    return 1;
   94|  43.8k|}
sha512_256_init:
   97|  16.2k|{
   98|  16.2k|    c->h[0] = U64(0x22312194fc2bf72c);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
   99|  16.2k|    c->h[1] = U64(0x9f555fa3c84c64c2);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  100|  16.2k|    c->h[2] = U64(0x2393b86b6f53b151);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  101|  16.2k|    c->h[3] = U64(0x963877195940eabd);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  102|  16.2k|    c->h[4] = U64(0x96283ee2a88effe3);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  103|  16.2k|    c->h[5] = U64(0xbe5e1e2553863992);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  104|  16.2k|    c->h[6] = U64(0x2b0199fc2c85b8aa);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  105|  16.2k|    c->h[7] = U64(0x0eb72ddc81c52ca2);
  ------------------
  |  |   75|  16.2k|# define U64(C)     C##ULL
  ------------------
  106|       |
  107|  16.2k|    c->Nl = 0;
  108|  16.2k|    c->Nh = 0;
  109|  16.2k|    c->num = 0;
  110|  16.2k|    c->md_len = SHA256_DIGEST_LENGTH;
  ------------------
  |  |   86|  16.2k|# define SHA256_DIGEST_LENGTH    32
  ------------------
  111|  16.2k|    return 1;
  112|  16.2k|}
SHA384_Init:
  115|  81.0k|{
  116|  81.0k|    c->h[0] = U64(0xcbbb9d5dc1059ed8);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  117|  81.0k|    c->h[1] = U64(0x629a292a367cd507);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  118|  81.0k|    c->h[2] = U64(0x9159015a3070dd17);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  119|  81.0k|    c->h[3] = U64(0x152fecd8f70e5939);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  120|  81.0k|    c->h[4] = U64(0x67332667ffc00b31);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  121|  81.0k|    c->h[5] = U64(0x8eb44a8768581511);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  122|  81.0k|    c->h[6] = U64(0xdb0c2e0d64f98fa7);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  123|  81.0k|    c->h[7] = U64(0x47b5481dbefa4fa4);
  ------------------
  |  |   75|  81.0k|# define U64(C)     C##ULL
  ------------------
  124|       |
  125|  81.0k|    c->Nl = 0;
  126|  81.0k|    c->Nh = 0;
  127|  81.0k|    c->num = 0;
  128|  81.0k|    c->md_len = SHA384_DIGEST_LENGTH;
  ------------------
  |  |   87|  81.0k|# define SHA384_DIGEST_LENGTH    48
  ------------------
  129|  81.0k|    return 1;
  130|  81.0k|}
SHA512_Init:
  133|  3.62k|{
  134|  3.62k|    c->h[0] = U64(0x6a09e667f3bcc908);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  135|  3.62k|    c->h[1] = U64(0xbb67ae8584caa73b);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  136|  3.62k|    c->h[2] = U64(0x3c6ef372fe94f82b);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  137|  3.62k|    c->h[3] = U64(0xa54ff53a5f1d36f1);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  138|  3.62k|    c->h[4] = U64(0x510e527fade682d1);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  139|  3.62k|    c->h[5] = U64(0x9b05688c2b3e6c1f);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  140|  3.62k|    c->h[6] = U64(0x1f83d9abfb41bd6b);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  141|  3.62k|    c->h[7] = U64(0x5be0cd19137e2179);
  ------------------
  |  |   75|  3.62k|# define U64(C)     C##ULL
  ------------------
  142|       |
  143|  3.62k|    c->Nl = 0;
  144|  3.62k|    c->Nh = 0;
  145|  3.62k|    c->num = 0;
  146|  3.62k|    c->md_len = SHA512_DIGEST_LENGTH;
  ------------------
  |  |   88|  3.62k|# define SHA512_DIGEST_LENGTH    64
  ------------------
  147|  3.62k|    return 1;
  148|  3.62k|}
SHA512_Final:
  160|   144k|{
  161|   144k|    unsigned char *p = (unsigned char *)c->u.p;
  162|   144k|    size_t n = c->num;
  163|       |
  164|   144k|    p[n] = 0x80;                /* There always is a room for one */
  165|   144k|    n++;
  166|   144k|    if (n > (sizeof(c->u) - 16)) {
  ------------------
  |  Branch (166:9): [True: 7, False: 144k]
  ------------------
  167|      7|        memset(p + n, 0, sizeof(c->u) - n);
  168|      7|        n = 0;
  169|      7|        sha512_block_data_order(c, p, 1);
  170|      7|    }
  171|       |
  172|   144k|    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|   144k|    p[sizeof(c->u) - 1] = (unsigned char)(c->Nl);
  178|   144k|    p[sizeof(c->u) - 2] = (unsigned char)(c->Nl >> 8);
  179|   144k|    p[sizeof(c->u) - 3] = (unsigned char)(c->Nl >> 16);
  180|   144k|    p[sizeof(c->u) - 4] = (unsigned char)(c->Nl >> 24);
  181|   144k|    p[sizeof(c->u) - 5] = (unsigned char)(c->Nl >> 32);
  182|   144k|    p[sizeof(c->u) - 6] = (unsigned char)(c->Nl >> 40);
  183|   144k|    p[sizeof(c->u) - 7] = (unsigned char)(c->Nl >> 48);
  184|   144k|    p[sizeof(c->u) - 8] = (unsigned char)(c->Nl >> 56);
  185|   144k|    p[sizeof(c->u) - 9] = (unsigned char)(c->Nh);
  186|   144k|    p[sizeof(c->u) - 10] = (unsigned char)(c->Nh >> 8);
  187|   144k|    p[sizeof(c->u) - 11] = (unsigned char)(c->Nh >> 16);
  188|   144k|    p[sizeof(c->u) - 12] = (unsigned char)(c->Nh >> 24);
  189|   144k|    p[sizeof(c->u) - 13] = (unsigned char)(c->Nh >> 32);
  190|   144k|    p[sizeof(c->u) - 14] = (unsigned char)(c->Nh >> 40);
  191|   144k|    p[sizeof(c->u) - 15] = (unsigned char)(c->Nh >> 48);
  192|   144k|    p[sizeof(c->u) - 16] = (unsigned char)(c->Nh >> 56);
  193|   144k|#endif
  194|       |
  195|   144k|    sha512_block_data_order(c, p, 1);
  196|       |
  197|   144k|    if (md == 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 144k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|   144k|    switch (c->md_len) {
  201|       |    /* Let compiler decide if it's appropriate to unroll... */
  202|  43.8k|    case SHA224_DIGEST_LENGTH:
  ------------------
  |  |   85|  43.8k|# define SHA224_DIGEST_LENGTH    28
  ------------------
  |  Branch (202:5): [True: 43.8k, False: 100k]
  ------------------
  203|   175k|        for (n = 0; n < SHA224_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   85|   175k|# define SHA224_DIGEST_LENGTH    28
  ------------------
  |  Branch (203:21): [True: 131k, False: 43.8k]
  ------------------
  204|   131k|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|   131k|#   define SHA_LONG64 unsigned long long
  ------------------
  205|       |
  206|   131k|            *(md++) = (unsigned char)(t >> 56);
  207|   131k|            *(md++) = (unsigned char)(t >> 48);
  208|   131k|            *(md++) = (unsigned char)(t >> 40);
  209|   131k|            *(md++) = (unsigned char)(t >> 32);
  210|   131k|            *(md++) = (unsigned char)(t >> 24);
  211|   131k|            *(md++) = (unsigned char)(t >> 16);
  212|   131k|            *(md++) = (unsigned char)(t >> 8);
  213|   131k|            *(md++) = (unsigned char)(t);
  214|   131k|        }
  215|       |        /*
  216|       |         * For 224 bits, there are four bytes left over that have to be
  217|       |         * processed separately.
  218|       |         */
  219|  43.8k|        {
  220|  43.8k|            SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |  107|  43.8k|#   define SHA_LONG64 unsigned long long
  ------------------
                          SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |   85|  43.8k|# define SHA224_DIGEST_LENGTH    28
  ------------------
  221|       |
  222|  43.8k|            *(md++) = (unsigned char)(t >> 56);
  223|  43.8k|            *(md++) = (unsigned char)(t >> 48);
  224|  43.8k|            *(md++) = (unsigned char)(t >> 40);
  225|  43.8k|            *(md++) = (unsigned char)(t >> 32);
  226|  43.8k|        }
  227|  43.8k|        break;
  228|  16.2k|    case SHA256_DIGEST_LENGTH:
  ------------------
  |  |   86|  16.2k|# define SHA256_DIGEST_LENGTH    32
  ------------------
  |  Branch (228:5): [True: 16.2k, False: 128k]
  ------------------
  229|  81.2k|        for (n = 0; n < SHA256_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   86|  81.2k|# define SHA256_DIGEST_LENGTH    32
  ------------------
  |  Branch (229:21): [True: 64.9k, False: 16.2k]
  ------------------
  230|  64.9k|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|  64.9k|#   define SHA_LONG64 unsigned long long
  ------------------
  231|       |
  232|  64.9k|            *(md++) = (unsigned char)(t >> 56);
  233|  64.9k|            *(md++) = (unsigned char)(t >> 48);
  234|  64.9k|            *(md++) = (unsigned char)(t >> 40);
  235|  64.9k|            *(md++) = (unsigned char)(t >> 32);
  236|  64.9k|            *(md++) = (unsigned char)(t >> 24);
  237|  64.9k|            *(md++) = (unsigned char)(t >> 16);
  238|  64.9k|            *(md++) = (unsigned char)(t >> 8);
  239|  64.9k|            *(md++) = (unsigned char)(t);
  240|  64.9k|        }
  241|  16.2k|        break;
  242|  81.0k|    case SHA384_DIGEST_LENGTH:
  ------------------
  |  |   87|  81.0k|# define SHA384_DIGEST_LENGTH    48
  ------------------
  |  Branch (242:5): [True: 81.0k, False: 63.7k]
  ------------------
  243|   567k|        for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   87|   567k|# define SHA384_DIGEST_LENGTH    48
  ------------------
  |  Branch (243:21): [True: 486k, False: 81.0k]
  ------------------
  244|   486k|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|   486k|#   define SHA_LONG64 unsigned long long
  ------------------
  245|       |
  246|   486k|            *(md++) = (unsigned char)(t >> 56);
  247|   486k|            *(md++) = (unsigned char)(t >> 48);
  248|   486k|            *(md++) = (unsigned char)(t >> 40);
  249|   486k|            *(md++) = (unsigned char)(t >> 32);
  250|   486k|            *(md++) = (unsigned char)(t >> 24);
  251|   486k|            *(md++) = (unsigned char)(t >> 16);
  252|   486k|            *(md++) = (unsigned char)(t >> 8);
  253|   486k|            *(md++) = (unsigned char)(t);
  254|   486k|        }
  255|  81.0k|        break;
  256|  3.62k|    case SHA512_DIGEST_LENGTH:
  ------------------
  |  |   88|  3.62k|# define SHA512_DIGEST_LENGTH    64
  ------------------
  |  Branch (256:5): [True: 3.62k, False: 141k]
  ------------------
  257|  32.6k|        for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   88|  32.6k|# define SHA512_DIGEST_LENGTH    64
  ------------------
  |  Branch (257:21): [True: 29.0k, False: 3.62k]
  ------------------
  258|  29.0k|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|  29.0k|#   define SHA_LONG64 unsigned long long
  ------------------
  259|       |
  260|  29.0k|            *(md++) = (unsigned char)(t >> 56);
  261|  29.0k|            *(md++) = (unsigned char)(t >> 48);
  262|  29.0k|            *(md++) = (unsigned char)(t >> 40);
  263|  29.0k|            *(md++) = (unsigned char)(t >> 32);
  264|  29.0k|            *(md++) = (unsigned char)(t >> 24);
  265|  29.0k|            *(md++) = (unsigned char)(t >> 16);
  266|  29.0k|            *(md++) = (unsigned char)(t >> 8);
  267|  29.0k|            *(md++) = (unsigned char)(t);
  268|  29.0k|        }
  269|  3.62k|        break;
  270|       |    /* ... as well as make sure md_len is not abused. */
  271|      0|    default:
  ------------------
  |  Branch (271:5): [True: 0, False: 144k]
  ------------------
  272|      0|        return 0;
  273|   144k|    }
  274|       |
  275|   144k|    return 1;
  276|   144k|}
SHA384_Final:
  279|  81.0k|{
  280|  81.0k|    return SHA512_Final(md, c);
  281|  81.0k|}
SHA512_Update:
  284|   144k|{
  285|   144k|    SHA_LONG64 l;
  ------------------
  |  |  107|   144k|#   define SHA_LONG64 unsigned long long
  ------------------
  286|   144k|    unsigned char *p = c->u.p;
  287|   144k|    const unsigned char *data = (const unsigned char *)_data;
  288|       |
  289|   144k|    if (len == 0)
  ------------------
  |  Branch (289:9): [True: 0, False: 144k]
  ------------------
  290|      0|        return 1;
  291|       |
  292|   144k|    l = (c->Nl + (((SHA_LONG64) len) << 3)) & U64(0xffffffffffffffff);
  ------------------
  |  |   75|   144k|# define U64(C)     C##ULL
  ------------------
  293|   144k|    if (l < c->Nl)
  ------------------
  |  Branch (293:9): [True: 0, False: 144k]
  ------------------
  294|      0|        c->Nh++;
  295|   144k|    if (sizeof(len) >= 8)
  ------------------
  |  Branch (295:9): [Folded - Ignored]
  ------------------
  296|   144k|        c->Nh += (((SHA_LONG64) len) >> 61);
  297|   144k|    c->Nl = l;
  298|       |
  299|   144k|    if (c->num != 0) {
  ------------------
  |  Branch (299:9): [True: 0, False: 144k]
  ------------------
  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|   144k|    if (len >= sizeof(c->u)) {
  ------------------
  |  Branch (312:9): [True: 74, False: 144k]
  ------------------
  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|     74|            sha512_block_data_order(c, data, len / sizeof(c->u)),
  322|     74|            data += len, len %= sizeof(c->u), data -= len;
  323|     74|    }
  324|       |
  325|   144k|    if (len != 0)
  ------------------
  |  Branch (325:9): [True: 144k, False: 20]
  ------------------
  326|   144k|        memcpy(p, data, len), c->num = (int)len;
  327|       |
  328|   144k|    return 1;
  329|   144k|}
SHA384_Update:
  332|  81.0k|{
  333|  81.0k|    return SHA512_Update(c, data, len);
  334|  81.0k|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

OSSL_STACK_OF_X509_free:
   21|  85.1k|{
   22|  85.1k|    sk_X509_pop_free(certs, X509_free);
  ------------------
  |  |   93|  85.1k|#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk), ossl_check_X509_freefunc_type(freefunc))
  ------------------
   23|  85.1k|}
X509_print_ex:
   55|  2.93k|{
   56|  2.93k|    long l;
   57|  2.93k|    int ret = 0;
   58|  2.93k|    char mlch = ' ';
   59|  2.93k|    int nmindent = 0, printok = 0;
   60|  2.93k|    EVP_PKEY *pkey = NULL;
   61|       |
   62|  2.93k|    if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
  ------------------
  |  |  317|  2.93k|# define XN_FLAG_SEP_MASK        (0xf << 16)
  ------------------
                  if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
  ------------------
  |  |  323|  2.93k|# define XN_FLAG_SEP_MULTILINE   (4 << 16)/* One line per field */
  ------------------
  |  Branch (62:9): [True: 0, False: 2.93k]
  ------------------
   63|      0|        mlch = '\n';
   64|      0|        nmindent = 12;
   65|      0|    }
   66|       |
   67|  2.93k|    if (nmflags == XN_FLAG_COMPAT)
  ------------------
  |  |  319|  2.93k|# define XN_FLAG_COMPAT          0/* Traditional; use old X509_NAME_print */
  ------------------
  |  Branch (67:9): [True: 0, False: 2.93k]
  ------------------
   68|      0|        printok = 1;
   69|       |
   70|  2.93k|    if (!(cflag & X509_FLAG_NO_HEADER)) {
  ------------------
  |  |  298|  2.93k|# define X509_FLAG_NO_HEADER             1L
  ------------------
  |  Branch (70:9): [True: 0, False: 2.93k]
  ------------------
   71|      0|        if (BIO_write(bp, "Certificate:\n", 13) <= 0)
  ------------------
  |  Branch (71:13): [True: 0, False: 0]
  ------------------
   72|      0|            goto err;
   73|      0|        if (BIO_write(bp, "    Data:\n", 10) <= 0)
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  ------------------
   74|      0|            goto err;
   75|      0|    }
   76|  2.93k|    if (!(cflag & X509_FLAG_NO_VERSION)) {
  ------------------
  |  |  299|  2.93k|# define X509_FLAG_NO_VERSION            (1L << 1)
  ------------------
  |  Branch (76:9): [True: 0, False: 2.93k]
  ------------------
   77|      0|        l = X509_get_version(x);
   78|      0|        if (l >= X509_VERSION_1 && l <= X509_VERSION_3) {
  ------------------
  |  |  848|      0|#define X509_VERSION_1 0
  ------------------
                      if (l >= X509_VERSION_1 && l <= X509_VERSION_3) {
  ------------------
  |  |  850|      0|#define X509_VERSION_3 2
  ------------------
  |  Branch (78:13): [True: 0, False: 0]
  |  Branch (78:36): [True: 0, False: 0]
  ------------------
   79|      0|            if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, (unsigned long)l) <= 0)
  ------------------
  |  Branch (79:17): [True: 0, False: 0]
  ------------------
   80|      0|                goto err;
   81|      0|        } else {
   82|      0|            if (BIO_printf(bp, "%8sVersion: Unknown (%ld)\n", "", l) <= 0)
  ------------------
  |  Branch (82:17): [True: 0, False: 0]
  ------------------
   83|      0|                goto err;
   84|      0|        }
   85|      0|    }
   86|  2.93k|    if (!(cflag & X509_FLAG_NO_SERIAL)) {
  ------------------
  |  |  300|  2.93k|# define X509_FLAG_NO_SERIAL             (1L << 2)
  ------------------
  |  Branch (86:9): [True: 742, False: 2.19k]
  ------------------
   87|    742|        const ASN1_INTEGER *bs = X509_get0_serialNumber(x);
   88|       |
   89|    742|        if (BIO_write(bp, "        Serial Number:", 22) <= 0)
  ------------------
  |  Branch (89:13): [True: 0, False: 742]
  ------------------
   90|      0|            goto err;
   91|    742|        if (ossl_serial_number_print(bp, bs, 12) != 0)
  ------------------
  |  Branch (91:13): [True: 0, False: 742]
  ------------------
   92|      0|            goto err;
   93|    742|        if (BIO_puts(bp, "\n") <= 0)
  ------------------
  |  Branch (93:13): [True: 0, False: 742]
  ------------------
   94|      0|            goto err;
   95|    742|    }
   96|       |
   97|  2.93k|    if (!(cflag & X509_FLAG_NO_SIGNAME)) {
  ------------------
  |  |  301|  2.93k|# define X509_FLAG_NO_SIGNAME            (1L << 3)
  ------------------
  |  Branch (97:9): [True: 0, False: 2.93k]
  ------------------
   98|      0|        const X509_ALGOR *tsig_alg = X509_get0_tbs_sigalg(x);
   99|       |
  100|      0|        if (BIO_puts(bp, "    ") <= 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            goto err;
  102|      0|        if (X509_signature_print(bp, tsig_alg, NULL) <= 0)
  ------------------
  |  Branch (102:13): [True: 0, False: 0]
  ------------------
  103|      0|            goto err;
  104|      0|    }
  105|       |
  106|  2.93k|    if (!(cflag & X509_FLAG_NO_ISSUER)) {
  ------------------
  |  |  302|  2.93k|# define X509_FLAG_NO_ISSUER             (1L << 4)
  ------------------
  |  Branch (106:9): [True: 711, False: 2.22k]
  ------------------
  107|    711|        if (BIO_printf(bp, "        Issuer:%c", mlch) <= 0)
  ------------------
  |  Branch (107:13): [True: 0, False: 711]
  ------------------
  108|      0|            goto err;
  109|    711|        if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags)
  ------------------
  |  Branch (109:13): [True: 0, False: 711]
  ------------------
  110|    711|            < printok)
  111|      0|            goto err;
  112|    711|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (112:13): [True: 0, False: 711]
  ------------------
  113|      0|            goto err;
  114|    711|    }
  115|  2.93k|    if (!(cflag & X509_FLAG_NO_VALIDITY)) {
  ------------------
  |  |  303|  2.93k|# define X509_FLAG_NO_VALIDITY           (1L << 5)
  ------------------
  |  Branch (115:9): [True: 742, False: 2.19k]
  ------------------
  116|    742|        if (BIO_write(bp, "        Validity\n", 17) <= 0)
  ------------------
  |  Branch (116:13): [True: 0, False: 742]
  ------------------
  117|      0|            goto err;
  118|    742|        if (BIO_write(bp, "            Not Before: ", 24) <= 0)
  ------------------
  |  Branch (118:13): [True: 0, False: 742]
  ------------------
  119|      0|            goto err;
  120|    742|        if (ossl_asn1_time_print_ex(bp, X509_get0_notBefore(x), ASN1_DTFLGS_RFC822) == 0)
  ------------------
  |  |  447|    742|# define ASN1_DTFLGS_RFC822       0x00UL
  ------------------
  |  Branch (120:13): [True: 0, False: 742]
  ------------------
  121|      0|            goto err;
  122|    742|        if (BIO_write(bp, "\n            Not After : ", 25) <= 0)
  ------------------
  |  Branch (122:13): [True: 0, False: 742]
  ------------------
  123|      0|            goto err;
  124|    742|        if (ossl_asn1_time_print_ex(bp, X509_get0_notAfter(x), ASN1_DTFLGS_RFC822) == 0)
  ------------------
  |  |  447|    742|# define ASN1_DTFLGS_RFC822       0x00UL
  ------------------
  |  Branch (124:13): [True: 0, False: 742]
  ------------------
  125|      0|            goto err;
  126|    742|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (126:13): [True: 0, False: 742]
  ------------------
  127|      0|            goto err;
  128|    742|    }
  129|  2.93k|    if (!(cflag & X509_FLAG_NO_SUBJECT)) {
  ------------------
  |  |  304|  2.93k|# define X509_FLAG_NO_SUBJECT            (1L << 6)
  ------------------
  |  Branch (129:9): [True: 742, False: 2.19k]
  ------------------
  130|    742|        if (BIO_printf(bp, "        Subject:%c", mlch) <= 0)
  ------------------
  |  Branch (130:13): [True: 0, False: 742]
  ------------------
  131|      0|            goto err;
  132|    742|        if (X509_NAME_print_ex
  ------------------
  |  Branch (132:13): [True: 0, False: 742]
  ------------------
  133|    742|            (bp, X509_get_subject_name(x), nmindent, nmflags) < printok)
  134|      0|            goto err;
  135|    742|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (135:13): [True: 0, False: 742]
  ------------------
  136|      0|            goto err;
  137|    742|    }
  138|  2.93k|    if (!(cflag & X509_FLAG_NO_PUBKEY)) {
  ------------------
  |  |  305|  2.93k|# define X509_FLAG_NO_PUBKEY             (1L << 7)
  ------------------
  |  Branch (138:9): [True: 0, False: 2.93k]
  ------------------
  139|      0|        X509_PUBKEY *xpkey = X509_get_X509_PUBKEY(x);
  140|      0|        ASN1_OBJECT *xpoid;
  141|      0|        X509_PUBKEY_get0_param(&xpoid, NULL, NULL, NULL, xpkey);
  142|      0|        if (BIO_write(bp, "        Subject Public Key Info:\n", 33) <= 0)
  ------------------
  |  Branch (142:13): [True: 0, False: 0]
  ------------------
  143|      0|            goto err;
  144|      0|        if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0)
  ------------------
  |  Branch (144:13): [True: 0, False: 0]
  ------------------
  145|      0|            goto err;
  146|      0|        if (i2a_ASN1_OBJECT(bp, xpoid) <= 0)
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  ------------------
  147|      0|            goto err;
  148|      0|        if (BIO_puts(bp, "\n") <= 0)
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            goto err;
  150|       |
  151|      0|        pkey = X509_get0_pubkey(x);
  152|      0|        if (pkey == NULL) {
  ------------------
  |  Branch (152:13): [True: 0, False: 0]
  ------------------
  153|      0|            BIO_printf(bp, "%12sUnable to load Public Key\n", "");
  154|      0|            ERR_print_errors(bp);
  155|      0|        } else {
  156|      0|            EVP_PKEY_print_public(bp, pkey, 16, NULL);
  157|      0|        }
  158|      0|    }
  159|       |
  160|  2.93k|    if (!(cflag & X509_FLAG_NO_IDS)) {
  ------------------
  |  |  310|  2.93k|# define X509_FLAG_NO_IDS                (1L << 12)
  ------------------
  |  Branch (160:9): [True: 0, False: 2.93k]
  ------------------
  161|      0|        const ASN1_BIT_STRING *iuid, *suid;
  162|      0|        X509_get0_uids(x, &iuid, &suid);
  163|      0|        if (iuid != NULL) {
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|            if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0)
  ------------------
  |  Branch (164:17): [True: 0, False: 0]
  ------------------
  165|      0|                goto err;
  166|      0|            if (!X509_signature_dump(bp, iuid, 12))
  ------------------
  |  Branch (166:17): [True: 0, False: 0]
  ------------------
  167|      0|                goto err;
  168|      0|        }
  169|      0|        if (suid != NULL) {
  ------------------
  |  Branch (169:13): [True: 0, False: 0]
  ------------------
  170|      0|            if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0)
  ------------------
  |  Branch (170:17): [True: 0, False: 0]
  ------------------
  171|      0|                goto err;
  172|      0|            if (!X509_signature_dump(bp, suid, 12))
  ------------------
  |  Branch (172:17): [True: 0, False: 0]
  ------------------
  173|      0|                goto err;
  174|      0|        }
  175|      0|    }
  176|       |
  177|  2.93k|    if (!(cflag & X509_FLAG_NO_EXTENSIONS)
  ------------------
  |  |  306|  2.93k|# define X509_FLAG_NO_EXTENSIONS         (1L << 8)
  ------------------
  |  Branch (177:9): [True: 742, False: 2.19k]
  ------------------
  178|  2.93k|        && !X509V3_extensions_print(bp, "X509v3 extensions",
  ------------------
  |  Branch (178:12): [True: 0, False: 742]
  ------------------
  179|    742|                                    X509_get0_extensions(x), cflag, 8))
  180|      0|        goto err;
  181|       |
  182|  2.93k|    if (!(cflag & X509_FLAG_NO_SIGDUMP)) {
  ------------------
  |  |  307|  2.93k|# define X509_FLAG_NO_SIGDUMP            (1L << 9)
  ------------------
  |  Branch (182:9): [True: 0, False: 2.93k]
  ------------------
  183|      0|        const X509_ALGOR *sig_alg;
  184|      0|        const ASN1_BIT_STRING *sig;
  185|      0|        X509_get0_signature(&sig, &sig_alg, x);
  186|      0|        if (X509_signature_print(bp, sig_alg, sig) <= 0)
  ------------------
  |  Branch (186:13): [True: 0, False: 0]
  ------------------
  187|      0|            goto err;
  188|      0|    }
  189|  2.93k|    if (!(cflag & X509_FLAG_NO_AUX)) {
  ------------------
  |  |  308|  2.93k|# define X509_FLAG_NO_AUX                (1L << 10)
  ------------------
  |  Branch (189:9): [True: 0, False: 2.93k]
  ------------------
  190|      0|        if (!X509_aux_print(bp, x, 0))
  ------------------
  |  Branch (190:13): [True: 0, False: 0]
  ------------------
  191|      0|            goto err;
  192|      0|    }
  193|  2.93k|    ret = 1;
  194|  2.93k| err:
  195|  2.93k|    return ret;
  196|  2.93k|}
ossl_x509_print_ex_brief:
  375|    742|{
  376|    742|    unsigned long flags = ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE |
  ------------------
  |  |  516|    742|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  ------------------
  |  |  |  |  441|    742|# define ASN1_STRFLGS_ESC_2253           1
  |  |  ------------------
  |  |  517|    742|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  ------------------
  |  |  |  |  442|    742|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  ------------------
  |  |  518|    742|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  ------------------
  |  |  |  |  443|    742|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  ------------------
  |  |  519|    742|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  ------------------
  |  |  |  |  475|    742|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  ------------------
  |  |  520|    742|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  ------------------
  |  |  |  |  497|    742|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  ------------------
  |  |  521|    742|                                ASN1_STRFLGS_DUMP_DER)
  |  |  ------------------
  |  |  |  |  504|    742|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  ------------------
  ------------------
                  unsigned long flags = ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE |
  ------------------
  |  |  455|    742|# define ASN1_STRFLGS_ESC_QUOTE          8
  ------------------
  377|    742|        XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_FN_SN;
  ------------------
  |  |  321|    742|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  ------------------
                      XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_FN_SN;
  ------------------
  |  |  331|    742|# define XN_FLAG_FN_SN           0/* Object short name */
  ------------------
  378|       |
  379|    742|    if (cert == NULL)
  ------------------
  |  Branch (379:9): [True: 0, False: 742]
  ------------------
  380|      0|        return BIO_printf(bio, "    (no certificate)\n") > 0;
  381|    742|    if (BIO_printf(bio, "    certificate\n") <= 0
  ------------------
  |  Branch (381:9): [True: 0, False: 742]
  ------------------
  382|    742|            || !X509_print_ex(bio, cert, flags, ~X509_FLAG_NO_SUBJECT))
  ------------------
  |  |  304|    742|# define X509_FLAG_NO_SUBJECT            (1L << 6)
  ------------------
  |  Branch (382:16): [True: 0, False: 742]
  ------------------
  383|      0|        return 0;
  384|    742|    if (X509_check_issued((X509 *)cert, cert) == X509_V_OK) {
  ------------------
  |  |  303|    742|# define X509_V_OK                                       0
  ------------------
  |  Branch (384:9): [True: 31, False: 711]
  ------------------
  385|     31|        if (BIO_printf(bio, "        self-issued\n") <= 0)
  ------------------
  |  Branch (385:13): [True: 0, False: 31]
  ------------------
  386|      0|            return 0;
  387|    711|    } else {
  388|    711|        if (BIO_printf(bio, " ") <= 0
  ------------------
  |  Branch (388:13): [True: 0, False: 711]
  ------------------
  389|    711|            || !X509_print_ex(bio, cert, flags, ~X509_FLAG_NO_ISSUER))
  ------------------
  |  |  302|    711|# define X509_FLAG_NO_ISSUER             (1L << 4)
  ------------------
  |  Branch (389:16): [True: 0, False: 711]
  ------------------
  390|      0|            return 0;
  391|    711|    }
  392|    742|    if (!X509_print_ex(bio, cert, flags,
  ------------------
  |  Branch (392:9): [True: 0, False: 742]
  ------------------
  393|    742|                       ~(X509_FLAG_NO_SERIAL | X509_FLAG_NO_VALIDITY)))
  ------------------
  |  |  300|    742|# define X509_FLAG_NO_SERIAL             (1L << 2)
  ------------------
                                     ~(X509_FLAG_NO_SERIAL | X509_FLAG_NO_VALIDITY)))
  ------------------
  |  |  303|    742|# define X509_FLAG_NO_VALIDITY           (1L << 5)
  ------------------
  394|      0|        return 0;
  395|    742|    if (X509_cmp_current_time(X509_get0_notBefore(cert)) > 0)
  ------------------
  |  Branch (395:9): [True: 52, False: 690]
  ------------------
  396|     52|        if (BIO_printf(bio, "        not yet valid\n") <= 0)
  ------------------
  |  Branch (396:13): [True: 0, False: 52]
  ------------------
  397|      0|            return 0;
  398|    742|    if (X509_cmp_current_time(X509_get0_notAfter(cert)) < 0)
  ------------------
  |  Branch (398:9): [True: 79, False: 663]
  ------------------
  399|     79|        if (BIO_printf(bio, "        no more valid\n") <= 0)
  ------------------
  |  Branch (399:13): [True: 0, False: 79]
  ------------------
  400|      0|            return 0;
  401|    742|    return X509_print_ex(bio, cert, flags,
  402|    742|                         ~neg_cflags & ~X509_FLAG_EXTENSIONS_ONLY_KID);
  ------------------
  |  |  311|    742|# define X509_FLAG_EXTENSIONS_ONLY_KID   (1L << 13)
  ------------------
  403|    742|}
ossl_serial_number_print:
  512|    742|{
  513|    742|    int i, ok;
  514|    742|    int64_t l;
  515|    742|    uint64_t ul;
  516|    742|    const char *neg;
  517|       |
  518|    742|    if (bs->length == 0) {
  ------------------
  |  Branch (518:9): [True: 0, False: 742]
  ------------------
  519|      0|        if (BIO_puts(out, " (Empty)") <= 0)
  ------------------
  |  Branch (519:13): [True: 0, False: 0]
  ------------------
  520|      0|            return -1;
  521|      0|        return 0;
  522|      0|    }
  523|       |
  524|    742|    ERR_set_mark();
  525|    742|    ok = ASN1_INTEGER_get_int64(&l, bs);
  526|    742|    ERR_pop_to_mark();
  527|       |
  528|    742|    if (ok) { /* Reading an int64_t succeeded: print decimal and hex. */
  ------------------
  |  Branch (528:9): [True: 742, False: 0]
  ------------------
  529|    742|        if (bs->type == V_ASN1_NEG_INTEGER) {
  ------------------
  |  |   98|    742|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|    742|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (529:13): [True: 110, False: 632]
  ------------------
  530|    110|            ul = 0 - (uint64_t)l;
  531|    110|            neg = "-";
  532|    632|        } else {
  533|    632|            ul = l;
  534|    632|            neg = "";
  535|    632|        }
  536|    742|        if (BIO_printf(out, " %s%ju (%s0x%jx)", neg, ul, neg, ul) <= 0)
  ------------------
  |  Branch (536:13): [True: 0, False: 742]
  ------------------
  537|      0|            return -1;
  538|    742|    } else { /* Reading an int64_t failed: just print hex. */
  539|      0|        neg = (bs->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : "";
  ------------------
  |  |   98|      0|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|      0|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (539:15): [True: 0, False: 0]
  ------------------
  540|      0|        if (BIO_printf(out, "\n%*s%s", indent, "", neg) <= 0)
  ------------------
  |  Branch (540:13): [True: 0, False: 0]
  ------------------
  541|      0|            return -1;
  542|       |
  543|      0|        for (i = 0; i < bs->length - 1; i++) {
  ------------------
  |  Branch (543:21): [True: 0, False: 0]
  ------------------
  544|      0|            if (BIO_printf(out, "%02x%c", bs->data[i], ':') <= 0)
  ------------------
  |  Branch (544:17): [True: 0, False: 0]
  ------------------
  545|      0|                return -1;
  546|      0|        }
  547|      0|        if (BIO_printf(out, "%02x", bs->data[i]) <= 0)
  ------------------
  |  Branch (547:13): [True: 0, False: 0]
  ------------------
  548|      0|            return -1;
  549|      0|    }
  550|    742|    return 0;
  551|    742|}

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

v3_ac_tgt.c:i2r_TARGETING_INFORMATION:
  222|     19|{
  223|     19|    int i;
  224|     19|    OSSL_TARGETS *targets;
  225|       |
  226|     34|    for (i = 0; i < sk_OSSL_TARGETS_num(tinfo); i++) {
  ------------------
  |  |  232|     34|#define sk_OSSL_TARGETS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGETS_sk_type(sk))
  ------------------
  |  Branch (226:17): [True: 15, False: 19]
  ------------------
  227|     15|        BIO_printf(out, "%*sTargets:\n", indent, "");
  228|     15|        targets = sk_OSSL_TARGETS_value(tinfo, i);
  ------------------
  |  |  233|     15|#define sk_OSSL_TARGETS_value(sk, idx) ((OSSL_TARGETS *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGETS_sk_type(sk), (idx)))
  ------------------
  229|     15|        i2r_TARGETS(method, targets, out, indent + 2);
  230|     15|    }
  231|     19|    return 1;
  232|     19|}
v3_ac_tgt.c:i2r_TARGETS:
  207|     15|{
  208|     15|    int i;
  209|     15|    OSSL_TARGET *target;
  210|       |
  211|     24|    for (i = 0; i < sk_OSSL_TARGET_num(targets); i++) {
  ------------------
  |  |  204|     24|#define sk_OSSL_TARGET_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGET_sk_type(sk))
  ------------------
  |  Branch (211:17): [True: 9, False: 15]
  ------------------
  212|      9|        BIO_printf(out, "%*sTarget:\n", indent, "");
  213|      9|        target = sk_OSSL_TARGET_value(targets, i);
  ------------------
  |  |  205|      9|#define sk_OSSL_TARGET_value(sk, idx) ((OSSL_TARGET *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGET_sk_type(sk), (idx)))
  ------------------
  214|      9|        i2r_TARGET(method, target, out, indent + 2);
  215|      9|    }
  216|     15|    return 1;
  217|     15|}
v3_ac_tgt.c:i2r_TARGET:
  184|      9|{
  185|      9|    switch (target->type) {
  ------------------
  |  Branch (185:13): [True: 0, False: 9]
  ------------------
  186|      3|    case OSSL_TGT_TARGET_NAME:
  ------------------
  |  |  187|      3|# define OSSL_TGT_TARGET_NAME  0
  ------------------
  |  Branch (186:5): [True: 3, False: 6]
  ------------------
  187|      3|        BIO_printf(out, "%*sTarget Name: ", indent, "");
  188|      3|        GENERAL_NAME_print(out, target->choice.targetName);
  189|      3|        BIO_puts(out, "\n");
  190|      3|        break;
  191|      6|    case OSSL_TGT_TARGET_GROUP:
  ------------------
  |  |  188|      6|# define OSSL_TGT_TARGET_GROUP 1
  ------------------
  |  Branch (191:5): [True: 6, False: 3]
  ------------------
  192|      6|        BIO_printf(out, "%*sTarget Group: ", indent, "");
  193|      6|        GENERAL_NAME_print(out, target->choice.targetGroup);
  194|      6|        BIO_puts(out, "\n");
  195|      6|        break;
  196|      0|    case OSSL_TGT_TARGET_CERT:
  ------------------
  |  |  189|      0|# define OSSL_TGT_TARGET_CERT  2
  ------------------
  |  Branch (196:5): [True: 0, False: 9]
  ------------------
  197|      0|        BIO_printf(out, "%*sTarget Cert:\n", indent, "");
  198|      0|        i2r_TARGET_CERT(method, target->choice.targetCert, out, indent + 2);
  199|      0|        break;
  200|      9|    }
  201|      9|    return 1;
  202|      9|}

v3_addr.c:i2r_IPAddrBlocks:
  207|      3|{
  208|      3|    const IPAddrBlocks *addr = ext;
  209|      3|    int i;
  210|       |
  211|      3|    for (i = 0; i < sk_IPAddressFamily_num(addr); i++) {
  ------------------
  |  | 1222|      3|#define sk_IPAddressFamily_num(sk) OPENSSL_sk_num(ossl_check_const_IPAddressFamily_sk_type(sk))
  ------------------
  |  Branch (211:17): [True: 0, False: 3]
  ------------------
  212|      0|        IPAddressFamily *f = sk_IPAddressFamily_value(addr, i);
  ------------------
  |  | 1223|      0|#define sk_IPAddressFamily_value(sk, idx) ((IPAddressFamily *)OPENSSL_sk_value(ossl_check_const_IPAddressFamily_sk_type(sk), (idx)))
  ------------------
  213|      0|        const unsigned int afi = X509v3_addr_get_afi(f);
  214|       |
  215|      0|        switch (afi) {
  216|      0|        case IANA_AFI_IPV4:
  ------------------
  |  | 1269|      0|# define IANA_AFI_IPV4   1
  ------------------
  |  Branch (216:9): [True: 0, False: 0]
  ------------------
  217|      0|            BIO_printf(out, "%*sIPv4", indent, "");
  218|      0|            break;
  219|      0|        case IANA_AFI_IPV6:
  ------------------
  |  | 1270|      0|# define IANA_AFI_IPV6   2
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|            BIO_printf(out, "%*sIPv6", indent, "");
  221|      0|            break;
  222|      0|        default:
  ------------------
  |  Branch (222:9): [True: 0, False: 0]
  ------------------
  223|      0|            BIO_printf(out, "%*sUnknown AFI %u", indent, "", afi);
  224|      0|            break;
  225|      0|        }
  226|      0|        if (f->addressFamily->length > 2) {
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|            switch (f->addressFamily->data[2]) {
  228|      0|            case 1:
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|                BIO_puts(out, " (Unicast)");
  230|      0|                break;
  231|      0|            case 2:
  ------------------
  |  Branch (231:13): [True: 0, False: 0]
  ------------------
  232|      0|                BIO_puts(out, " (Multicast)");
  233|      0|                break;
  234|      0|            case 3:
  ------------------
  |  Branch (234:13): [True: 0, False: 0]
  ------------------
  235|      0|                BIO_puts(out, " (Unicast/Multicast)");
  236|      0|                break;
  237|      0|            case 4:
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|                BIO_puts(out, " (MPLS)");
  239|      0|                break;
  240|      0|            case 64:
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|                BIO_puts(out, " (Tunnel)");
  242|      0|                break;
  243|      0|            case 65:
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|                BIO_puts(out, " (VPLS)");
  245|      0|                break;
  246|      0|            case 66:
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|                BIO_puts(out, " (BGP MDT)");
  248|      0|                break;
  249|      0|            case 128:
  ------------------
  |  Branch (249:13): [True: 0, False: 0]
  ------------------
  250|      0|                BIO_puts(out, " (MPLS-labeled VPN)");
  251|      0|                break;
  252|      0|            default:
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|                BIO_printf(out, " (Unknown SAFI %u)",
  254|      0|                           (unsigned)f->addressFamily->data[2]);
  255|      0|                break;
  256|      0|            }
  257|      0|        }
  258|      0|        switch (f->ipAddressChoice->type) {
  ------------------
  |  Branch (258:17): [True: 0, False: 0]
  ------------------
  259|      0|        case IPAddressChoice_inherit:
  ------------------
  |  | 1205|      0|# define IPAddressChoice_inherit                 0
  ------------------
  |  Branch (259:9): [True: 0, False: 0]
  ------------------
  260|      0|            BIO_puts(out, ": inherit\n");
  261|      0|            break;
  262|      0|        case IPAddressChoice_addressesOrRanges:
  ------------------
  |  | 1206|      0|# define IPAddressChoice_addressesOrRanges       1
  ------------------
  |  Branch (262:9): [True: 0, False: 0]
  ------------------
  263|      0|            BIO_puts(out, ":\n");
  264|      0|            if (!i2r_IPAddressOrRanges(out,
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                                       indent + 2,
  266|      0|                                       f->ipAddressChoice->
  267|      0|                                       u.addressesOrRanges, afi))
  268|      0|                return 0;
  269|      0|            break;
  270|      0|        }
  271|      0|    }
  272|      3|    return 1;
  273|      3|}

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

v3_asid.c:i2r_ASIdentifiers:
  112|      3|{
  113|      3|    ASIdentifiers *asid = ext;
  114|      3|    return (i2r_ASIdentifierChoice(out, asid->asnum, indent,
  ------------------
  |  Branch (114:13): [True: 3, False: 0]
  ------------------
  115|      3|                                   "Autonomous System Numbers") &&
  116|      3|            i2r_ASIdentifierChoice(out, asid->rdi, indent,
  ------------------
  |  Branch (116:13): [True: 3, False: 0]
  ------------------
  117|      3|                                   "Routing Domain Identifiers"));
  118|      3|}
v3_asid.c:i2r_ASIdentifierChoice:
   65|      6|{
   66|      6|    int i;
   67|      6|    char *s;
   68|      6|    if (choice == NULL)
  ------------------
  |  Branch (68:9): [True: 6, False: 0]
  ------------------
   69|      6|        return 1;
   70|      0|    BIO_printf(out, "%*s%s:\n", indent, "", msg);
   71|      0|    switch (choice->type) {
   72|      0|    case ASIdentifierChoice_inherit:
  ------------------
  |  | 1140|      0|# define ASIdentifierChoice_inherit              0
  ------------------
  |  Branch (72:5): [True: 0, False: 0]
  ------------------
   73|      0|        BIO_printf(out, "%*sinherit\n", indent + 2, "");
   74|      0|        break;
   75|      0|    case ASIdentifierChoice_asIdsOrRanges:
  ------------------
  |  | 1141|      0|# define ASIdentifierChoice_asIdsOrRanges        1
  ------------------
  |  Branch (75:5): [True: 0, False: 0]
  ------------------
   76|      0|        for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges); i++) {
  ------------------
  |  | 1111|      0|#define sk_ASIdOrRange_num(sk) OPENSSL_sk_num(ossl_check_const_ASIdOrRange_sk_type(sk))
  ------------------
  |  Branch (76:21): [True: 0, False: 0]
  ------------------
   77|      0|            ASIdOrRange *aor =
   78|      0|                sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
  ------------------
  |  | 1112|      0|#define sk_ASIdOrRange_value(sk, idx) ((ASIdOrRange *)OPENSSL_sk_value(ossl_check_const_ASIdOrRange_sk_type(sk), (idx)))
  ------------------
   79|      0|            switch (aor->type) {
   80|      0|            case ASIdOrRange_id:
  ------------------
  |  | 1099|      0|# define ASIdOrRange_id          0
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|                if ((s = i2s_ASN1_INTEGER(NULL, aor->u.id)) == NULL)
  ------------------
  |  Branch (81:21): [True: 0, False: 0]
  ------------------
   82|      0|                    return 0;
   83|      0|                BIO_printf(out, "%*s%s\n", indent + 2, "", s);
   84|      0|                OPENSSL_free(s);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|      0|                break;
   86|      0|            case ASIdOrRange_range:
  ------------------
  |  | 1100|      0|# define ASIdOrRange_range       1
  ------------------
  |  Branch (86:13): [True: 0, False: 0]
  ------------------
   87|      0|                if ((s = i2s_ASN1_INTEGER(NULL, aor->u.range->min)) == NULL)
  ------------------
  |  Branch (87:21): [True: 0, False: 0]
  ------------------
   88|      0|                    return 0;
   89|      0|                BIO_printf(out, "%*s%s-", indent + 2, "", s);
   90|      0|                OPENSSL_free(s);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   91|      0|                if ((s = i2s_ASN1_INTEGER(NULL, aor->u.range->max)) == NULL)
  ------------------
  |  Branch (91:21): [True: 0, False: 0]
  ------------------
   92|      0|                    return 0;
   93|      0|                BIO_printf(out, "%s\n", s);
   94|      0|                OPENSSL_free(s);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|      0|                break;
   96|      0|            default:
  ------------------
  |  Branch (96:13): [True: 0, False: 0]
  ------------------
   97|      0|                return 0;
   98|      0|            }
   99|      0|        }
  100|      0|        break;
  101|      0|    default:
  ------------------
  |  Branch (101:5): [True: 0, False: 0]
  ------------------
  102|      0|        return 0;
  103|      0|    }
  104|      0|    return 1;
  105|      0|}

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

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

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

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

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

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

v3_crld.c:dpn_cb:
  307|  1.50k|{
  308|  1.50k|    DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
  309|       |
  310|  1.50k|    switch (operation) {
  ------------------
  |  Branch (310:13): [True: 992, False: 508]
  ------------------
  311|    254|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|    254|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (311:5): [True: 254, False: 1.24k]
  ------------------
  312|    254|        dpn->dpname = NULL;
  313|    254|        break;
  314|       |
  315|    254|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|    254|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (315:5): [True: 254, False: 1.24k]
  ------------------
  316|    254|        X509_NAME_free(dpn->dpname);
  317|    254|        break;
  318|  1.50k|    }
  319|  1.50k|    return 1;
  320|  1.50k|}
v3_crld.c:i2r_idp:
  440|     48|{
  441|     48|    ISSUING_DIST_POINT *idp = pidp;
  442|     48|    if (idp->distpoint)
  ------------------
  |  Branch (442:9): [True: 0, False: 48]
  ------------------
  443|      0|        print_distpoint(out, idp->distpoint, indent);
  444|     48|    if (idp->onlyuser > 0)
  ------------------
  |  Branch (444:9): [True: 3, False: 45]
  ------------------
  445|      3|        BIO_printf(out, "%*sOnly User Certificates\n", indent, "");
  446|     48|    if (idp->onlyCA > 0)
  ------------------
  |  Branch (446:9): [True: 3, False: 45]
  ------------------
  447|      3|        BIO_printf(out, "%*sOnly CA Certificates\n", indent, "");
  448|     48|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (448:9): [True: 3, False: 45]
  ------------------
  449|      3|        BIO_printf(out, "%*sIndirect CRL\n", indent, "");
  450|     48|    if (idp->onlysomereasons)
  ------------------
  |  Branch (450:9): [True: 3, False: 45]
  ------------------
  451|      3|        print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent);
  452|     48|    if (idp->onlyattr > 0)
  ------------------
  |  Branch (452:9): [True: 3, False: 45]
  ------------------
  453|      3|        BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, "");
  454|     48|    if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0)
  ------------------
  |  Branch (454:9): [True: 48, False: 0]
  |  Branch (454:28): [True: 45, False: 3]
  |  Branch (454:52): [True: 42, False: 3]
  ------------------
  455|     48|        && (idp->indirectCRL <= 0) && !idp->onlysomereasons
  ------------------
  |  Branch (455:12): [True: 39, False: 3]
  |  Branch (455:39): [True: 36, False: 3]
  ------------------
  456|     48|        && (idp->onlyattr <= 0))
  ------------------
  |  Branch (456:12): [True: 33, False: 3]
  ------------------
  457|     33|        BIO_printf(out, "%*s<EMPTY>\n", indent, "");
  458|       |
  459|     48|    return 1;
  460|     48|}
v3_crld.c:print_distpoint:
  423|    112|{
  424|    112|    if (dpn->type == 0) {
  ------------------
  |  Branch (424:9): [True: 112, False: 0]
  ------------------
  425|    112|        BIO_printf(out, "%*sFull Name:\n", indent, "");
  426|    112|        OSSL_GENERAL_NAMES_print(out, dpn->name.fullname, indent);
  427|    112|        BIO_puts(out, "\n");
  428|    112|    } else {
  429|      0|        X509_NAME ntmp;
  430|      0|        ntmp.entries = dpn->name.relativename;
  431|      0|        BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, "");
  432|      0|        X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE);
  ------------------
  |  |  358|      0|# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  |  |  ------------------
  |  |  |  |  516|      0|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  441|      0|# define ASN1_STRFLGS_ESC_2253           1
  |  |  |  |  ------------------
  |  |  |  |  517|      0|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|      0|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  |  |  ------------------
  |  |  |  |  518|      0|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  443|      0|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  |  |  ------------------
  |  |  |  |  519|      0|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  475|      0|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  |  |  ------------------
  |  |  |  |  520|      0|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  497|      0|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  |  |  ------------------
  |  |  |  |  521|      0|                                ASN1_STRFLGS_DUMP_DER)
  |  |  |  |  ------------------
  |  |  |  |  |  |  504|      0|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  359|      0|                        ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  455|      0|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |  360|      0|                        XN_FLAG_SEP_CPLUS_SPC | \
  |  |  ------------------
  |  |  |  |  321|      0|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  |  |  ------------------
  |  |  361|      0|                        XN_FLAG_SPC_EQ | \
  |  |  ------------------
  |  |  |  |  336|      0|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  |  |  ------------------
  |  |  362|      0|                        XN_FLAG_FN_SN)
  |  |  ------------------
  |  |  |  |  331|      0|# define XN_FLAG_FN_SN           0/* Object short name */
  |  |  ------------------
  ------------------
  433|      0|        BIO_puts(out, "\n");
  434|      0|    }
  435|    112|    return 1;
  436|    112|}
v3_crld.c:print_reasons:
  187|     16|{
  188|     16|    int first = 1;
  189|     16|    const BIT_STRING_BITNAME *pbn;
  190|     16|    BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, "");
  191|    160|    for (pbn = reason_flags; pbn->lname; pbn++) {
  ------------------
  |  Branch (191:30): [True: 144, False: 16]
  ------------------
  192|    144|        if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) {
  ------------------
  |  Branch (192:13): [True: 58, False: 86]
  ------------------
  193|     58|            if (first)
  ------------------
  |  Branch (193:17): [True: 10, False: 48]
  ------------------
  194|     10|                first = 0;
  195|     48|            else
  196|     48|                BIO_puts(out, ", ");
  197|     58|            BIO_puts(out, pbn->lname);
  198|     58|        }
  199|    144|    }
  200|     16|    if (first)
  ------------------
  |  Branch (200:9): [True: 6, False: 10]
  ------------------
  201|      6|        BIO_puts(out, "<EMPTY>\n");
  202|     10|    else
  203|     10|        BIO_puts(out, "\n");
  204|     16|    return 1;
  205|     16|}
v3_crld.c:i2r_crldp:
  464|    138|{
  465|    138|    STACK_OF(DIST_POINT) *crld = pcrldp;
  ------------------
  |  |   31|    138|# define STACK_OF(type) struct stack_st_##type
  ------------------
  466|    138|    DIST_POINT *point;
  467|    138|    int i;
  468|    265|    for (i = 0; i < sk_DIST_POINT_num(crld); i++) {
  ------------------
  |  |  331|    265|#define sk_DIST_POINT_num(sk) OPENSSL_sk_num(ossl_check_const_DIST_POINT_sk_type(sk))
  ------------------
  |  Branch (468:17): [True: 127, False: 138]
  ------------------
  469|    127|        if (i > 0)
  ------------------
  |  Branch (469:13): [True: 0, False: 127]
  ------------------
  470|      0|            BIO_puts(out, "\n");
  471|    127|        point = sk_DIST_POINT_value(crld, i);
  ------------------
  |  |  332|    127|#define sk_DIST_POINT_value(sk, idx) ((DIST_POINT *)OPENSSL_sk_value(ossl_check_const_DIST_POINT_sk_type(sk), (idx)))
  ------------------
  472|    127|        if (point->distpoint)
  ------------------
  |  Branch (472:13): [True: 112, False: 15]
  ------------------
  473|    112|            print_distpoint(out, point->distpoint, indent);
  474|    127|        if (point->reasons)
  ------------------
  |  Branch (474:13): [True: 10, False: 117]
  ------------------
  475|     10|            print_reasons(out, "Reasons", point->reasons, indent);
  476|    127|        if (point->CRLissuer) {
  ------------------
  |  Branch (476:13): [True: 3, False: 124]
  ------------------
  477|      3|            BIO_printf(out, "%*sCRL Issuer:\n", indent, "");
  478|      3|            OSSL_GENERAL_NAMES_print(out, point->CRLissuer, indent);
  479|      3|        }
  480|    127|    }
  481|    138|    return 1;
  482|    138|}
v3_crld.c:i2r_aaidp:
  625|     25|{
  626|     25|    OSSL_AA_DIST_POINT *pdp = dp;
  627|       |
  628|     25|    if (pdp->distpoint)
  ------------------
  |  Branch (628:9): [True: 0, False: 25]
  ------------------
  629|      0|        if (print_distpoint(out, pdp->distpoint, indent) <= 0)
  ------------------
  |  Branch (629:13): [True: 0, False: 0]
  ------------------
  630|      0|            return 0;
  631|     25|    if (pdp->reasons)
  ------------------
  |  Branch (631:9): [True: 3, False: 22]
  ------------------
  632|      3|        if (print_reasons(out, "Reasons", pdp->reasons, indent) <= 0)
  ------------------
  |  Branch (632:13): [True: 0, False: 3]
  ------------------
  633|      0|            return 0;
  634|     25|    if (pdp->indirectCRL) {
  ------------------
  |  Branch (634:9): [True: 2, False: 23]
  ------------------
  635|      2|        if (BIO_printf(out, "%*sIndirect CRL: ", indent, "") <= 0)
  ------------------
  |  Branch (635:13): [True: 0, False: 2]
  ------------------
  636|      0|            return 0;
  637|      2|        if (print_boolean(out, pdp->indirectCRL) <= 0)
  ------------------
  |  Branch (637:13): [True: 0, False: 2]
  ------------------
  638|      0|            return 0;
  639|      2|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (639:13): [True: 0, False: 2]
  ------------------
  640|      0|            return 0;
  641|      2|    }
  642|     25|    if (pdp->containsUserAttributeCerts) {
  ------------------
  |  Branch (642:9): [True: 22, False: 3]
  ------------------
  643|     22|        if (BIO_printf(out, "%*sContains User Attribute Certificates: ", indent, "") <= 0)
  ------------------
  |  Branch (643:13): [True: 0, False: 22]
  ------------------
  644|      0|            return 0;
  645|     22|        if (print_boolean(out, pdp->containsUserAttributeCerts) <= 0)
  ------------------
  |  Branch (645:13): [True: 0, False: 22]
  ------------------
  646|      0|            return 0;
  647|     22|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (647:13): [True: 0, False: 22]
  ------------------
  648|      0|            return 0;
  649|     22|    }
  650|     25|    if (pdp->containsAACerts) {
  ------------------
  |  Branch (650:9): [True: 22, False: 3]
  ------------------
  651|     22|        if (BIO_printf(out, "%*sContains Attribute Authority (AA) Certificates: ",
  ------------------
  |  Branch (651:13): [True: 0, False: 22]
  ------------------
  652|     22|                       indent, "") <= 0)
  653|      0|            return 0;
  654|     22|        if (print_boolean(out, pdp->containsAACerts) <= 0)
  ------------------
  |  Branch (654:13): [True: 0, False: 22]
  ------------------
  655|      0|            return 0;
  656|     22|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (656:13): [True: 0, False: 22]
  ------------------
  657|      0|            return 0;
  658|     22|    }
  659|     25|    if (pdp->containsSOAPublicKeyCerts) {
  ------------------
  |  Branch (659:9): [True: 22, False: 3]
  ------------------
  660|     22|        if (BIO_printf(out,
  ------------------
  |  Branch (660:13): [True: 0, False: 22]
  ------------------
  661|     22|                       "%*sContains Source Of Authority (SOA) Public Key Certificates: ",
  662|     22|                       indent, "") <= 0)
  663|      0|            return 0;
  664|     22|        if (print_boolean(out, pdp->containsSOAPublicKeyCerts) <= 0)
  ------------------
  |  Branch (664:13): [True: 0, False: 22]
  ------------------
  665|      0|            return 0;
  666|     22|        if (BIO_puts(out, "\n") <= 0)
  ------------------
  |  Branch (666:13): [True: 0, False: 22]
  ------------------
  667|      0|            return 0;
  668|     22|    }
  669|     25|    return 1;
  670|     25|}
v3_crld.c:print_boolean:
  525|     68|{
  526|     68|    return BIO_puts(out, b ? "TRUE" : "FALSE");
  ------------------
  |  Branch (526:26): [True: 68, False: 0]
  ------------------
  527|     68|}

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

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

GENERAL_NAME_set1_X509_NAME:
   62|  15.5k|{
   63|  15.5k|    GENERAL_NAME *name;
   64|       |
   65|  15.5k|    if (tgt == NULL) {
  ------------------
  |  Branch (65:9): [True: 0, False: 15.5k]
  ------------------
   66|      0|        ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|        return 0;
   68|      0|    }
   69|       |
   70|  15.5k|    if ((name = GENERAL_NAME_new()) == NULL)
  ------------------
  |  Branch (70:9): [True: 0, False: 15.5k]
  ------------------
   71|      0|        return 0;
   72|  15.5k|    name->type = GEN_DIRNAME;
  ------------------
  |  |  177|  15.5k|# define GEN_DIRNAME     4
  ------------------
   73|       |
   74|  15.5k|    if (src == NULL) { /* NULL-DN */
  ------------------
  |  Branch (74:9): [True: 11.6k, False: 3.91k]
  ------------------
   75|  11.6k|        if ((name->d.directoryName = X509_NAME_new()) == NULL)
  ------------------
  |  Branch (75:13): [True: 0, False: 11.6k]
  ------------------
   76|      0|            goto err;
   77|  11.6k|    } else if (!X509_NAME_set(&name->d.directoryName, src)) {
  ------------------
  |  Branch (77:16): [True: 0, False: 3.91k]
  ------------------
   78|      0|        goto err;
   79|      0|    }
   80|       |
   81|  15.5k|    GENERAL_NAME_free(*tgt);
   82|  15.5k|    *tgt = name;
   83|  15.5k|    return 1;
   84|       |
   85|      0| err:
   86|      0|    GENERAL_NAME_free(name);
   87|      0|    return 0;
   88|  15.5k|}

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

i2s_ASN1_IA5STRING:
   29|    205|{
   30|    205|    char *tmp;
   31|       |
   32|    205|    if (ia5 == NULL || ia5->length <= 0)
  ------------------
  |  Branch (32:9): [True: 0, False: 205]
  |  Branch (32:24): [True: 87, False: 118]
  ------------------
   33|     87|        return NULL;
   34|    118|    if ((tmp = OPENSSL_malloc(ia5->length + 1)) == NULL)
  ------------------
  |  |  102|    118|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    118|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    118|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (34:9): [True: 0, False: 118]
  ------------------
   35|      0|        return NULL;
   36|    118|    memcpy(tmp, ia5->data, ia5->length);
   37|    118|    tmp[ia5->length] = 0;
   38|    118|    return tmp;
   39|    118|}

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

v3_info.c:i2v_AUTHORITY_INFO_ACCESS:
   64|     76|{
   65|     76|    ACCESS_DESCRIPTION *desc;
   66|     76|    int i, nlen;
   67|     76|    char objtmp[80], *ntmp;
   68|     76|    CONF_VALUE *vtmp;
   69|     76|    STACK_OF(CONF_VALUE) *tret = ret;
  ------------------
  |  |   31|     76|# define STACK_OF(type) struct stack_st_##type
  ------------------
   70|       |
   71|    127|    for (i = 0; i < sk_ACCESS_DESCRIPTION_num(ainfo); i++) {
  ------------------
  |  |  212|    127|#define sk_ACCESS_DESCRIPTION_num(sk) OPENSSL_sk_num(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk))
  ------------------
  |  Branch (71:17): [True: 73, False: 54]
  ------------------
   72|     73|        STACK_OF(CONF_VALUE) *tmp;
  ------------------
  |  |   31|     73|# define STACK_OF(type) struct stack_st_##type
  ------------------
   73|       |
   74|     73|        desc = sk_ACCESS_DESCRIPTION_value(ainfo, i);
  ------------------
  |  |  213|     73|#define sk_ACCESS_DESCRIPTION_value(sk, idx) ((ACCESS_DESCRIPTION *)OPENSSL_sk_value(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk), (idx)))
  ------------------
   75|     73|        tmp = i2v_GENERAL_NAME(method, desc->location, tret);
   76|     73|        if (tmp == NULL) {
  ------------------
  |  Branch (76:13): [True: 22, False: 51]
  ------------------
   77|     22|            ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|     22|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     22|    (ERR_new(),                                                 \
  |  |  |  |  404|     22|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     22|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     22|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     22|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     22|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|     22|            goto err;
   79|     22|        }
   80|     51|        tret = tmp;
   81|     51|        vtmp = sk_CONF_VALUE_value(tret, i);
  ------------------
  |  |   46|     51|#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
  ------------------
   82|     51|        i2t_ASN1_OBJECT(objtmp, sizeof(objtmp), desc->method);
   83|     51|        nlen = strlen(objtmp) + 3 + strlen(vtmp->name) + 1;
   84|     51|        ntmp = OPENSSL_malloc(nlen);
  ------------------
  |  |  102|     51|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     51|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     51|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|     51|        if (ntmp == NULL)
  ------------------
  |  Branch (85:13): [True: 0, False: 51]
  ------------------
   86|      0|            goto err;
   87|     51|        BIO_snprintf(ntmp, nlen, "%s - %s", objtmp, vtmp->name);
   88|     51|        OPENSSL_free(vtmp->name);
  ------------------
  |  |  115|     51|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     51|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     51|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|     51|        vtmp->name = ntmp;
   90|     51|    }
   91|     54|    if (ret == NULL && tret == NULL)
  ------------------
  |  Branch (91:9): [True: 54, False: 0]
  |  Branch (91:24): [True: 3, False: 51]
  ------------------
   92|      3|        return sk_CONF_VALUE_new_null();
  ------------------
  |  |   48|      3|#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
  ------------------
   93|       |
   94|     51|    return tret;
   95|     22| err:
   96|     22|    if (ret == NULL && tret != NULL)
  ------------------
  |  Branch (96:9): [True: 22, False: 0]
  |  Branch (96:24): [True: 0, False: 22]
  ------------------
   97|      0|        sk_CONF_VALUE_pop_free(tret, X509V3_conf_free);
  ------------------
  |  |   59|      0|#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))
  ------------------
   98|     22|    return NULL;
   99|     54|}

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

X509V3_EXT_get_nid:
   53|  5.91k|{
   54|  5.91k|    X509V3_EXT_METHOD tmp;
   55|  5.91k|    const X509V3_EXT_METHOD *t = &tmp, *const *ret;
   56|  5.91k|    int idx;
   57|       |
   58|  5.91k|    if (nid < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 5.91k]
  ------------------
   59|      0|        return NULL;
   60|  5.91k|    tmp.ext_nid = nid;
   61|  5.91k|    ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
  ------------------
  |  |  103|  5.91k|#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts)
  |  |  ------------------
  |  |  |  |   14|  5.91k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
   62|  5.91k|    if (ret)
  ------------------
  |  Branch (62:9): [True: 5.73k, False: 182]
  ------------------
   63|  5.73k|        return *ret;
   64|    182|    if (!ext_list)
  ------------------
  |  Branch (64:9): [True: 182, False: 0]
  ------------------
   65|    182|        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|    182|}
X509V3_EXT_get:
   74|  6.85k|{
   75|  6.85k|    int nid;
   76|  6.85k|    if ((nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext))) == NID_undef)
  ------------------
  |  |   18|  6.85k|#define NID_undef                       0
  ------------------
  |  Branch (76:9): [True: 942, False: 5.91k]
  ------------------
   77|    942|        return NULL;
   78|  5.91k|    return X509V3_EXT_get_nid(nid);
   79|  6.85k|}
X509V3_EXT_d2i:
  135|  3.19k|{
  136|  3.19k|    const X509V3_EXT_METHOD *method;
  137|  3.19k|    const unsigned char *p;
  138|  3.19k|    ASN1_STRING *extvalue;
  139|  3.19k|    int extlen;
  140|       |
  141|  3.19k|    if ((method = X509V3_EXT_get(ext)) == NULL)
  ------------------
  |  Branch (141:9): [True: 0, False: 3.19k]
  ------------------
  142|      0|        return NULL;
  143|  3.19k|    extvalue = X509_EXTENSION_get_data(ext);
  144|  3.19k|    p = ASN1_STRING_get0_data(extvalue);
  145|  3.19k|    extlen = ASN1_STRING_length(extvalue);
  146|  3.19k|    if (method->it)
  ------------------
  |  Branch (146:9): [True: 3.19k, False: 0]
  ------------------
  147|  3.19k|        return ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  422|  3.19k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  148|      0|    return method->d2i(NULL, &p, extlen);
  149|  3.19k|}
X509V3_get_d2i:
  169|  16.7k|{
  170|  16.7k|    int lastpos, i;
  171|  16.7k|    X509_EXTENSION *ex, *found_ex = NULL;
  172|       |
  173|  16.7k|    if (!x) {
  ------------------
  |  Branch (173:9): [True: 2.35k, False: 14.3k]
  ------------------
  174|  2.35k|        if (idx)
  ------------------
  |  Branch (174:13): [True: 0, False: 2.35k]
  ------------------
  175|      0|            *idx = -1;
  176|  2.35k|        if (crit)
  ------------------
  |  Branch (176:13): [True: 2.05k, False: 303]
  ------------------
  177|  2.05k|            *crit = -1;
  178|  2.35k|        return NULL;
  179|  2.35k|    }
  180|  14.3k|    if (idx)
  ------------------
  |  Branch (180:9): [True: 0, False: 14.3k]
  ------------------
  181|      0|        lastpos = *idx + 1;
  182|  14.3k|    else
  183|  14.3k|        lastpos = 0;
  184|  14.3k|    if (lastpos < 0)
  ------------------
  |  Branch (184:9): [True: 0, False: 14.3k]
  ------------------
  185|      0|        lastpos = 0;
  186|  82.4k|    for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) {
  ------------------
  |  |  235|  82.4k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (186:23): [True: 68.1k, False: 14.3k]
  ------------------
  187|  68.1k|        ex = sk_X509_EXTENSION_value(x, i);
  ------------------
  |  |  236|  68.1k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  188|  68.1k|        if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) == nid) {
  ------------------
  |  Branch (188:13): [True: 3.25k, False: 64.8k]
  ------------------
  189|  3.25k|            if (idx) {
  ------------------
  |  Branch (189:17): [True: 0, False: 3.25k]
  ------------------
  190|      0|                *idx = i;
  191|      0|                found_ex = ex;
  192|      0|                break;
  193|  3.25k|            } else if (found_ex) {
  ------------------
  |  Branch (193:24): [True: 29, False: 3.22k]
  ------------------
  194|       |                /* Found more than one */
  195|     29|                if (crit)
  ------------------
  |  Branch (195:21): [True: 29, False: 0]
  ------------------
  196|     29|                    *crit = -2;
  197|     29|                return NULL;
  198|     29|            }
  199|  3.22k|            found_ex = ex;
  200|  3.22k|        }
  201|  68.1k|    }
  202|  14.3k|    if (found_ex) {
  ------------------
  |  Branch (202:9): [True: 3.19k, False: 11.1k]
  ------------------
  203|       |        /* Found it */
  204|  3.19k|        if (crit)
  ------------------
  |  Branch (204:13): [True: 3.19k, False: 0]
  ------------------
  205|  3.19k|            *crit = X509_EXTENSION_get_critical(found_ex);
  206|  3.19k|        return X509V3_EXT_d2i(found_ex);
  207|  3.19k|    }
  208|       |
  209|       |    /* Extension not found */
  210|  11.1k|    if (idx)
  ------------------
  |  Branch (210:9): [True: 0, False: 11.1k]
  ------------------
  211|      0|        *idx = -1;
  212|  11.1k|    if (crit)
  ------------------
  |  Branch (212:9): [True: 11.1k, False: 0]
  ------------------
  213|  11.1k|        *crit = -1;
  214|  11.1k|    return NULL;
  215|  14.3k|}
v3_lib.c:ext_cmp:
   41|  31.4k|{
   42|  31.4k|    return ((*a)->ext_nid - (*b)->ext_nid);
   43|  31.4k|}

v3_ncons.c:i2r_NAME_CONSTRAINTS:
  205|     14|{
  206|     14|    NAME_CONSTRAINTS *ncons = a;
  207|     14|    do_i2r_name_constraints(method, ncons->permittedSubtrees,
  208|     14|                            bp, ind, "Permitted");
  209|     14|    if (ncons->permittedSubtrees && ncons->excludedSubtrees)
  ------------------
  |  Branch (209:9): [True: 3, False: 11]
  |  Branch (209:37): [True: 0, False: 3]
  ------------------
  210|      0|        BIO_puts(bp, "\n");
  211|     14|    do_i2r_name_constraints(method, ncons->excludedSubtrees,
  212|     14|                            bp, ind, "Excluded");
  213|     14|    return 1;
  214|     14|}
v3_ncons.c:do_i2r_name_constraints:
  219|     28|{
  220|     28|    GENERAL_SUBTREE *tree;
  221|     28|    int i;
  222|     28|    if (sk_GENERAL_SUBTREE_num(trees) > 0)
  ------------------
  |  |  539|     28|#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))
  ------------------
  |  Branch (222:9): [True: 0, False: 28]
  ------------------
  223|      0|        BIO_printf(bp, "%*s%s:\n", ind, "", name);
  224|     28|    for (i = 0; i < sk_GENERAL_SUBTREE_num(trees); i++) {
  ------------------
  |  |  539|     28|#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))
  ------------------
  |  Branch (224:17): [True: 0, False: 28]
  ------------------
  225|      0|        if (i > 0)
  ------------------
  |  Branch (225:13): [True: 0, False: 0]
  ------------------
  226|      0|            BIO_puts(bp, "\n");
  227|      0|        tree = sk_GENERAL_SUBTREE_value(trees, i);
  ------------------
  |  |  540|      0|#define sk_GENERAL_SUBTREE_value(sk, idx) ((GENERAL_SUBTREE *)OPENSSL_sk_value(ossl_check_const_GENERAL_SUBTREE_sk_type(sk), (idx)))
  ------------------
  228|      0|        BIO_printf(bp, "%*s", ind + 2, "");
  229|      0|        if (tree->base->type == GEN_IPADD)
  ------------------
  |  |  180|      0|# define GEN_IPADD       7
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            print_nc_ipadd(bp, tree->base->d.ip);
  231|      0|        else
  232|      0|            GENERAL_NAME_print(bp, tree->base);
  233|      0|    }
  234|     28|    return 1;
  235|     28|}

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

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

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

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

v3_pmaps.c:i2v_POLICY_MAPPINGS:
   49|     13|{
   50|     13|    POLICY_MAPPINGS *pmaps = a;
   51|     13|    POLICY_MAPPING *pmap;
   52|     13|    int i;
   53|     13|    char obj_tmp1[80];
   54|     13|    char obj_tmp2[80];
   55|       |
   56|     13|    for (i = 0; i < sk_POLICY_MAPPING_num(pmaps); i++) {
  ------------------
  |  |  503|     13|#define sk_POLICY_MAPPING_num(sk) OPENSSL_sk_num(ossl_check_const_POLICY_MAPPING_sk_type(sk))
  ------------------
  |  Branch (56:17): [True: 0, False: 13]
  ------------------
   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|     13|    return ext_list;
   63|     13|}

X509V3_EXT_val_prn:
   26|    749|{
   27|    749|    int i;
   28|    749|    CONF_VALUE *nval;
   29|    749|    if (!val)
  ------------------
  |  Branch (29:9): [True: 0, False: 749]
  ------------------
   30|      0|        return;
   31|    749|    if (!ml || !sk_CONF_VALUE_num(val)) {
  ------------------
  |  |   45|    289|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (31:9): [True: 460, False: 289]
  |  Branch (31:16): [True: 6, False: 283]
  ------------------
   32|    466|        BIO_printf(out, "%*s", indent, "");
   33|    466|        if (!sk_CONF_VALUE_num(val))
  ------------------
  |  |   45|    466|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (33:13): [True: 24, False: 442]
  ------------------
   34|     24|            BIO_puts(out, "<EMPTY>\n");
   35|    466|    }
   36|  2.37k|    for (i = 0; i < sk_CONF_VALUE_num(val); i++) {
  ------------------
  |  |   45|  2.37k|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (36:17): [True: 1.62k, False: 749]
  ------------------
   37|  1.62k|        if (ml) {
  ------------------
  |  Branch (37:13): [True: 283, False: 1.34k]
  ------------------
   38|    283|            if (i > 0)
  ------------------
  |  Branch (38:17): [True: 0, False: 283]
  ------------------
   39|      0|                BIO_printf(out, "\n");
   40|    283|            BIO_printf(out, "%*s", indent, "");
   41|    283|        }
   42|  1.34k|        else if (i > 0)
  ------------------
  |  Branch (42:18): [True: 899, False: 442]
  ------------------
   43|    899|            BIO_printf(out, ", ");
   44|  1.62k|        nval = sk_CONF_VALUE_value(val, i);
  ------------------
  |  |   46|  1.62k|#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
  ------------------
   45|  1.62k|        if (!nval->name)
  ------------------
  |  Branch (45:13): [True: 229, False: 1.39k]
  ------------------
   46|    229|            BIO_puts(out, nval->value);
   47|  1.39k|        else if (!nval->value)
  ------------------
  |  Branch (47:18): [True: 387, False: 1.00k]
  ------------------
   48|    387|            BIO_puts(out, nval->name);
   49|  1.00k|#ifndef CHARSET_EBCDIC
   50|  1.00k|        else
   51|  1.00k|            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|  1.62k|    }
   66|    749|}
X509V3_EXT_print:
   72|  3.66k|{
   73|  3.66k|    void *ext_str = NULL;
   74|  3.66k|    char *value = NULL;
   75|  3.66k|    ASN1_OCTET_STRING *extoct;
   76|  3.66k|    const unsigned char *p;
   77|  3.66k|    int extlen;
   78|  3.66k|    const X509V3_EXT_METHOD *method;
   79|  3.66k|    STACK_OF(CONF_VALUE) *nval = NULL;
  ------------------
  |  |   31|  3.66k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   80|  3.66k|    int ok = 1;
   81|       |
   82|  3.66k|    extoct = X509_EXTENSION_get_data(ext);
   83|  3.66k|    p = ASN1_STRING_get0_data(extoct);
   84|  3.66k|    extlen = ASN1_STRING_length(extoct);
   85|       |
   86|  3.66k|    if ((method = X509V3_EXT_get(ext)) == NULL)
  ------------------
  |  Branch (86:9): [True: 1.12k, False: 2.53k]
  ------------------
   87|  1.12k|        return unknown_ext_print(out, p, extlen, flag, indent, 0);
   88|  2.53k|    if (method->it)
  ------------------
  |  Branch (88:9): [True: 2.52k, False: 9]
  ------------------
   89|  2.52k|        ext_str = ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  422|  2.52k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
   90|      9|    else
   91|      9|        ext_str = method->d2i(NULL, &p, extlen);
   92|       |
   93|  2.53k|    if (!ext_str)
  ------------------
  |  Branch (93:9): [True: 569, False: 1.96k]
  ------------------
   94|    569|        return unknown_ext_print(out, p, extlen, flag, indent, 1);
   95|       |
   96|  1.96k|    if (method->i2s) {
  ------------------
  |  Branch (96:9): [True: 671, False: 1.29k]
  ------------------
   97|    671|        if ((value = method->i2s(method, ext_str)) == NULL) {
  ------------------
  |  Branch (97:13): [True: 87, False: 584]
  ------------------
   98|     87|            ok = 0;
   99|     87|            goto err;
  100|     87|        }
  101|    584|#ifndef CHARSET_EBCDIC
  102|    584|        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|  1.29k|    } else if (method->i2v) {
  ------------------
  |  Branch (116:16): [True: 887, False: 409]
  ------------------
  117|    887|        if ((nval = method->i2v(method, ext_str, NULL)) == NULL) {
  ------------------
  |  Branch (117:13): [True: 138, False: 749]
  ------------------
  118|    138|            ok = 0;
  119|    138|            goto err;
  120|    138|        }
  121|    749|        X509V3_EXT_val_prn(out, nval, indent,
  122|    749|                           method->ext_flags & X509V3_EXT_MULTILINE);
  ------------------
  |  |  143|    749|# define X509V3_EXT_MULTILINE    0x4
  ------------------
  123|    749|    } else if (method->i2r) {
  ------------------
  |  Branch (123:16): [True: 409, False: 0]
  ------------------
  124|    409|        if (!method->i2r(method, ext_str, out, indent))
  ------------------
  |  Branch (124:13): [True: 8, False: 401]
  ------------------
  125|      8|            ok = 0;
  126|    409|    } else
  127|      0|        ok = 0;
  128|       |
  129|  1.96k| err:
  130|  1.96k|    sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
  ------------------
  |  |   59|  1.96k|#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|  1.96k|    OPENSSL_free(value);
  ------------------
  |  |  115|  1.96k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.96k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.96k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  1.96k|    if (method->it)
  ------------------
  |  Branch (132:9): [True: 1.95k, False: 9]
  ------------------
  133|  1.95k|        ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  422|  1.95k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  134|      9|    else
  135|      9|        method->ext_free(ext_str);
  136|  1.96k|    return ok;
  137|  1.96k|}
X509V3_extensions_print:
  142|    742|{
  143|    742|    int i, j;
  144|       |
  145|    742|    if (sk_X509_EXTENSION_num(exts) <= 0)
  ------------------
  |  |  235|    742|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (145:9): [True: 7, False: 735]
  ------------------
  146|      7|        return 1;
  147|       |
  148|    735|    if (title) {
  ------------------
  |  Branch (148:9): [True: 735, False: 0]
  ------------------
  149|    735|        BIO_printf(bp, "%*s%s:\n", indent, "", title);
  150|    735|        indent += 4;
  151|    735|    }
  152|       |
  153|  4.39k|    for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
  ------------------
  |  |  235|  4.39k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (153:17): [True: 3.66k, False: 735]
  ------------------
  154|  3.66k|        ASN1_OBJECT *obj;
  155|  3.66k|        X509_EXTENSION *ex;
  156|       |
  157|  3.66k|        ex = sk_X509_EXTENSION_value(exts, i);
  ------------------
  |  |  236|  3.66k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  158|  3.66k|        obj = X509_EXTENSION_get_object(ex);
  159|  3.66k|        if ((flag & X509_FLAG_EXTENSIONS_ONLY_KID) != 0
  ------------------
  |  |  311|  3.66k|# define X509_FLAG_EXTENSIONS_ONLY_KID   (1L << 13)
  ------------------
  |  Branch (159:13): [True: 0, False: 3.66k]
  ------------------
  160|  3.66k|                && OBJ_obj2nid(obj) != NID_subject_key_identifier
  ------------------
  |  | 2657|  3.66k|#define NID_subject_key_identifier              82
  ------------------
  |  Branch (160:20): [True: 0, False: 0]
  ------------------
  161|  3.66k|                && OBJ_obj2nid(obj) != NID_authority_key_identifier)
  ------------------
  |  | 2742|      0|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (161:20): [True: 0, False: 0]
  ------------------
  162|      0|            continue;
  163|  3.66k|        if (indent && BIO_printf(bp, "%*s", indent, "") <= 0)
  ------------------
  |  Branch (163:13): [True: 3.66k, False: 0]
  |  Branch (163:23): [True: 0, False: 3.66k]
  ------------------
  164|      0|            return 0;
  165|  3.66k|        i2a_ASN1_OBJECT(bp, obj);
  166|  3.66k|        j = X509_EXTENSION_get_critical(ex);
  167|  3.66k|        if (BIO_printf(bp, ": %s\n", j ? "critical" : "") <= 0)
  ------------------
  |  Branch (167:13): [True: 0, False: 3.66k]
  |  Branch (167:38): [True: 1.05k, False: 2.60k]
  ------------------
  168|      0|            return 0;
  169|  3.66k|        if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) {
  ------------------
  |  Branch (169:13): [True: 233, False: 3.42k]
  ------------------
  170|    233|            BIO_printf(bp, "%*s", indent + 4, "");
  171|    233|            ASN1_STRING_print(bp, X509_EXTENSION_get_data(ex));
  172|    233|        }
  173|  3.66k|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (173:13): [True: 0, False: 3.66k]
  ------------------
  174|      0|            return 0;
  175|  3.66k|    }
  176|    735|    return 1;
  177|    735|}
v3_prn.c:unknown_ext_print:
  181|  1.69k|{
  182|  1.69k|    switch (flag & X509V3_EXT_UNKNOWN_MASK) {
  ------------------
  |  |  761|  1.69k|# define X509V3_EXT_UNKNOWN_MASK         (0xfL << 16)
  ------------------
  183|       |
  184|      0|    case X509V3_EXT_DEFAULT:
  ------------------
  |  |  763|      0|# define X509V3_EXT_DEFAULT              0
  ------------------
  |  Branch (184:5): [True: 0, False: 1.69k]
  ------------------
  185|      0|        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: 1.69k]
  ------------------
  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: 1.69k]
  ------------------
  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: 1.69k]
  ------------------
  197|      0|        return BIO_dump_indent(out, (const char *)ext, extlen, indent);
  198|       |
  199|  1.69k|    default:
  ------------------
  |  Branch (199:5): [True: 1.69k, False: 0]
  ------------------
  200|  1.69k|        return 1;
  201|  1.69k|    }
  202|  1.69k|}

X509_check_purpose:
   89|  14.9k|{
   90|  14.9k|    int idx;
   91|  14.9k|    const X509_PURPOSE *pt;
   92|       |
   93|  14.9k|    if (!ossl_x509v3_cache_extensions(x))
  ------------------
  |  Branch (93:9): [True: 6.48k, False: 8.51k]
  ------------------
   94|  6.48k|        return -1;
   95|  8.51k|    if (id == -1)
  ------------------
  |  Branch (95:9): [True: 8.51k, False: 0]
  ------------------
   96|  8.51k|        return 1;
   97|       |
   98|      0|    idx = X509_PURPOSE_get_by_id(id);
   99|      0|    if (idx == -1)
  ------------------
  |  Branch (99:9): [True: 0, False: 0]
  ------------------
  100|      0|        return -1;
  101|      0|    pt = X509_PURPOSE_get0(idx);
  102|      0|    return pt->check_purpose(pt, x, non_leaf);
  103|      0|}
X509_supported_extension:
  310|  1.63k|{
  311|       |    /*
  312|       |     * This table is a list of the NIDs of supported extensions: that is
  313|       |     * those which are used by the verify process. If an extension is
  314|       |     * critical and doesn't appear in this list then the verify process will
  315|       |     * normally reject the certificate. The list must be kept in numerical
  316|       |     * order because it will be searched using bsearch.
  317|       |     */
  318|  1.63k|    static const int supported_nids[] = {
  319|  1.63k|        NID_netscape_cert_type, /* 71 */
  ------------------
  |  | 2922|  1.63k|#define NID_netscape_cert_type          71
  ------------------
  320|  1.63k|        NID_key_usage,          /* 83 */
  ------------------
  |  | 2662|  1.63k|#define NID_key_usage           83
  ------------------
  321|  1.63k|        NID_subject_alt_name,   /* 85 */
  ------------------
  |  | 2672|  1.63k|#define NID_subject_alt_name            85
  ------------------
  322|  1.63k|        NID_basic_constraints,  /* 87 */
  ------------------
  |  | 2682|  1.63k|#define NID_basic_constraints           87
  ------------------
  323|  1.63k|        NID_certificate_policies, /* 89 */
  ------------------
  |  | 2727|  1.63k|#define NID_certificate_policies                89
  ------------------
  324|  1.63k|        NID_crl_distribution_points, /* 103 */
  ------------------
  |  | 2722|  1.63k|#define NID_crl_distribution_points             103
  ------------------
  325|  1.63k|        NID_ext_key_usage,      /* 126 */
  ------------------
  |  | 2752|  1.63k|#define NID_ext_key_usage               126
  ------------------
  326|  1.63k|#ifndef OPENSSL_NO_RFC3779
  327|  1.63k|        NID_sbgp_ipAddrBlock,   /* 290 */
  ------------------
  |  | 1603|  1.63k|#define NID_sbgp_ipAddrBlock            290
  ------------------
  328|  1.63k|        NID_sbgp_autonomousSysNum, /* 291 */
  ------------------
  |  | 1607|  1.63k|#define NID_sbgp_autonomousSysNum               291
  ------------------
  329|  1.63k|#endif
  330|  1.63k|        NID_id_pkix_OCSP_noCheck, /* 369 */
  ------------------
  |  | 2201|  1.63k|#define NID_id_pkix_OCSP_noCheck                369
  ------------------
  331|  1.63k|        NID_policy_constraints, /* 401 */
  ------------------
  |  | 2747|  1.63k|#define NID_policy_constraints          401
  ------------------
  332|  1.63k|        NID_proxyCertInfo,      /* 663 */
  ------------------
  |  | 1625|  1.63k|#define NID_proxyCertInfo               663
  ------------------
  333|  1.63k|        NID_name_constraints,   /* 666 */
  ------------------
  |  | 2717|  1.63k|#define NID_name_constraints            666
  ------------------
  334|  1.63k|        NID_policy_mappings,    /* 747 */
  ------------------
  |  | 2737|  1.63k|#define NID_policy_mappings             747
  ------------------
  335|  1.63k|        NID_inhibit_any_policy  /* 748 */
  ------------------
  |  | 2807|  1.63k|#define NID_inhibit_any_policy          748
  ------------------
  336|  1.63k|    };
  337|       |
  338|  1.63k|    int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
  339|       |
  340|  1.63k|    if (ex_nid == NID_undef)
  ------------------
  |  |   18|  1.63k|#define NID_undef                       0
  ------------------
  |  Branch (340:9): [True: 284, False: 1.34k]
  ------------------
  341|    284|        return 0;
  342|       |
  343|  1.34k|    if (OBJ_bsearch_nid(&ex_nid, supported_nids, OSSL_NELEM(supported_nids)))
  ------------------
  |  |   14|  1.34k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (343:9): [True: 1.11k, False: 230]
  ------------------
  344|  1.11k|        return 1;
  345|    230|    return 0;
  346|  1.34k|}
ossl_x509v3_cache_extensions:
  440|  18.2k|{
  441|  18.2k|    BASIC_CONSTRAINTS *bs;
  442|  18.2k|    PROXY_CERT_INFO_EXTENSION *pci;
  443|  18.2k|    ASN1_BIT_STRING *usage;
  444|  18.2k|    ASN1_BIT_STRING *ns;
  445|  18.2k|    EXTENDED_KEY_USAGE *extusage;
  446|  18.2k|    int i;
  447|  18.2k|    int res;
  448|       |
  449|  18.2k|#ifdef tsan_ld_acq
  450|       |    /* Fast lock-free check, see end of the function for details. */
  451|  18.2k|    if (tsan_ld_acq((TSAN_QUALIFIER int *)&x->ex_cached))
  ------------------
  |  |   64|  18.2k|#   define tsan_ld_acq(ptr) atomic_load_explicit((ptr), memory_order_acquire)
  |  |  ------------------
  |  |  |  Branch (64:29): [True: 16.8k, False: 1.36k]
  |  |  ------------------
  ------------------
  452|  16.8k|        return (x->ex_flags & EXFLAG_INVALID) == 0;
  ------------------
  |  |  657|  16.8k|# define EXFLAG_INVALID          0x80
  ------------------
  453|  1.36k|#endif
  454|       |
  455|  1.36k|    if (!CRYPTO_THREAD_write_lock(x->lock))
  ------------------
  |  Branch (455:9): [True: 0, False: 1.36k]
  ------------------
  456|      0|        return 0;
  457|  1.36k|    if ((x->ex_flags & EXFLAG_SET) != 0) { /* Cert has already been processed */
  ------------------
  |  |  659|  1.36k|# define EXFLAG_SET              0x100
  ------------------
  |  Branch (457:9): [True: 0, False: 1.36k]
  ------------------
  458|      0|        CRYPTO_THREAD_unlock(x->lock);
  459|      0|        return (x->ex_flags & EXFLAG_INVALID) == 0;
  ------------------
  |  |  657|      0|# define EXFLAG_INVALID          0x80
  ------------------
  460|      0|    }
  461|       |
  462|  1.36k|    ERR_set_mark();
  463|       |
  464|       |    /* Cache the SHA1 digest of the cert */
  465|  1.36k|    if (!X509_digest(x, EVP_sha1(), x->sha1_hash, NULL))
  ------------------
  |  Branch (465:9): [True: 0, False: 1.36k]
  ------------------
  466|      0|        x->ex_flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  467|       |
  468|       |    /* V1 should mean no extensions ... */
  469|  1.36k|    if (X509_get_version(x) == X509_VERSION_1)
  ------------------
  |  |  848|  1.36k|#define X509_VERSION_1 0
  ------------------
  |  Branch (469:9): [True: 18, False: 1.35k]
  ------------------
  470|     18|        x->ex_flags |= EXFLAG_V1;
  ------------------
  |  |  656|     18|# define EXFLAG_V1               0x40
  ------------------
  471|       |
  472|       |    /* Handle basic constraints */
  473|  1.36k|    x->ex_pathlen = -1;
  474|  1.36k|    if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, &i, NULL)) != NULL) {
  ------------------
  |  | 2682|  1.36k|#define NID_basic_constraints           87
  ------------------
  |  Branch (474:9): [True: 495, False: 873]
  ------------------
  475|    495|        if (bs->ca)
  ------------------
  |  Branch (475:13): [True: 483, False: 12]
  ------------------
  476|    483|            x->ex_flags |= EXFLAG_CA;
  ------------------
  |  |  654|    483|# define EXFLAG_CA               0x10
  ------------------
  477|    495|        if (bs->pathlen != NULL) {
  ------------------
  |  Branch (477:13): [True: 423, False: 72]
  ------------------
  478|       |            /*
  479|       |             * The error case !bs->ca is checked by check_chain()
  480|       |             * in case ctx->param->flags & X509_V_FLAG_X509_STRICT
  481|       |             */
  482|    423|            if (bs->pathlen->type == V_ASN1_NEG_INTEGER) {
  ------------------
  |  |   98|    423|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|    423|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (482:17): [True: 6, False: 417]
  ------------------
  483|      6|                ERR_raise(ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  484|      6|                x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      6|# define EXFLAG_INVALID          0x80
  ------------------
  485|    417|            } else {
  486|    417|                x->ex_pathlen = ASN1_INTEGER_get(bs->pathlen);
  487|    417|            }
  488|    423|        }
  489|    495|        BASIC_CONSTRAINTS_free(bs);
  490|    495|        x->ex_flags |= EXFLAG_BCONS;
  ------------------
  |  |  649|    495|# define EXFLAG_BCONS            0x1
  ------------------
  491|    873|    } else if (i != -1) {
  ------------------
  |  Branch (491:16): [True: 120, False: 753]
  ------------------
  492|    120|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    120|# define EXFLAG_INVALID          0x80
  ------------------
  493|    120|    }
  494|       |
  495|       |    /* Handle proxy certificates */
  496|  1.36k|    if ((pci = X509_get_ext_d2i(x, NID_proxyCertInfo, &i, NULL)) != NULL) {
  ------------------
  |  | 1625|  1.36k|#define NID_proxyCertInfo               663
  ------------------
  |  Branch (496:9): [True: 14, False: 1.35k]
  ------------------
  497|     14|        if ((x->ex_flags & EXFLAG_CA) != 0
  ------------------
  |  |  654|     14|# define EXFLAG_CA               0x10
  ------------------
  |  Branch (497:13): [True: 0, False: 14]
  ------------------
  498|     14|            || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0
  ------------------
  |  | 2672|     14|#define NID_subject_alt_name            85
  ------------------
  |  Branch (498:16): [True: 4, False: 10]
  ------------------
  499|     14|            || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) {
  ------------------
  |  | 2677|     10|#define NID_issuer_alt_name             86
  ------------------
  |  Branch (499:16): [True: 3, False: 7]
  ------------------
  500|      7|            x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      7|# define EXFLAG_INVALID          0x80
  ------------------
  501|      7|        }
  502|     14|        if (pci->pcPathLengthConstraint != NULL)
  ------------------
  |  Branch (502:13): [True: 0, False: 14]
  ------------------
  503|      0|            x->ex_pcpathlen = ASN1_INTEGER_get(pci->pcPathLengthConstraint);
  504|     14|        else
  505|     14|            x->ex_pcpathlen = -1;
  506|     14|        PROXY_CERT_INFO_EXTENSION_free(pci);
  507|     14|        x->ex_flags |= EXFLAG_PROXY;
  ------------------
  |  |  661|     14|# define EXFLAG_PROXY            0x400
  ------------------
  508|  1.35k|    } else if (i != -1) {
  ------------------
  |  Branch (508:16): [True: 2, False: 1.35k]
  ------------------
  509|      2|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      2|# define EXFLAG_INVALID          0x80
  ------------------
  510|      2|    }
  511|       |
  512|       |    /* Handle (basic) key usage */
  513|  1.36k|    if ((usage = X509_get_ext_d2i(x, NID_key_usage, &i, NULL)) != NULL) {
  ------------------
  |  | 2662|  1.36k|#define NID_key_usage           83
  ------------------
  |  Branch (513:9): [True: 497, False: 871]
  ------------------
  514|    497|        x->ex_kusage = 0;
  515|    497|        if (usage->length > 0) {
  ------------------
  |  Branch (515:13): [True: 480, False: 17]
  ------------------
  516|    480|            x->ex_kusage = usage->data[0];
  517|    480|            if (usage->length > 1)
  ------------------
  |  Branch (517:17): [True: 0, False: 480]
  ------------------
  518|      0|                x->ex_kusage |= usage->data[1] << 8;
  519|    480|        }
  520|    497|        x->ex_flags |= EXFLAG_KUSAGE;
  ------------------
  |  |  650|    497|# define EXFLAG_KUSAGE           0x2
  ------------------
  521|    497|        ASN1_BIT_STRING_free(usage);
  522|       |        /* Check for empty key usage according to RFC 5280 section 4.2.1.3 */
  523|    497|        if (x->ex_kusage == 0) {
  ------------------
  |  Branch (523:13): [True: 28, False: 469]
  ------------------
  524|     28|            ERR_raise(ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     28|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     28|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     28|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     28|     ERR_set_error)
  |  |  ------------------
  ------------------
  525|     28|            x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     28|# define EXFLAG_INVALID          0x80
  ------------------
  526|     28|        }
  527|    871|    } else if (i != -1) {
  ------------------
  |  Branch (527:16): [True: 65, False: 806]
  ------------------
  528|     65|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     65|# define EXFLAG_INVALID          0x80
  ------------------
  529|     65|    }
  530|       |
  531|       |    /* Handle extended key usage */
  532|  1.36k|    x->ex_xkusage = 0;
  533|  1.36k|    if ((extusage = X509_get_ext_d2i(x, NID_ext_key_usage, &i, NULL)) != NULL) {
  ------------------
  |  | 2752|  1.36k|#define NID_ext_key_usage               126
  ------------------
  |  Branch (533:9): [True: 12, False: 1.35k]
  ------------------
  534|     12|        x->ex_flags |= EXFLAG_XKUSAGE;
  ------------------
  |  |  651|     12|# define EXFLAG_XKUSAGE          0x4
  ------------------
  535|     31|        for (i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) {
  ------------------
  |  |  636|     31|#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
  ------------------
  |  Branch (535:21): [True: 19, False: 12]
  ------------------
  536|     19|            switch (OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage, i))) {
  ------------------
  |  |  637|     19|#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
  ------------------
  537|      0|            case NID_server_auth:
  ------------------
  |  | 1657|      0|#define NID_server_auth         129
  ------------------
  |  Branch (537:13): [True: 0, False: 19]
  ------------------
  538|      0|                x->ex_xkusage |= XKU_SSL_SERVER;
  ------------------
  |  |  693|      0|# define XKU_SSL_SERVER          0x1
  ------------------
  539|      0|                break;
  540|      0|            case NID_client_auth:
  ------------------
  |  | 1662|      0|#define NID_client_auth         130
  ------------------
  |  Branch (540:13): [True: 0, False: 19]
  ------------------
  541|      0|                x->ex_xkusage |= XKU_SSL_CLIENT;
  ------------------
  |  |  694|      0|# define XKU_SSL_CLIENT          0x2
  ------------------
  542|      0|                break;
  543|      0|            case NID_email_protect:
  ------------------
  |  | 1672|      0|#define NID_email_protect               132
  ------------------
  |  Branch (543:13): [True: 0, False: 19]
  ------------------
  544|      0|                x->ex_xkusage |= XKU_SMIME;
  ------------------
  |  |  695|      0|# define XKU_SMIME               0x4
  ------------------
  545|      0|                break;
  546|      0|            case NID_code_sign:
  ------------------
  |  | 1667|      0|#define NID_code_sign           131
  ------------------
  |  Branch (546:13): [True: 0, False: 19]
  ------------------
  547|      0|                x->ex_xkusage |= XKU_CODE_SIGN;
  ------------------
  |  |  696|      0|# define XKU_CODE_SIGN           0x8
  ------------------
  548|      0|                break;
  549|      0|            case NID_ms_sgc:
  ------------------
  |  | 1356|      0|#define NID_ms_sgc              137
  ------------------
  |  Branch (549:13): [True: 0, False: 19]
  ------------------
  550|      0|            case NID_ns_sgc:
  ------------------
  |  | 2967|      0|#define NID_ns_sgc              139
  ------------------
  |  Branch (550:13): [True: 0, False: 19]
  ------------------
  551|      0|                x->ex_xkusage |= XKU_SGC;
  ------------------
  |  |  697|      0|# define XKU_SGC                 0x10 /* Netscape or MS Server-Gated Crypto */
  ------------------
  552|      0|                break;
  553|      0|            case NID_OCSP_sign:
  ------------------
  |  | 1697|      0|#define NID_OCSP_sign           180
  ------------------
  |  Branch (553:13): [True: 0, False: 19]
  ------------------
  554|      0|                x->ex_xkusage |= XKU_OCSP_SIGN;
  ------------------
  |  |  698|      0|# define XKU_OCSP_SIGN           0x20
  ------------------
  555|      0|                break;
  556|      0|            case NID_time_stamp:
  ------------------
  |  | 1692|      0|#define NID_time_stamp          133
  ------------------
  |  Branch (556:13): [True: 0, False: 19]
  ------------------
  557|      0|                x->ex_xkusage |= XKU_TIMESTAMP;
  ------------------
  |  |  699|      0|# define XKU_TIMESTAMP           0x40
  ------------------
  558|      0|                break;
  559|      0|            case NID_dvcs:
  ------------------
  |  | 1702|      0|#define NID_dvcs                297
  ------------------
  |  Branch (559:13): [True: 0, False: 19]
  ------------------
  560|      0|                x->ex_xkusage |= XKU_DVCS;
  ------------------
  |  |  700|      0|# define XKU_DVCS                0x80
  ------------------
  561|      0|                break;
  562|      0|            case NID_anyExtendedKeyUsage:
  ------------------
  |  | 2902|      0|#define NID_anyExtendedKeyUsage         910
  ------------------
  |  Branch (562:13): [True: 0, False: 19]
  ------------------
  563|      0|                x->ex_xkusage |= XKU_ANYEKU;
  ------------------
  |  |  701|      0|# define XKU_ANYEKU              0x100
  ------------------
  564|      0|                break;
  565|     19|            default:
  ------------------
  |  Branch (565:13): [True: 19, False: 0]
  ------------------
  566|       |                /* Ignore unknown extended key usage */
  567|     19|                break;
  568|     19|            }
  569|     19|        }
  570|     12|        sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free);
  ------------------
  |  |  650|     12|#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
  ------------------
  571|  1.35k|    } else if (i != -1) {
  ------------------
  |  Branch (571:16): [True: 26, False: 1.33k]
  ------------------
  572|     26|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     26|# define EXFLAG_INVALID          0x80
  ------------------
  573|     26|    }
  574|       |
  575|       |    /* Handle legacy Netscape extension */
  576|  1.36k|    if ((ns = X509_get_ext_d2i(x, NID_netscape_cert_type, &i, NULL)) != NULL) {
  ------------------
  |  | 2922|  1.36k|#define NID_netscape_cert_type          71
  ------------------
  |  Branch (576:9): [True: 9, False: 1.35k]
  ------------------
  577|      9|        if (ns->length > 0)
  ------------------
  |  Branch (577:13): [True: 4, False: 5]
  ------------------
  578|      4|            x->ex_nscert = ns->data[0];
  579|      5|        else
  580|      5|            x->ex_nscert = 0;
  581|      9|        x->ex_flags |= EXFLAG_NSCERT;
  ------------------
  |  |  652|      9|# define EXFLAG_NSCERT           0x8
  ------------------
  582|      9|        ASN1_BIT_STRING_free(ns);
  583|  1.35k|    } else if (i != -1) {
  ------------------
  |  Branch (583:16): [True: 10, False: 1.34k]
  ------------------
  584|     10|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     10|# define EXFLAG_INVALID          0x80
  ------------------
  585|     10|    }
  586|       |
  587|       |    /* Handle subject key identifier and issuer/authority key identifier */
  588|  1.36k|    x->skid = X509_get_ext_d2i(x, NID_subject_key_identifier, &i, NULL);
  ------------------
  |  | 2657|  1.36k|#define NID_subject_key_identifier              82
  ------------------
  589|  1.36k|    if (x->skid == NULL && i != -1)
  ------------------
  |  Branch (589:9): [True: 644, False: 724]
  |  Branch (589:28): [True: 91, False: 553]
  ------------------
  590|     91|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     91|# define EXFLAG_INVALID          0x80
  ------------------
  591|       |
  592|  1.36k|    x->akid = X509_get_ext_d2i(x, NID_authority_key_identifier, &i, NULL);
  ------------------
  |  | 2742|  1.36k|#define NID_authority_key_identifier            90
  ------------------
  593|  1.36k|    if (x->akid == NULL && i != -1)
  ------------------
  |  Branch (593:9): [True: 752, False: 616]
  |  Branch (593:28): [True: 115, False: 637]
  ------------------
  594|    115|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    115|# define EXFLAG_INVALID          0x80
  ------------------
  595|       |
  596|       |    /* Check if subject name matches issuer */
  597|  1.36k|    if (X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x)) == 0) {
  ------------------
  |  Branch (597:9): [True: 334, False: 1.03k]
  ------------------
  598|    334|        x->ex_flags |= EXFLAG_SI; /* Cert is self-issued */
  ------------------
  |  |  655|    334|# define EXFLAG_SI               0x20 /* self-issued, maybe not self-signed */
  ------------------
  599|    334|        if (X509_check_akid(x, x->akid) == X509_V_OK /* SKID matches AKID */
  ------------------
  |  |  303|    668|# define X509_V_OK                                       0
  ------------------
  |  Branch (599:13): [True: 252, False: 82]
  ------------------
  600|       |                /* .. and the signature alg matches the PUBKEY alg: */
  601|    334|                && check_sig_alg_match(X509_get0_pubkey(x), x) == X509_V_OK)
  ------------------
  |  |  303|    252|# define X509_V_OK                                       0
  ------------------
  |  Branch (601:20): [True: 152, False: 100]
  ------------------
  602|    152|            x->ex_flags |= EXFLAG_SS; /* indicate self-signed */
  ------------------
  |  |  665|    152|# define EXFLAG_SS               0x2000 /* cert is apparently self-signed */
  ------------------
  603|       |        /* This is very related to ossl_x509_likely_issued(x, x) == X509_V_OK */
  604|    334|    }
  605|       |
  606|       |    /* Handle subject alternative names and various other extensions */
  607|  1.36k|    x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, &i, NULL);
  ------------------
  |  | 2672|  1.36k|#define NID_subject_alt_name            85
  ------------------
  608|  1.36k|    if (x->altname == NULL && i != -1)
  ------------------
  |  Branch (608:9): [True: 1.26k, False: 101]
  |  Branch (608:31): [True: 37, False: 1.23k]
  ------------------
  609|     37|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     37|# define EXFLAG_INVALID          0x80
  ------------------
  610|  1.36k|    x->nc = X509_get_ext_d2i(x, NID_name_constraints, &i, NULL);
  ------------------
  |  | 2717|  1.36k|#define NID_name_constraints            666
  ------------------
  611|  1.36k|    if (x->nc == NULL && i != -1)
  ------------------
  |  Branch (611:9): [True: 1.36k, False: 8]
  |  Branch (611:26): [True: 24, False: 1.33k]
  ------------------
  612|     24|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     24|# define EXFLAG_INVALID          0x80
  ------------------
  613|       |
  614|       |    /* Handle CRL distribution point entries */
  615|  1.36k|    res = setup_crldp(x);
  616|  1.36k|    if (res == 0)
  ------------------
  |  Branch (616:9): [True: 113, False: 1.25k]
  ------------------
  617|    113|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    113|# define EXFLAG_INVALID          0x80
  ------------------
  618|       |
  619|  1.36k|#ifndef OPENSSL_NO_RFC3779
  620|  1.36k|    x->rfc3779_addr = X509_get_ext_d2i(x, NID_sbgp_ipAddrBlock, &i, NULL);
  ------------------
  |  | 1603|  1.36k|#define NID_sbgp_ipAddrBlock            290
  ------------------
  621|  1.36k|    if (x->rfc3779_addr == NULL && i != -1)
  ------------------
  |  Branch (621:9): [True: 1.36k, False: 7]
  |  Branch (621:36): [True: 8, False: 1.35k]
  ------------------
  622|      8|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      8|# define EXFLAG_INVALID          0x80
  ------------------
  623|  1.36k|    x->rfc3779_asid = X509_get_ext_d2i(x, NID_sbgp_autonomousSysNum, &i, NULL);
  ------------------
  |  | 1607|  1.36k|#define NID_sbgp_autonomousSysNum               291
  ------------------
  624|  1.36k|    if (x->rfc3779_asid == NULL && i != -1)
  ------------------
  |  Branch (624:9): [True: 1.36k, False: 3]
  |  Branch (624:36): [True: 5, False: 1.36k]
  ------------------
  625|      5|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      5|# define EXFLAG_INVALID          0x80
  ------------------
  626|  1.36k|#endif
  627|  5.68k|    for (i = 0; i < X509_get_ext_count(x); i++) {
  ------------------
  |  Branch (627:17): [True: 4.83k, False: 854]
  ------------------
  628|  4.83k|        X509_EXTENSION *ex = X509_get_ext(x, i);
  629|  4.83k|        int nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
  630|       |
  631|  4.83k|        if (nid == NID_freshest_crl)
  ------------------
  |  | 2782|  4.83k|#define NID_freshest_crl                857
  ------------------
  |  Branch (631:13): [True: 37, False: 4.79k]
  ------------------
  632|     37|            x->ex_flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  664|     37|# define EXFLAG_FRESHEST         0x1000
  ------------------
  633|  4.83k|        if (!X509_EXTENSION_get_critical(ex))
  ------------------
  |  Branch (633:13): [True: 3.20k, False: 1.63k]
  ------------------
  634|  3.20k|            continue;
  635|  1.63k|        if (!X509_supported_extension(ex)) {
  ------------------
  |  Branch (635:13): [True: 514, False: 1.11k]
  ------------------
  636|    514|            x->ex_flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|    514|# define EXFLAG_CRITICAL         0x200
  ------------------
  637|    514|            break;
  638|    514|        }
  639|  1.11k|        switch (nid) {
  640|    490|        case NID_basic_constraints:
  ------------------
  |  | 2682|    490|#define NID_basic_constraints           87
  ------------------
  |  Branch (640:9): [True: 490, False: 626]
  ------------------
  641|    490|            x->ex_flags |= EXFLAG_BCONS_CRITICAL;
  ------------------
  |  |  667|    490|# define EXFLAG_BCONS_CRITICAL   0x10000
  ------------------
  642|    490|            break;
  643|      0|        case NID_authority_key_identifier:
  ------------------
  |  | 2742|      0|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (643:9): [True: 0, False: 1.11k]
  ------------------
  644|      0|            x->ex_flags |= EXFLAG_AKID_CRITICAL;
  ------------------
  |  |  668|      0|# define EXFLAG_AKID_CRITICAL    0x20000
  ------------------
  645|      0|            break;
  646|      0|        case NID_subject_key_identifier:
  ------------------
  |  | 2657|      0|#define NID_subject_key_identifier              82
  ------------------
  |  Branch (646:9): [True: 0, False: 1.11k]
  ------------------
  647|      0|            x->ex_flags |= EXFLAG_SKID_CRITICAL;
  ------------------
  |  |  669|      0|# define EXFLAG_SKID_CRITICAL    0x40000
  ------------------
  648|      0|            break;
  649|     18|        case NID_subject_alt_name:
  ------------------
  |  | 2672|     18|#define NID_subject_alt_name            85
  ------------------
  |  Branch (649:9): [True: 18, False: 1.09k]
  ------------------
  650|     18|            x->ex_flags |= EXFLAG_SAN_CRITICAL;
  ------------------
  |  |  670|     18|# define EXFLAG_SAN_CRITICAL     0x80000
  ------------------
  651|     18|            break;
  652|    608|        default:
  ------------------
  |  Branch (652:9): [True: 608, False: 508]
  ------------------
  653|    608|            break;
  654|  1.11k|        }
  655|  1.11k|    }
  656|       |
  657|       |    /* Set x->siginf, ignoring errors due to unsupported algos */
  658|  1.36k|    (void)ossl_x509_init_sig_info(x);
  659|       |
  660|  1.36k|    x->ex_flags |= EXFLAG_SET; /* Indicate that cert has been processed */
  ------------------
  |  |  659|  1.36k|# define EXFLAG_SET              0x100
  ------------------
  661|  1.36k|#ifdef tsan_st_rel
  662|  1.36k|    tsan_st_rel((TSAN_QUALIFIER int *)&x->ex_cached, 1);
  ------------------
  |  |   65|  1.36k|#   define tsan_st_rel(ptr, val) atomic_store_explicit((ptr), (val), memory_order_release)
  ------------------
  663|       |    /*
  664|       |     * Above store triggers fast lock-free check in the beginning of the
  665|       |     * function. But one has to ensure that the structure is "stable", i.e.
  666|       |     * all stores are visible on all processors. Hence the release fence.
  667|       |     */
  668|  1.36k|#endif
  669|  1.36k|    ERR_pop_to_mark();
  670|       |
  671|  1.36k|    if ((x->ex_flags & EXFLAG_INVALID) == 0) {
  ------------------
  |  |  657|  1.36k|# define EXFLAG_INVALID          0x80
  ------------------
  |  Branch (671:9): [True: 940, False: 428]
  ------------------
  672|    940|        CRYPTO_THREAD_unlock(x->lock);
  673|    940|        return 1;
  674|    940|    }
  675|    428|    CRYPTO_THREAD_unlock(x->lock);
  676|    428|    ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE);
  ------------------
  |  |  401|    428|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    428|    (ERR_new(),                                                 \
  |  |  |  |  404|    428|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    428|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    428|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    428|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    428|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|    428|    return 0;
  678|  1.36k|}
X509_check_issued:
  993|  5.92k|{
  994|  5.92k|    int ret;
  995|       |
  996|  5.92k|    if ((ret = ossl_x509_likely_issued(issuer, subject)) != X509_V_OK)
  ------------------
  |  |  303|  5.92k|# define X509_V_OK                                       0
  ------------------
  |  Branch (996:9): [True: 5.43k, False: 495]
  ------------------
  997|  5.43k|        return ret;
  998|    495|    return ossl_x509_signing_allowed(issuer, subject);
  999|  5.92k|}
ossl_x509_likely_issued:
 1003|  5.92k|{
 1004|  5.92k|    int ret;
 1005|       |
 1006|  5.92k|    if (X509_NAME_cmp(X509_get_subject_name(issuer),
  ------------------
  |  Branch (1006:9): [True: 4.52k, False: 1.40k]
  ------------------
 1007|  5.92k|                      X509_get_issuer_name(subject)) != 0)
 1008|  4.52k|        return X509_V_ERR_SUBJECT_ISSUER_MISMATCH;
  ------------------
  |  |  334|  4.52k|# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH              29
  ------------------
 1009|       |
 1010|       |    /* set issuer->skid and subject->akid */
 1011|  1.40k|    if (!ossl_x509v3_cache_extensions(issuer)
  ------------------
  |  Branch (1011:9): [True: 388, False: 1.01k]
  ------------------
 1012|  1.40k|            || !ossl_x509v3_cache_extensions(subject))
  ------------------
  |  Branch (1012:16): [True: 0, False: 1.01k]
  ------------------
 1013|    388|        return X509_V_ERR_UNSPECIFIED;
  ------------------
  |  |  304|    388|# define X509_V_ERR_UNSPECIFIED                          1
  ------------------
 1014|       |
 1015|  1.01k|    ret = X509_check_akid(issuer, subject->akid);
 1016|  1.01k|    if (ret != X509_V_OK)
  ------------------
  |  |  303|  1.01k|# define X509_V_OK                                       0
  ------------------
  |  Branch (1016:9): [True: 237, False: 775]
  ------------------
 1017|    237|        return ret;
 1018|       |
 1019|       |    /* Check if the subject signature alg matches the issuer's PUBKEY alg */
 1020|    775|    return check_sig_alg_match(X509_get0_pubkey(issuer), subject);
 1021|  1.01k|}
ossl_x509_signing_allowed:
 1031|    495|{
 1032|    495|    if ((subject->ex_flags & EXFLAG_PROXY) != 0) {
  ------------------
  |  |  661|    495|# define EXFLAG_PROXY            0x400
  ------------------
  |  Branch (1032:9): [True: 0, False: 495]
  ------------------
 1033|      0|        if (ku_reject(issuer, KU_DIGITAL_SIGNATURE))
  ------------------
  |  |  426|      0|    (((x)->ex_flags & EXFLAG_KUSAGE) != 0 && ((x)->ex_kusage & (usage)) == 0)
  |  |  ------------------
  |  |  |  |  650|      0|# define EXFLAG_KUSAGE           0x2
  |  |  ------------------
  |  |  |  Branch (426:6): [True: 0, False: 0]
  |  |  |  Branch (426:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1034|      0|            return X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE;
  ------------------
  |  |  344|      0|# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE        39
  ------------------
 1035|    495|    } else if (ku_reject(issuer, KU_KEY_CERT_SIGN)) {
  ------------------
  |  |  426|    495|    (((x)->ex_flags & EXFLAG_KUSAGE) != 0 && ((x)->ex_kusage & (usage)) == 0)
  |  |  ------------------
  |  |  |  |  650|    495|# define EXFLAG_KUSAGE           0x2
  |  |  ------------------
  |  |  |  Branch (426:6): [True: 258, False: 237]
  |  |  |  Branch (426:46): [True: 20, False: 238]
  |  |  ------------------
  ------------------
 1036|     20|        return X509_V_ERR_KEYUSAGE_NO_CERTSIGN;
  ------------------
  |  |  337|     20|# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN                 32
  ------------------
 1037|     20|    }
 1038|    475|    return X509_V_OK;
  ------------------
  |  |  303|    475|# define X509_V_OK                                       0
  ------------------
 1039|    495|}
X509_check_akid:
 1042|  1.34k|{
 1043|  1.34k|    if (akid == NULL)
  ------------------
  |  Branch (1043:9): [True: 496, False: 850]
  ------------------
 1044|    496|        return X509_V_OK;
  ------------------
  |  |  303|    496|# define X509_V_OK                                       0
  ------------------
 1045|       |
 1046|       |    /* Check key ids (if present) */
 1047|    850|    if (akid->keyid && issuer->skid &&
  ------------------
  |  Branch (1047:9): [True: 740, False: 110]
  |  Branch (1047:24): [True: 654, False: 86]
  ------------------
 1048|    850|        ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid))
  ------------------
  |  Branch (1048:9): [True: 229, False: 425]
  ------------------
 1049|    229|        return X509_V_ERR_AKID_SKID_MISMATCH;
  ------------------
  |  |  335|    229|# define X509_V_ERR_AKID_SKID_MISMATCH                   30
  ------------------
 1050|       |    /* Check serial number */
 1051|    621|    if (akid->serial &&
  ------------------
  |  Branch (1051:9): [True: 90, False: 531]
  ------------------
 1052|    621|        ASN1_INTEGER_cmp(X509_get0_serialNumber(issuer), akid->serial))
  ------------------
  |  Branch (1052:9): [True: 90, False: 0]
  ------------------
 1053|     90|        return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  ------------------
  |  |  336|     90|# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH          31
  ------------------
 1054|       |    /* Check issuer name */
 1055|    531|    if (akid->issuer) {
  ------------------
  |  Branch (1055:9): [True: 0, False: 531]
  ------------------
 1056|       |        /*
 1057|       |         * Ugh, for some peculiar reason AKID includes SEQUENCE OF
 1058|       |         * GeneralName. So look for a DirName. There may be more than one but
 1059|       |         * we only take any notice of the first.
 1060|       |         */
 1061|      0|        GENERAL_NAMES *gens = akid->issuer;
 1062|      0|        GENERAL_NAME *gen;
 1063|      0|        X509_NAME *nm = NULL;
 1064|      0|        int i;
 1065|       |
 1066|      0|        for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
  ------------------
  |  |  238|      0|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (1066:21): [True: 0, False: 0]
  ------------------
 1067|      0|            gen = sk_GENERAL_NAME_value(gens, i);
  ------------------
  |  |  239|      0|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
 1068|      0|            if (gen->type == GEN_DIRNAME) {
  ------------------
  |  |  177|      0|# define GEN_DIRNAME     4
  ------------------
  |  Branch (1068:17): [True: 0, False: 0]
  ------------------
 1069|      0|                nm = gen->d.dirn;
 1070|      0|                break;
 1071|      0|            }
 1072|      0|        }
 1073|      0|        if (nm != NULL && X509_NAME_cmp(nm, X509_get_issuer_name(issuer)) != 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 0]
  |  Branch (1073:27): [True: 0, False: 0]
  ------------------
 1074|      0|            return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  ------------------
  |  |  336|      0|# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH          31
  ------------------
 1075|      0|    }
 1076|    531|    return X509_V_OK;
  ------------------
  |  |  303|    531|# define X509_V_OK                                       0
  ------------------
 1077|    531|}
X509_get_key_usage:
 1087|    755|{
 1088|       |    /* Call for side-effect of computing hash and caching extensions */
 1089|    755|    if (X509_check_purpose(x, -1, 0) != 1)
  ------------------
  |  Branch (1089:9): [True: 0, False: 755]
  ------------------
 1090|      0|        return 0;
 1091|    755|    return (x->ex_flags & EXFLAG_KUSAGE) != 0 ? x->ex_kusage : UINT32_MAX;
  ------------------
  |  |  650|    755|# define EXFLAG_KUSAGE           0x2
  ------------------
  |  Branch (1091:12): [True: 131, False: 624]
  ------------------
 1092|    755|}
X509_get0_subject_key_id:
 1103|    853|{
 1104|       |    /* Call for side-effect of computing hash and caching extensions */
 1105|    853|    if (X509_check_purpose(x, -1, 0) != 1)
  ------------------
  |  Branch (1105:9): [True: 67, False: 786]
  ------------------
 1106|     67|        return NULL;
 1107|    786|    return x->skid;
 1108|    853|}
v3_purp.c:nid_cmp:
  302|  3.82k|{
  303|  3.82k|    return *a - *b;
  304|  3.82k|}
v3_purp.c:check_sig_alg_match:
  410|  1.02k|{
  411|  1.02k|    int subj_sig_nid;
  412|       |
  413|  1.02k|    if (issuer_key == NULL)
  ------------------
  |  Branch (413:9): [True: 271, False: 756]
  ------------------
  414|    271|        return X509_V_ERR_NO_ISSUER_PUBLIC_KEY;
  ------------------
  |  |  327|    271|# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY                 24
  ------------------
  415|    756|    if (OBJ_find_sigid_algs(OBJ_obj2nid(subject->cert_info.signature.algorithm),
  ------------------
  |  Branch (415:9): [True: 96, False: 660]
  ------------------
  416|    756|                            NULL, &subj_sig_nid) == 0)
  417|     96|        return X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM;
  ------------------
  |  |  393|     96|# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM      76
  ------------------
  418|    660|    if (EVP_PKEY_is_a(issuer_key, OBJ_nid2sn(subj_sig_nid))
  ------------------
  |  Branch (418:9): [True: 639, False: 21]
  ------------------
  419|    660|        || (EVP_PKEY_is_a(issuer_key, "RSA") && subj_sig_nid == NID_rsassaPss))
  ------------------
  |  |  583|     15|#define NID_rsassaPss           912
  ------------------
  |  Branch (419:13): [True: 15, False: 6]
  |  Branch (419:49): [True: 8, False: 7]
  ------------------
  420|    647|        return X509_V_OK;
  ------------------
  |  |  303|    647|# define X509_V_OK                                       0
  ------------------
  421|     13|    return X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH;
  ------------------
  |  |  394|     13|# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH         77
  ------------------
  422|    660|}
v3_purp.c:setup_crldp:
  392|  1.36k|{
  393|  1.36k|    int i;
  394|       |
  395|  1.36k|    x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, &i, NULL);
  ------------------
  |  | 2722|  1.36k|#define NID_crl_distribution_points             103
  ------------------
  396|  1.36k|    if (x->crldp == NULL && i != -1)
  ------------------
  |  Branch (396:9): [True: 1.24k, False: 123]
  |  Branch (396:29): [True: 112, False: 1.13k]
  ------------------
  397|    112|        return 0;
  398|       |
  399|  1.37k|    for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) {
  ------------------
  |  |  331|  1.37k|#define sk_DIST_POINT_num(sk) OPENSSL_sk_num(ossl_check_const_DIST_POINT_sk_type(sk))
  ------------------
  |  Branch (399:17): [True: 119, False: 1.25k]
  ------------------
  400|    119|        int res = setup_dp(x, sk_DIST_POINT_value(x->crldp, i));
  ------------------
  |  |  332|    119|#define sk_DIST_POINT_value(sk, idx) ((DIST_POINT *)OPENSSL_sk_value(ossl_check_const_DIST_POINT_sk_type(sk), (idx)))
  ------------------
  401|       |
  402|    119|        if (res < 1)
  ------------------
  |  Branch (402:13): [True: 1, False: 118]
  ------------------
  403|      1|            return res;
  404|    119|    }
  405|  1.25k|    return 1;
  406|  1.25k|}
v3_purp.c:setup_dp:
  350|    119|{
  351|    119|    const X509_NAME *iname = NULL;
  352|    119|    int i;
  353|       |
  354|    119|    if (dp->distpoint == NULL && sk_GENERAL_NAME_num(dp->CRLissuer) <= 0) {
  ------------------
  |  |  238|      2|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (354:9): [True: 2, False: 117]
  |  Branch (354:34): [True: 1, False: 1]
  ------------------
  355|      1|        ERR_raise(ERR_LIB_X509, X509_R_INVALID_DISTPOINT);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  356|      1|        return 0;
  357|      1|    }
  358|    118|    if (dp->reasons != NULL) {
  ------------------
  |  Branch (358:9): [True: 0, False: 118]
  ------------------
  359|      0|        if (dp->reasons->length > 0)
  ------------------
  |  Branch (359:13): [True: 0, False: 0]
  ------------------
  360|      0|            dp->dp_reasons = dp->reasons->data[0];
  361|      0|        if (dp->reasons->length > 1)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  ------------------
  362|      0|            dp->dp_reasons |= (dp->reasons->data[1] << 8);
  363|      0|        dp->dp_reasons &= CRLDP_ALL_REASONS;
  ------------------
  |  |  309|      0|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  364|    118|    } else {
  365|    118|        dp->dp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  309|    118|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  366|    118|    }
  367|    118|    if (dp->distpoint == NULL || dp->distpoint->type != 1)
  ------------------
  |  Branch (367:9): [True: 1, False: 117]
  |  Branch (367:34): [True: 117, False: 0]
  ------------------
  368|    118|        return 1;
  369|       |
  370|       |    /* Handle name fragment given by nameRelativeToCRLIssuer */
  371|       |    /*
  372|       |     * Note that the below way of determining iname is not really compliant
  373|       |     * with https://tools.ietf.org/html/rfc5280#section-4.2.1.13
  374|       |     * According to it, sk_GENERAL_NAME_num(dp->CRLissuer) MUST be <= 1
  375|       |     * and any CRLissuer could be of type different to GEN_DIRNAME.
  376|       |     */
  377|      0|    for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) {
  ------------------
  |  |  238|      0|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (377:17): [True: 0, False: 0]
  ------------------
  378|      0|        GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i);
  ------------------
  |  |  239|      0|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
  379|       |
  380|      0|        if (gen->type == GEN_DIRNAME) {
  ------------------
  |  |  177|      0|# define GEN_DIRNAME     4
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  ------------------
  381|      0|            iname = gen->d.directoryName;
  382|      0|            break;
  383|      0|        }
  384|      0|    }
  385|      0|    if (iname == NULL)
  ------------------
  |  Branch (385:9): [True: 0, False: 0]
  ------------------
  386|      0|        iname = X509_get_issuer_name(x);
  387|      0|    return DIST_POINT_set_dpname(dp->distpoint, iname) ? 1 : -1;
  ------------------
  |  Branch (387:12): [True: 0, False: 0]
  ------------------
  388|    118|}

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

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

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|      3|{
   32|      3|    return OPENSSL_strdup("NULL");
  ------------------
  |  |  119|      3|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      3|}

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

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

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

v3_tlsf.c:i2v_TLS_FEATURE:
   63|      3|{
   64|      3|    int i;
   65|      3|    size_t j;
   66|      3|    ASN1_INTEGER *ai;
   67|      3|    long tlsextid;
   68|      3|    for (i = 0; i < sk_ASN1_INTEGER_num(tls_feature); i++) {
  ------------------
  |  |  702|      3|#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
  ------------------
  |  Branch (68:17): [True: 0, False: 3]
  ------------------
   69|      0|        ai = sk_ASN1_INTEGER_value(tls_feature, i);
  ------------------
  |  |  703|      0|#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
  ------------------
   70|      0|        tlsextid = ASN1_INTEGER_get(ai);
   71|      0|        for (j = 0; j < OSSL_NELEM(tls_feature_tbl); j++)
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (71:21): [True: 0, False: 0]
  ------------------
   72|      0|            if (tlsextid == tls_feature_tbl[j].num)
  ------------------
  |  Branch (72:17): [True: 0, False: 0]
  ------------------
   73|      0|                break;
   74|      0|        if (j < OSSL_NELEM(tls_feature_tbl))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (74:13): [True: 0, False: 0]
  ------------------
   75|      0|            X509V3_add_value(NULL, tls_feature_tbl[j].name, &ext_list);
   76|      0|        else
   77|      0|            X509V3_add_value_int(NULL, ai, &ext_list);
   78|      0|    }
   79|      3|    return ext_list;
   80|      3|}

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

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

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

X509_get_issuer_name:
  104|  13.9k|{
  105|  13.9k|    return a->cert_info.issuer;
  106|  13.9k|}
X509_get_subject_name:
  121|  16.2k|{
  122|  16.2k|    return a->cert_info.subject;
  123|  16.2k|}
X509_get0_serialNumber:
  131|    964|{
  132|    964|    return &a->cert_info.serialNumber;
  133|    964|}
X509_cmp:
  156|  9.28k|{
  157|  9.28k|    int rv = 0;
  158|       |
  159|  9.28k|    if (a == b) /* for efficiency */
  ------------------
  |  Branch (159:9): [True: 2.59k, False: 6.69k]
  ------------------
  160|  2.59k|        return 0;
  161|       |
  162|       |    /* attempt to compute cert hash */
  163|  6.69k|    (void)X509_check_purpose((X509 *)a, -1, 0);
  164|  6.69k|    (void)X509_check_purpose((X509 *)b, -1, 0);
  165|       |
  166|  6.69k|    if ((a->ex_flags & EXFLAG_NO_FINGERPRINT) == 0
  ------------------
  |  |  671|  6.69k|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  |  Branch (166:9): [True: 6.69k, False: 0]
  ------------------
  167|  6.69k|            && (b->ex_flags & EXFLAG_NO_FINGERPRINT) == 0)
  ------------------
  |  |  671|  6.69k|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  |  Branch (167:16): [True: 6.69k, False: 0]
  ------------------
  168|  6.69k|        rv = memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
  ------------------
  |  |   26|  6.69k|# define SHA_DIGEST_LENGTH 20
  ------------------
  169|  6.69k|    if (rv != 0)
  ------------------
  |  Branch (169:9): [True: 6.69k, False: 0]
  ------------------
  170|  6.69k|        return rv < 0 ? -1 : 1;
  ------------------
  |  Branch (170:16): [True: 3.19k, False: 3.50k]
  ------------------
  171|       |
  172|       |    /* Check for match against stored encoding too */
  173|      0|    if (!a->cert_info.enc.modified && !b->cert_info.enc.modified) {
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  |  Branch (173:39): [True: 0, False: 0]
  ------------------
  174|      0|        if (a->cert_info.enc.len < b->cert_info.enc.len)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            return -1;
  176|      0|        if (a->cert_info.enc.len > b->cert_info.enc.len)
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|            return 1;
  178|      0|        rv = memcmp(a->cert_info.enc.enc,
  179|      0|                    b->cert_info.enc.enc, a->cert_info.enc.len);
  180|      0|    }
  181|      0|    return rv < 0 ? -1 : rv > 0;
  ------------------
  |  Branch (181:12): [True: 0, False: 0]
  ------------------
  182|      0|}
ossl_x509_add_cert_new:
  185|  1.85k|{
  186|  1.85k|    if (*p_sk == NULL && (*p_sk = sk_X509_new_null()) == NULL) {
  ------------------
  |  |   82|      0|#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (186:9): [True: 0, False: 1.85k]
  |  Branch (186:26): [True: 0, False: 0]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|  1.85k|    return X509_add_cert(*p_sk, cert, flags);
  191|  1.85k|}
X509_add_cert:
  194|  1.85k|{
  195|  1.85k|    if (sk == NULL) {
  ------------------
  |  Branch (195:9): [True: 0, False: 1.85k]
  ------------------
  196|      0|        ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|        return 0;
  198|      0|    }
  199|  1.85k|    if (cert == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 1.85k]
  ------------------
  200|      0|        return 0;
  201|  1.85k|    if ((flags & X509_ADD_FLAG_NO_DUP) != 0) {
  ------------------
  |  | 1000|  1.85k|# define X509_ADD_FLAG_NO_DUP   0x4
  ------------------
  |  Branch (201:9): [True: 1.85k, False: 0]
  ------------------
  202|       |        /*
  203|       |         * not using sk_X509_set_cmp_func() and sk_X509_find()
  204|       |         * because this re-orders the certs on the stack
  205|       |         */
  206|  1.85k|        int i;
  207|       |
  208|  4.36k|        for (i = 0; i < sk_X509_num(sk); i++) {
  ------------------
  |  |   79|  4.36k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  |  Branch (208:21): [True: 2.50k, False: 1.85k]
  ------------------
  209|  2.50k|            if (X509_cmp(sk_X509_value(sk, i), cert) == 0)
  ------------------
  |  |   80|  2.50k|#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
  ------------------
  |  Branch (209:17): [True: 0, False: 2.50k]
  ------------------
  210|      0|                return 1;
  211|  2.50k|        }
  212|  1.85k|    }
  213|  1.85k|    if ((flags & X509_ADD_FLAG_NO_SS) != 0) {
  ------------------
  |  | 1001|  1.85k|# define X509_ADD_FLAG_NO_SS    0x8
  ------------------
  |  Branch (213:9): [True: 0, False: 1.85k]
  ------------------
  214|      0|        int ret = X509_self_signed(cert, 0);
  215|       |
  216|      0|        if (ret != 0)
  ------------------
  |  Branch (216:13): [True: 0, False: 0]
  ------------------
  217|      0|            return ret > 0 ? 1 : 0;
  ------------------
  |  Branch (217:20): [True: 0, False: 0]
  ------------------
  218|      0|    }
  219|  1.85k|    if ((flags & X509_ADD_FLAG_UP_REF) != 0 && !X509_up_ref(cert))
  ------------------
  |  |  998|  1.85k|# define X509_ADD_FLAG_UP_REF   0x1
  ------------------
  |  Branch (219:9): [True: 1.85k, False: 0]
  |  Branch (219:48): [True: 0, False: 1.85k]
  ------------------
  220|      0|        return 0;
  221|  1.85k|    if (!sk_X509_insert(sk, cert,
  ------------------
  |  |   94|  3.71k|#define sk_X509_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), (idx))
  |  |  ------------------
  |  |  |  Branch (94:113): [True: 1.85k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (221:9): [True: 0, False: 1.85k]
  ------------------
  222|  1.85k|                        (flags & X509_ADD_FLAG_PREPEND) != 0 ? 0 : -1)) {
  223|      0|        if ((flags & X509_ADD_FLAG_UP_REF) != 0)
  ------------------
  |  |  998|      0|# define X509_ADD_FLAG_UP_REF   0x1
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|            X509_free(cert);
  225|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|  1.85k|    return 1;
  229|  1.85k|}
ossl_x509_add_certs_new:
  244|  9.30k|{
  245|  9.30k|    int n = sk_X509_num(certs /* may be NULL */);
  ------------------
  |  |   79|  9.30k|#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
  ------------------
  246|  9.30k|    int i;
  247|       |
  248|  11.1k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (248:17): [True: 1.85k, False: 9.30k]
  ------------------
  249|  1.85k|        int j = (flags & X509_ADD_FLAG_PREPEND) == 0 ? i : n - 1 - i;
  ------------------
  |  |  999|  1.85k|# define X509_ADD_FLAG_PREPEND  0x2
  ------------------
  |  Branch (249:17): [True: 0, False: 1.85k]
  ------------------
  250|       |        /* if prepend, add certs in reverse order to keep original order */
  251|       |
  252|  1.85k|        if (!ossl_x509_add_cert_new(p_sk, sk_X509_value(certs, j), flags))
  ------------------
  |  |   80|  1.85k|#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
  ------------------
  |  Branch (252:13): [True: 0, False: 1.85k]
  ------------------
  253|      0|            return 0;
  254|  1.85k|    }
  255|  9.30k|    return 1;
  256|  9.30k|}
X509_NAME_cmp:
  259|  9.29k|{
  260|  9.29k|    int ret;
  261|       |
  262|  9.29k|    if (b == NULL)
  ------------------
  |  Branch (262:9): [True: 0, False: 9.29k]
  ------------------
  263|      0|        return a != NULL;
  264|  9.29k|    if (a == NULL)
  ------------------
  |  Branch (264:9): [True: 0, False: 9.29k]
  ------------------
  265|      0|        return -1;
  266|       |
  267|       |    /* Ensure canonical encoding is present and up to date */
  268|  9.29k|    if (a->canon_enc == NULL || a->modified) {
  ------------------
  |  Branch (268:9): [True: 8, False: 9.28k]
  |  Branch (268:33): [True: 0, False: 9.28k]
  ------------------
  269|      8|        ret = i2d_X509_NAME((X509_NAME *)a, NULL);
  270|      8|        if (ret < 0)
  ------------------
  |  Branch (270:13): [True: 0, False: 8]
  ------------------
  271|      0|            return -2;
  272|      8|    }
  273|       |
  274|  9.29k|    if (b->canon_enc == NULL || b->modified) {
  ------------------
  |  Branch (274:9): [True: 10, False: 9.28k]
  |  Branch (274:33): [True: 0, False: 9.28k]
  ------------------
  275|     10|        ret = i2d_X509_NAME((X509_NAME *)b, NULL);
  276|     10|        if (ret < 0)
  ------------------
  |  Branch (276:13): [True: 0, False: 10]
  ------------------
  277|      0|            return -2;
  278|     10|    }
  279|       |
  280|  9.29k|    ret = a->canon_enclen - b->canon_enclen;
  281|  9.29k|    if (ret == 0 && a->canon_enclen == 0)
  ------------------
  |  Branch (281:9): [True: 4.42k, False: 4.87k]
  |  Branch (281:21): [True: 0, False: 4.42k]
  ------------------
  282|      0|        return 0;
  283|       |
  284|  9.29k|    if (ret == 0) {
  ------------------
  |  Branch (284:9): [True: 4.42k, False: 4.87k]
  ------------------
  285|  4.42k|        if (a->canon_enc == NULL || b->canon_enc == NULL)
  ------------------
  |  Branch (285:13): [True: 0, False: 4.42k]
  |  Branch (285:37): [True: 0, False: 4.42k]
  ------------------
  286|      0|            return -2;
  287|  4.42k|        ret = memcmp(a->canon_enc, b->canon_enc, a->canon_enclen);
  288|  4.42k|    }
  289|       |
  290|  9.29k|    return ret < 0 ? -1 : ret > 0;
  ------------------
  |  Branch (290:12): [True: 4.04k, False: 5.24k]
  ------------------
  291|  9.29k|}
X509_get0_pubkey:
  386|  1.33k|{
  387|  1.33k|    if (x == NULL)
  ------------------
  |  Branch (387:9): [True: 0, False: 1.33k]
  ------------------
  388|      0|        return NULL;
  389|  1.33k|    return X509_PUBKEY_get0(x->cert_info.key);
  390|  1.33k|}
X509_get_pubkey:
  393|    647|{
  394|    647|    if (x == NULL)
  ------------------
  |  Branch (394:9): [True: 0, False: 647]
  ------------------
  395|      0|        return NULL;
  396|    647|    return X509_PUBKEY_get(x->cert_info.key);
  397|    647|}

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_get_ext_count:
   67|  5.68k|{
   68|  5.68k|    return X509v3_get_ext_count(x->cert_info.extensions);
   69|  5.68k|}
X509_get_ext_by_NID:
   72|     24|{
   73|     24|    return X509v3_get_ext_by_NID(x->cert_info.extensions, nid, lastpos);
   74|     24|}
X509_get_ext:
   88|  4.83k|{
   89|  4.83k|    return X509v3_get_ext(x->cert_info.extensions, loc);
   90|  4.83k|}
X509_get_ext_d2i:
  103|  16.4k|{
  104|  16.4k|    return X509V3_get_d2i(x->cert_info.extensions, nid, crit, idx);
  105|  16.4k|}

X509_STORE_free:
  227|  13.8k|{
  228|  13.8k|    int i;
  229|  13.8k|    STACK_OF(X509_LOOKUP) *sk;
  ------------------
  |  |   31|  13.8k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  230|  13.8k|    X509_LOOKUP *lu;
  231|       |
  232|  13.8k|    if (xs == NULL)
  ------------------
  |  Branch (232:9): [True: 13.8k, False: 0]
  ------------------
  233|  13.8k|        return;
  234|      0|    CRYPTO_DOWN_REF(&xs->references, &i);
  235|      0|    REF_PRINT_COUNT("X509_STORE", i, xs);
  ------------------
  |  |  301|      0|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      0|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|      0|    if (i > 0)
  ------------------
  |  Branch (236:9): [True: 0, False: 0]
  ------------------
  237|      0|        return;
  238|      0|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|      0|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  239|       |
  240|      0|    sk = xs->get_cert_methods;
  241|      0|    for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
  ------------------
  |  |   69|      0|#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
  ------------------
  |  Branch (241:17): [True: 0, False: 0]
  ------------------
  242|      0|        lu = sk_X509_LOOKUP_value(sk, i);
  ------------------
  |  |   70|      0|#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
  ------------------
  243|      0|        X509_LOOKUP_shutdown(lu);
  244|      0|        X509_LOOKUP_free(lu);
  245|      0|    }
  246|      0|    sk_X509_LOOKUP_free(sk);
  ------------------
  |  |   75|      0|#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
  ------------------
  247|      0|    sk_X509_OBJECT_pop_free(xs->objs, X509_OBJECT_free);
  ------------------
  |  |  109|      0|#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_freefunc_type(freefunc))
  ------------------
  248|       |
  249|      0|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, xs, &xs->ex_data);
  ------------------
  |  |  233|      0|# define CRYPTO_EX_INDEX_X509_STORE       4
  ------------------
  250|      0|    X509_VERIFY_PARAM_free(xs->param);
  251|      0|    CRYPTO_THREAD_lock_free(xs->lock);
  252|      0|    CRYPTO_FREE_REF(&xs->references);
  253|      0|    OPENSSL_free(xs);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|      0|}

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

X509_REQ_get0_pubkey:
   71|    604|{
   72|    604|    if (req == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 604]
  ------------------
   73|      0|        return NULL;
   74|    604|    return X509_PUBKEY_get0(req->req_info.pubkey);
   75|    604|}
X509_REQ_get_version:
  308|    604|{
  309|    604|    return ASN1_INTEGER_get(req->req_info.version);
  310|    604|}

X509_set_serialNumber:
   45|  6.94k|{
   46|  6.94k|    ASN1_INTEGER *in;
   47|       |
   48|  6.94k|    if (x == NULL)
  ------------------
  |  Branch (48:9): [True: 0, False: 6.94k]
  ------------------
   49|      0|        return 0;
   50|  6.94k|    in = &x->cert_info.serialNumber;
   51|  6.94k|    if (in != serial)
  ------------------
  |  Branch (51:9): [True: 6.94k, False: 0]
  ------------------
   52|  6.94k|        return ASN1_STRING_copy(in, serial);
   53|      0|    x->cert_info.enc.modified = 1;
   54|      0|    return 1;
   55|  6.94k|}
X509_set_issuer_name:
   58|  6.94k|{
   59|  6.94k|    if (x == NULL || !X509_NAME_set(&x->cert_info.issuer, name))
  ------------------
  |  Branch (59:9): [True: 0, False: 6.94k]
  |  Branch (59:22): [True: 0, False: 6.94k]
  ------------------
   60|      0|        return 0;
   61|  6.94k|    x->cert_info.enc.modified = 1;
   62|  6.94k|    return 1;
   63|  6.94k|}
X509_up_ref:
  116|  1.85k|{
  117|  1.85k|    int i;
  118|       |
  119|  1.85k|    if (CRYPTO_UP_REF(&x->references, &i) <= 0)
  ------------------
  |  Branch (119:9): [True: 0, False: 1.85k]
  ------------------
  120|      0|        return 0;
  121|       |
  122|  1.85k|    REF_PRINT_COUNT("X509", i, x);
  ------------------
  |  |  301|  1.85k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  1.85k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  1.85k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  1.85k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|  1.85k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  1.85k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 1.85k]
  |  |  ------------------
  ------------------
  124|  1.85k|    return i > 1;
  125|  1.85k|}
X509_get_version:
  128|  1.36k|{
  129|  1.36k|    return ASN1_INTEGER_get(x->cert_info.version);
  130|  1.36k|}
X509_get0_notBefore:
  133|  4.07k|{
  134|  4.07k|    return x->cert_info.validity.notBefore;
  135|  4.07k|}
X509_get0_notAfter:
  138|  4.07k|{
  139|  4.07k|    return x->cert_info.validity.notAfter;
  140|  4.07k|}
X509_get0_extensions:
  163|  1.04k|{
  164|  1.04k|    return x->cert_info.extensions;
  165|  1.04k|}
X509_SIG_INFO_set:
  197|      4|{
  198|      4|    siginf->mdnid = mdnid;
  199|      4|    siginf->pknid = pknid;
  200|      4|    siginf->secbits = secbits;
  201|      4|    siginf->flags = flags;
  202|      4|}
ossl_x509_init_sig_info:
  301|  1.36k|{
  302|  1.36k|    return x509_sig_info_init(&x->siginf, &x->sig_alg, &x->signature,
  303|  1.36k|                              X509_PUBKEY_get0(x->cert_info.key));
  304|  1.36k|}
x509_set.c:x509_sig_info_init:
  214|  1.36k|{
  215|  1.36k|    int pknid, mdnid, md_size;
  216|  1.36k|    const EVP_MD *md;
  217|  1.36k|    const EVP_PKEY_ASN1_METHOD *ameth;
  218|       |
  219|  1.36k|    siginf->mdnid = NID_undef;
  ------------------
  |  |   18|  1.36k|#define NID_undef                       0
  ------------------
  220|  1.36k|    siginf->pknid = NID_undef;
  ------------------
  |  |   18|  1.36k|#define NID_undef                       0
  ------------------
  221|  1.36k|    siginf->secbits = -1;
  222|  1.36k|    siginf->flags = 0;
  223|  1.36k|    if (!OBJ_find_sigid_algs(OBJ_obj2nid(alg->algorithm), &mdnid, &pknid)
  ------------------
  |  Branch (223:9): [True: 448, False: 920]
  ------------------
  224|  1.36k|            || pknid == NID_undef) {
  ------------------
  |  |   18|    920|#define NID_undef                       0
  ------------------
  |  Branch (224:16): [True: 0, False: 920]
  ------------------
  225|    448|        ERR_raise(ERR_LIB_X509, X509_R_UNKNOWN_SIGID_ALGS);
  ------------------
  |  |  401|    448|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    448|    (ERR_new(),                                                 \
  |  |  |  |  404|    448|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    448|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    448|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    448|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    448|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|    448|        return 0;
  227|    448|    }
  228|    920|    siginf->mdnid = mdnid;
  229|    920|    siginf->pknid = pknid;
  230|       |
  231|    920|    switch (mdnid) {
  232|     47|    case NID_undef:
  ------------------
  |  |   18|     47|#define NID_undef                       0
  ------------------
  |  Branch (232:5): [True: 47, False: 873]
  ------------------
  233|       |        /* If we have one, use a custom handler for this algorithm */
  234|     47|        ameth = EVP_PKEY_asn1_find(NULL, pknid);
  235|     47|        if (ameth != NULL && ameth->siginf_set != NULL
  ------------------
  |  Branch (235:13): [True: 45, False: 2]
  |  Branch (235:30): [True: 45, False: 0]
  ------------------
  236|     47|                && ameth->siginf_set(siginf, alg, sig))
  ------------------
  |  Branch (236:20): [True: 4, False: 41]
  ------------------
  237|      4|           break;
  238|     43|        if (pubkey != NULL) {
  ------------------
  |  Branch (238:13): [True: 8, False: 35]
  ------------------
  239|      8|            int secbits;
  240|       |
  241|      8|            secbits = EVP_PKEY_get_security_bits(pubkey);
  242|      8|            if (secbits != 0) {
  ------------------
  |  Branch (242:17): [True: 7, False: 1]
  ------------------
  243|      7|                siginf->secbits = secbits;
  244|      7|                break;
  245|      7|            }
  246|      8|        }
  247|     43|        ERR_raise(ERR_LIB_X509, X509_R_ERROR_USING_SIGINF_SET);
  ------------------
  |  |  401|     36|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     36|    (ERR_new(),                                                 \
  |  |  |  |  404|     36|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     36|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     36|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     36|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     36|     ERR_set_error)
  |  |  ------------------
  ------------------
  248|     36|        return 0;
  249|       |        /*
  250|       |         * SHA1 and MD5 are known to be broken. Reduce security bits so that
  251|       |         * they're no longer accepted at security level 1.
  252|       |         * The real values don't really matter as long as they're lower than 80,
  253|       |         * which is our security level 1.
  254|       |         */
  255|    471|    case NID_sha1:
  ------------------
  |  | 2321|    471|#define NID_sha1                64
  ------------------
  |  Branch (255:5): [True: 471, False: 449]
  ------------------
  256|       |        /*
  257|       |         * https://eprint.iacr.org/2020/014 puts a chosen-prefix attack
  258|       |         * for SHA1 at2^63.4
  259|       |         */
  260|    471|        siginf->secbits = 63;
  261|    471|        break;
  262|     19|    case NID_md5:
  ------------------
  |  | 1215|     19|#define NID_md5         4
  ------------------
  |  Branch (262:5): [True: 19, False: 901]
  ------------------
  263|       |        /*
  264|       |         * https://documents.epfl.ch/users/l/le/lenstra/public/papers/lat.pdf
  265|       |         * puts a chosen-prefix attack for MD5 at 2^39.
  266|       |         */
  267|     19|        siginf->secbits = 39;
  268|     19|        break;
  269|      0|    case NID_id_GostR3411_94:
  ------------------
  |  | 4546|      0|#define NID_id_GostR3411_94             809
  ------------------
  |  Branch (269:5): [True: 0, False: 920]
  ------------------
  270|       |        /*
  271|       |         * There is a collision attack on GOST R 34.11-94 at 2^105, see
  272|       |         * https://link.springer.com/chapter/10.1007%2F978-3-540-85174-5_10
  273|       |         */
  274|      0|        siginf->secbits = 105;
  275|      0|        break;
  276|    383|    default:
  ------------------
  |  Branch (276:5): [True: 383, False: 537]
  ------------------
  277|       |        /* Security bits: half number of bits in digest */
  278|    383|        if ((md = EVP_get_digestbynid(mdnid)) == NULL) {
  ------------------
  |  |  552|    383|# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
  ------------------
  |  Branch (278:13): [True: 27, False: 356]
  ------------------
  279|     27|            ERR_raise(ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     27|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     27|     ERR_set_error)
  |  |  ------------------
  ------------------
  280|     27|            return 0;
  281|     27|        }
  282|    356|        md_size = EVP_MD_get_size(md);
  283|    356|        if (md_size <= 0)
  ------------------
  |  Branch (283:13): [True: 0, False: 356]
  ------------------
  284|      0|            return 0;
  285|    356|        siginf->secbits = md_size * 4;
  286|    356|        break;
  287|    920|    }
  288|    857|    switch (mdnid) {
  ------------------
  |  Branch (288:13): [True: 45, False: 812]
  ------------------
  289|    471|    case NID_sha1:
  ------------------
  |  | 2321|    471|#define NID_sha1                64
  ------------------
  |  Branch (289:5): [True: 471, False: 386]
  ------------------
  290|    700|    case NID_sha256:
  ------------------
  |  | 3264|    700|#define NID_sha256              672
  ------------------
  |  Branch (290:5): [True: 229, False: 628]
  ------------------
  291|    716|    case NID_sha384:
  ------------------
  |  | 3269|    716|#define NID_sha384              673
  ------------------
  |  Branch (291:5): [True: 16, False: 841]
  ------------------
  292|    812|    case NID_sha512:
  ------------------
  |  | 3274|    812|#define NID_sha512              674
  ------------------
  |  Branch (292:5): [True: 96, False: 761]
  ------------------
  293|    812|        siginf->flags |= X509_SIG_INFO_TLS;
  ------------------
  |  |  162|    812|# define X509_SIG_INFO_TLS       0x2
  ------------------
  294|    857|    }
  295|    857|    siginf->flags |= X509_SIG_INFO_VALID;
  ------------------
  |  |  160|    857|# define X509_SIG_INFO_VALID     0x1
  ------------------
  296|    857|    return 1;
  297|    857|}

X509v3_get_ext_count:
   21|  5.68k|{
   22|  5.68k|    int ret;
   23|       |
   24|  5.68k|    if (x == NULL)
  ------------------
  |  Branch (24:9): [True: 171, False: 5.51k]
  ------------------
   25|    171|        return 0;
   26|  5.51k|    ret = sk_X509_EXTENSION_num(x);
  ------------------
  |  |  235|  5.51k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
   27|  5.51k|    return ret > 0 ? ret : 0;
  ------------------
  |  Branch (27:12): [True: 5.51k, False: 0]
  ------------------
   28|  5.68k|}
X509v3_get_ext_by_NID:
   32|     24|{
   33|     24|    ASN1_OBJECT *obj;
   34|       |
   35|     24|    obj = OBJ_nid2obj(nid);
   36|     24|    if (obj == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 24]
  ------------------
   37|      0|        return -2;
   38|     24|    return X509v3_get_ext_by_OBJ(x, obj, lastpos);
   39|     24|}
X509v3_get_ext_by_OBJ:
   43|     24|{
   44|     24|    int n;
   45|     24|    X509_EXTENSION *ex;
   46|       |
   47|     24|    if (sk == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 24]
  ------------------
   48|      0|        return -1;
   49|     24|    lastpos++;
   50|     24|    if (lastpos < 0)
  ------------------
  |  Branch (50:9): [True: 0, False: 24]
  ------------------
   51|      0|        lastpos = 0;
   52|     24|    n = sk_X509_EXTENSION_num(sk);
  ------------------
  |  |  235|     24|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
   53|    139|    for (; lastpos < n; lastpos++) {
  ------------------
  |  Branch (53:12): [True: 122, False: 17]
  ------------------
   54|    122|        ex = sk_X509_EXTENSION_value(sk, lastpos);
  ------------------
  |  |  236|    122|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
   55|    122|        if (OBJ_cmp(ex->object, obj) == 0)
  ------------------
  |  Branch (55:13): [True: 7, False: 115]
  ------------------
   56|      7|            return lastpos;
   57|    122|    }
   58|     17|    return -1;
   59|     24|}
X509v3_get_ext:
   84|  4.83k|{
   85|  4.83k|    if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
  ------------------
  |  |  235|  4.83k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (85:9): [True: 0, False: 4.83k]
  |  Branch (85:22): [True: 0, False: 4.83k]
  |  Branch (85:57): [True: 0, False: 4.83k]
  ------------------
   86|      0|        return NULL;
   87|  4.83k|    else
   88|  4.83k|        return sk_X509_EXTENSION_value(x, loc);
  ------------------
  |  |  236|  4.83k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
   89|  4.83k|}
X509_EXTENSION_get_object:
  253|  85.1k|{
  254|  85.1k|    if (ex == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 85.1k]
  ------------------
  255|      0|        return NULL;
  256|  85.1k|    return ex->object;
  257|  85.1k|}
X509_EXTENSION_get_data:
  260|  7.08k|{
  261|  7.08k|    if (ex == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 7.08k]
  ------------------
  262|      0|        return NULL;
  263|  7.08k|    return &ex->value;
  264|  7.08k|}
X509_EXTENSION_get_critical:
  267|  11.6k|{
  268|  11.6k|    if (ex == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 11.6k]
  ------------------
  269|      0|        return 0;
  270|  11.6k|    if (ex->critical > 0)
  ------------------
  |  Branch (270:9): [True: 3.90k, False: 7.78k]
  ------------------
  271|  3.90k|        return 1;
  272|  7.78k|    return 0;
  273|  11.6k|}

X509_cmp_current_time:
 2005|  1.48k|{
 2006|  1.48k|    return X509_cmp_time(ctm, NULL);
 2007|  1.48k|}
X509_cmp_time:
 2011|  5.63k|{
 2012|  5.63k|    static const size_t utctime_length = sizeof("YYMMDDHHMMSSZ") - 1;
 2013|  5.63k|    static const size_t generalizedtime_length = sizeof("YYYYMMDDHHMMSSZ") - 1;
 2014|  5.63k|    ASN1_TIME *asn1_cmp_time = NULL;
 2015|  5.63k|    int i, day, sec, ret = 0;
 2016|       |#ifdef CHARSET_EBCDIC
 2017|       |    const char upper_z = 0x5A;
 2018|       |#else
 2019|  5.63k|    const char upper_z = 'Z';
 2020|  5.63k|#endif
 2021|       |
 2022|       |    /*-
 2023|       |     * Note that ASN.1 allows much more slack in the time format than RFC5280.
 2024|       |     * In RFC5280, the representation is fixed:
 2025|       |     * UTCTime: YYMMDDHHMMSSZ
 2026|       |     * GeneralizedTime: YYYYMMDDHHMMSSZ
 2027|       |     *
 2028|       |     * We do NOT currently enforce the following RFC 5280 requirement:
 2029|       |     * "CAs conforming to this profile MUST always encode certificate
 2030|       |     *  validity dates through the year 2049 as UTCTime; certificate validity
 2031|       |     *  dates in 2050 or later MUST be encoded as GeneralizedTime."
 2032|       |     */
 2033|  5.63k|    switch (ctm->type) {
 2034|  5.63k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|  5.63k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (2034:5): [True: 5.63k, False: 0]
  ------------------
 2035|  5.63k|        if (ctm->length != (int)(utctime_length))
  ------------------
  |  Branch (2035:13): [True: 0, False: 5.63k]
  ------------------
 2036|      0|            return 0;
 2037|  5.63k|        break;
 2038|  5.63k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|      0|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (2038:5): [True: 0, False: 5.63k]
  ------------------
 2039|      0|        if (ctm->length != (int)(generalizedtime_length))
  ------------------
  |  Branch (2039:13): [True: 0, False: 0]
  ------------------
 2040|      0|            return 0;
 2041|      0|        break;
 2042|      0|    default:
  ------------------
  |  Branch (2042:5): [True: 0, False: 5.63k]
  ------------------
 2043|      0|        return 0;
 2044|  5.63k|    }
 2045|       |
 2046|       |    /**
 2047|       |     * Verify the format: the ASN.1 functions we use below allow a more
 2048|       |     * flexible format than what's mandated by RFC 5280.
 2049|       |     * Digit and date ranges will be verified in the conversion methods.
 2050|       |     */
 2051|  56.1k|    for (i = 0; i < ctm->length - 1; i++) {
  ------------------
  |  Branch (2051:17): [True: 52.9k, False: 3.19k]
  ------------------
 2052|  52.9k|        if (!ossl_ascii_isdigit(ctm->data[i]))
  ------------------
  |  Branch (2052:13): [True: 2.43k, False: 50.5k]
  ------------------
 2053|  2.43k|            return 0;
 2054|  52.9k|    }
 2055|  3.19k|    if (ctm->data[ctm->length - 1] != upper_z)
  ------------------
  |  Branch (2055:9): [True: 227, False: 2.96k]
  ------------------
 2056|    227|        return 0;
 2057|       |
 2058|       |    /*
 2059|       |     * There is ASN1_UTCTIME_cmp_time_t but no
 2060|       |     * ASN1_GENERALIZEDTIME_cmp_time_t or ASN1_TIME_cmp_time_t,
 2061|       |     * so we go through ASN.1
 2062|       |     */
 2063|  2.96k|    asn1_cmp_time = X509_time_adj(NULL, 0, cmp_time);
 2064|  2.96k|    if (asn1_cmp_time == NULL)
  ------------------
  |  Branch (2064:9): [True: 0, False: 2.96k]
  ------------------
 2065|      0|        goto err;
 2066|  2.96k|    if (ASN1_TIME_diff(&day, &sec, ctm, asn1_cmp_time) == 0)
  ------------------
  |  Branch (2066:9): [True: 499, False: 2.46k]
  ------------------
 2067|    499|        goto err;
 2068|       |
 2069|       |    /*
 2070|       |     * X509_cmp_time comparison is <=.
 2071|       |     * The return value 0 is reserved for errors.
 2072|       |     */
 2073|  2.46k|    ret = (day >= 0 && sec >= 0) ? -1 : 1;
  ------------------
  |  Branch (2073:12): [True: 1.93k, False: 538]
  |  Branch (2073:24): [True: 1.93k, False: 0]
  ------------------
 2074|       |
 2075|  2.96k| err:
 2076|  2.96k|    ASN1_TIME_free(asn1_cmp_time);
 2077|  2.96k|    return ret;
 2078|  2.46k|}
X509_cmp_timeframe:
 2086|  2.59k|{
 2087|  2.59k|    time_t ref_time;
 2088|  2.59k|    time_t *time = NULL;
 2089|  2.59k|    unsigned long flags = vpm == NULL ? 0 : X509_VERIFY_PARAM_get_flags(vpm);
  ------------------
  |  Branch (2089:27): [True: 2.59k, False: 0]
  ------------------
 2090|       |
 2091|  2.59k|    if ((flags & X509_V_FLAG_USE_CHECK_TIME) != 0) {
  ------------------
  |  |  421|  2.59k|# define X509_V_FLAG_USE_CHECK_TIME              0x2
  ------------------
  |  Branch (2091:9): [True: 0, False: 2.59k]
  ------------------
 2092|      0|        ref_time = X509_VERIFY_PARAM_get_time(vpm);
 2093|      0|        time = &ref_time;
 2094|  2.59k|    } else if ((flags & X509_V_FLAG_NO_CHECK_TIME) != 0) {
  ------------------
  |  |  465|  2.59k|# define X509_V_FLAG_NO_CHECK_TIME               0x200000
  ------------------
  |  Branch (2094:16): [True: 0, False: 2.59k]
  ------------------
 2095|      0|        return 0; /* this means ok */
 2096|      0|    } /* else reference time is the current time */
 2097|       |
 2098|  2.59k|    if (end != NULL && X509_cmp_time(end, time) < 0)
  ------------------
  |  Branch (2098:9): [True: 2.59k, False: 0]
  |  Branch (2098:24): [True: 1.03k, False: 1.55k]
  ------------------
 2099|  1.03k|        return 1;
 2100|  1.55k|    if (start != NULL && X509_cmp_time(start, time) > 0)
  ------------------
  |  Branch (2100:9): [True: 1.55k, False: 0]
  |  Branch (2100:26): [True: 144, False: 1.41k]
  ------------------
 2101|    144|        return -1;
 2102|  1.41k|    return 0;
 2103|  1.55k|}
X509_time_adj:
 2111|  2.96k|{
 2112|  2.96k|    return X509_time_adj_ex(s, 0, offset_sec, in_tm);
 2113|  2.96k|}
X509_time_adj_ex:
 2117|  2.96k|{
 2118|  2.96k|    time_t t;
 2119|       |
 2120|  2.96k|    if (in_tm)
  ------------------
  |  Branch (2120:9): [True: 0, False: 2.96k]
  ------------------
 2121|      0|        t = *in_tm;
 2122|  2.96k|    else
 2123|  2.96k|        time(&t);
 2124|       |
 2125|  2.96k|    if (s != NULL && (s->flags & ASN1_STRING_FLAG_MSTRING) == 0) {
  ------------------
  |  |  180|      0|# define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  |  Branch (2125:9): [True: 0, False: 2.96k]
  |  Branch (2125:22): [True: 0, False: 0]
  ------------------
 2126|      0|        if (s->type == V_ASN1_UTCTIME)
  ------------------
  |  |   82|      0|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (2126:13): [True: 0, False: 0]
  ------------------
 2127|      0|            return ASN1_UTCTIME_adj(s, t, offset_day, offset_sec);
 2128|      0|        if (s->type == V_ASN1_GENERALIZEDTIME)
  ------------------
  |  |   83|      0|# define V_ASN1_GENERALIZEDTIME          24
  ------------------
  |  Branch (2128:13): [True: 0, False: 0]
  ------------------
 2129|      0|            return ASN1_GENERALIZEDTIME_adj(s, t, offset_day, offset_sec);
 2130|      0|    }
 2131|  2.96k|    return ASN1_TIME_adj(s, t, offset_day, offset_sec);
 2132|  2.96k|}

X509_NAME_entry_count:
   51|  1.45k|{
   52|  1.45k|    int ret;
   53|       |
   54|  1.45k|    if (name == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 1.45k]
  ------------------
   55|      0|        return 0;
   56|  1.45k|    ret = sk_X509_NAME_ENTRY_num(name->entries);
  ------------------
  |  |  204|  1.45k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
   57|  1.45k|    return ret > 0 ? ret : 0;
  ------------------
  |  Branch (57:12): [True: 1.45k, False: 5]
  ------------------
   58|  1.45k|}
X509_NAME_get_entry:
   93|  4.66k|{
   94|  4.66k|    if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc
  ------------------
  |  |  204|  4.66k|#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: 4.66k]
  |  Branch (94:25): [True: 708, False: 3.96k]
  ------------------
   95|  4.66k|        || loc < 0)
  ------------------
  |  Branch (95:12): [True: 0, False: 3.96k]
  ------------------
   96|    708|        return NULL;
   97|       |
   98|  3.96k|    return sk_X509_NAME_ENTRY_value(name->entries, loc);
  ------------------
  |  |  205|  3.96k|#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|  4.66k|}
X509_NAME_ENTRY_get_object:
  343|  3.96k|{
  344|  3.96k|    if (ne == NULL)
  ------------------
  |  Branch (344:9): [True: 0, False: 3.96k]
  ------------------
  345|      0|        return NULL;
  346|  3.96k|    return ne->object;
  347|  3.96k|}
X509_NAME_ENTRY_get_data:
  350|  3.96k|{
  351|  3.96k|    if (ne == NULL)
  ------------------
  |  Branch (351:9): [True: 0, False: 3.96k]
  ------------------
  352|      0|        return NULL;
  353|  3.96k|    return ne->value;
  354|  3.96k|}
X509_NAME_ENTRY_set:
  357|  6.47k|{
  358|  6.47k|    return ne->set;
  359|  6.47k|}

X509_REQ_verify_ex:
   45|    604|{
   46|    604|    if (X509_REQ_get_version(a) != X509_REQ_VERSION_1) {
  ------------------
  |  |  893|    604|#define X509_REQ_VERSION_1 0
  ------------------
  |  Branch (46:9): [True: 25, False: 579]
  ------------------
   47|     25|        ERR_raise(ERR_LIB_X509, X509_R_UNSUPPORTED_VERSION);
  ------------------
  |  |  401|     25|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     25|    (ERR_new(),                                                 \
  |  |  |  |  404|     25|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     25|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     25|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     25|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     25|     ERR_set_error)
  |  |  ------------------
  ------------------
   48|     25|        return -1;
   49|     25|    }
   50|       |
   51|    579|    return ASN1_item_verify_ex(ASN1_ITEM_rptr(X509_REQ_INFO), &a->sig_alg,
  ------------------
  |  |  427|    579|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   52|    579|                               a->signature, &a->req_info, a->distinguishing_id,
   53|    579|                               r, libctx, propq);
   54|    604|}
X509_digest:
  502|  1.36k|{
  503|  1.36k|    if (EVP_MD_is_a(md, SN_sha1) && (cert->ex_flags & EXFLAG_SET) != 0
  ------------------
  |  | 2319|  1.36k|#define SN_sha1         "SHA1"
  ------------------
                  if (EVP_MD_is_a(md, SN_sha1) && (cert->ex_flags & EXFLAG_SET) != 0
  ------------------
  |  |  659|  1.36k|# define EXFLAG_SET              0x100
  ------------------
  |  Branch (503:9): [True: 1.36k, False: 0]
  |  Branch (503:37): [True: 0, False: 1.36k]
  ------------------
  504|  1.36k|            && (cert->ex_flags & EXFLAG_NO_FINGERPRINT) == 0) {
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  |  Branch (504:16): [True: 0, False: 0]
  ------------------
  505|       |        /* Asking for SHA1 and we already computed it. */
  506|      0|        if (len != NULL)
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  ------------------
  507|      0|            *len = sizeof(cert->sha1_hash);
  508|      0|        memcpy(data, cert->sha1_hash, sizeof(cert->sha1_hash));
  509|      0|        return 1;
  510|      0|    }
  511|  1.36k|    return ossl_asn1_item_digest_ex(ASN1_ITEM_rptr(X509), md, (char *)cert,
  ------------------
  |  |  427|  1.36k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  512|  1.36k|                                    data, len, cert->libctx, cert->propq);
  513|  1.36k|}

x_crl.c:crl_inf_cb:
   49|     17|{
   50|     17|    X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;
   51|       |
   52|     17|    if (!a || !a->revoked)
  ------------------
  |  Branch (52:9): [True: 0, False: 17]
  |  Branch (52:15): [True: 17, False: 0]
  ------------------
   53|     17|        return 1;
   54|      0|    switch (operation) {
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|       |        /*
   56|       |         * Just set cmp function here. We don't sort because that would
   57|       |         * affect the output of X509_CRL_print().
   58|       |         */
   59|      0|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|      0|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (59:5): [True: 0, False: 0]
  ------------------
   60|      0|        (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
  ------------------
  |  |  129|      0|#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|      0|        break;
   62|      0|    }
   63|      0|    return 1;
   64|      0|}
x_crl.c:crl_cb:
  160|     20|{
  161|     20|    X509_CRL *crl = (X509_CRL *)*pval;
  162|     20|    STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|     20|# define STACK_OF(type) struct stack_st_##type
  ------------------
  163|     20|    X509_EXTENSION *ext;
  164|     20|    int idx, i;
  165|       |
  166|     20|    switch (operation) {
  ------------------
  |  Branch (166:13): [True: 8, False: 12]
  ------------------
  167|      4|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|      4|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (167:5): [True: 4, False: 16]
  ------------------
  168|      4|        if (crl->meth->crl_free) {
  ------------------
  |  Branch (168:13): [True: 0, False: 4]
  ------------------
  169|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                return 0;
  171|      0|        }
  172|      4|        AUTHORITY_KEYID_free(crl->akid);
  173|      4|        ISSUING_DIST_POINT_free(crl->idp);
  174|      4|        ASN1_INTEGER_free(crl->crl_number);
  175|      4|        ASN1_INTEGER_free(crl->base_crl_number);
  176|      4|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|      4|#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|      8|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|      8|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (179:5): [True: 4, False: 16]
  ------------------
  180|      8|        crl->idp = NULL;
  181|      8|        crl->akid = NULL;
  182|      8|        crl->flags = 0;
  183|      8|        crl->idp_flags = 0;
  184|      8|        crl->idp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  309|      8|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  185|      8|        crl->meth = default_crl_method;
  186|      8|        crl->meth_data = NULL;
  187|      8|        crl->issuers = NULL;
  188|      8|        crl->crl_number = NULL;
  189|      8|        crl->base_crl_number = NULL;
  190|      8|        break;
  191|       |
  192|      0|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|      0|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (192:5): [True: 0, False: 20]
  ------------------
  193|      0|        if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  ------------------
  194|      0|            crl->flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  195|      0|        crl->idp = X509_CRL_get_ext_d2i(crl,
  196|      0|                                        NID_issuing_distribution_point, &i,
  ------------------
  |  | 2707|      0|#define NID_issuing_distribution_point          770
  ------------------
  197|      0|                                        NULL);
  198|      0|        if (crl->idp != NULL) {
  ------------------
  |  Branch (198:13): [True: 0, False: 0]
  ------------------
  199|      0|            if (!setup_idp(crl, crl->idp))
  ------------------
  |  Branch (199:17): [True: 0, False: 0]
  ------------------
  200|      0|                crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      0|# define EXFLAG_INVALID          0x80
  ------------------
  201|      0|        }
  202|      0|        else if (i != -1) {
  ------------------
  |  Branch (202:18): [True: 0, False: 0]
  ------------------
  203|      0|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      0|# define EXFLAG_INVALID          0x80
  ------------------
  204|      0|        }
  205|       |
  206|      0|        crl->akid = X509_CRL_get_ext_d2i(crl,
  207|      0|                                         NID_authority_key_identifier, &i,
  ------------------
  |  | 2742|      0|#define NID_authority_key_identifier            90
  ------------------
  208|      0|                                         NULL);
  209|      0|        if (crl->akid == NULL && i != -1)
  ------------------
  |  Branch (209:13): [True: 0, False: 0]
  |  Branch (209:34): [True: 0, False: 0]
  ------------------
  210|      0|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      0|# define EXFLAG_INVALID          0x80
  ------------------
  211|       |
  212|      0|        crl->crl_number = X509_CRL_get_ext_d2i(crl,
  213|      0|                                               NID_crl_number, &i, NULL);
  ------------------
  |  | 2687|      0|#define NID_crl_number          88
  ------------------
  214|      0|        if (crl->crl_number == NULL && i != -1)
  ------------------
  |  Branch (214:13): [True: 0, False: 0]
  |  Branch (214:40): [True: 0, False: 0]
  ------------------
  215|      0|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      0|# define EXFLAG_INVALID          0x80
  ------------------
  216|       |
  217|      0|        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
  218|      0|                                                    NID_delta_crl, &i,
  ------------------
  |  | 2702|      0|#define NID_delta_crl           140
  ------------------
  219|      0|                                                    NULL);
  220|      0|        if (crl->base_crl_number == NULL && i != -1)
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  |  Branch (220:45): [True: 0, False: 0]
  ------------------
  221|      0|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      0|# define EXFLAG_INVALID          0x80
  ------------------
  222|       |        /* Delta CRLs must have CRL number */
  223|      0|        if (crl->base_crl_number && !crl->crl_number)
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  |  Branch (223:37): [True: 0, False: 0]
  ------------------
  224|      0|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      0|# 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|      0|        exts = crl->crl.extensions;
  234|       |
  235|      0|        for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
  ------------------
  |  |  235|      0|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (235:23): [True: 0, False: 0]
  ------------------
  236|      0|            int nid;
  237|      0|            ext = sk_X509_EXTENSION_value(exts, idx);
  ------------------
  |  |  236|      0|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  238|      0|            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
  239|      0|            if (nid == NID_freshest_crl)
  ------------------
  |  | 2782|      0|#define NID_freshest_crl                857
  ------------------
  |  Branch (239:17): [True: 0, False: 0]
  ------------------
  240|      0|                crl->flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  664|      0|# define EXFLAG_FRESHEST         0x1000
  ------------------
  241|      0|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (241:17): [True: 0, False: 0]
  ------------------
  242|       |                /* We handle IDP and deltas */
  243|      0|                if ((nid == NID_issuing_distribution_point)
  ------------------
  |  | 2707|      0|#define NID_issuing_distribution_point          770
  ------------------
  |  Branch (243:21): [True: 0, False: 0]
  ------------------
  244|      0|                    || (nid == NID_authority_key_identifier)
  ------------------
  |  | 2742|      0|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (244:24): [True: 0, False: 0]
  ------------------
  245|      0|                    || (nid == NID_delta_crl))
  ------------------
  |  | 2702|      0|#define NID_delta_crl           140
  ------------------
  |  Branch (245:24): [True: 0, False: 0]
  ------------------
  246|      0|                    continue;
  247|      0|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|      0|# define EXFLAG_CRITICAL         0x200
  ------------------
  248|      0|                break;
  249|      0|            }
  250|      0|        }
  251|       |
  252|      0|        if (!crl_set_issuers(crl))
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|            return 0;
  254|       |
  255|      0|        if (crl->meth->crl_init) {
  ------------------
  |  Branch (255:13): [True: 0, False: 0]
  ------------------
  256|      0|            if (crl->meth->crl_init(crl) == 0)
  ------------------
  |  Branch (256:17): [True: 0, False: 0]
  ------------------
  257|      0|                return 0;
  258|      0|        }
  259|       |
  260|      0|        crl->flags |= EXFLAG_SET;
  ------------------
  |  |  659|      0|# define EXFLAG_SET              0x100
  ------------------
  261|      0|        break;
  262|       |
  263|      4|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|      4|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (263:5): [True: 4, False: 16]
  ------------------
  264|      4|        if (crl->meth != NULL && crl->meth->crl_free != NULL) {
  ------------------
  |  Branch (264:13): [True: 4, False: 0]
  |  Branch (264:34): [True: 0, False: 4]
  ------------------
  265|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (265:17): [True: 0, False: 0]
  ------------------
  266|      0|                return 0;
  267|      0|        }
  268|      4|        AUTHORITY_KEYID_free(crl->akid);
  269|      4|        ISSUING_DIST_POINT_free(crl->idp);
  270|      4|        ASN1_INTEGER_free(crl->crl_number);
  271|      4|        ASN1_INTEGER_free(crl->base_crl_number);
  272|      4|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|      4|#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|      4|        OPENSSL_free(crl->propq);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|      4|        break;
  275|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (275:5): [True: 0, False: 20]
  ------------------
  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|     20|    }
  284|     20|    return 1;
  285|     20|}

X509_NAME_set:
  491|  11.6k|{
  492|  11.6k|    X509_NAME *name_copy;
  493|       |
  494|  11.6k|    if (*xn == name)
  ------------------
  |  Branch (494:9): [True: 0, False: 11.6k]
  ------------------
  495|      0|        return *xn != NULL;
  496|  11.6k|    if ((name_copy = X509_NAME_dup(name)) == NULL)
  ------------------
  |  Branch (496:9): [True: 0, False: 11.6k]
  ------------------
  497|      0|        return 0;
  498|  11.6k|    X509_NAME_free(*xn);
  499|  11.6k|    *xn = name_copy;
  500|  11.6k|    return 1;
  501|  11.6k|}
X509_NAME_print:
  504|  7.65k|{
  505|  7.65k|    char *s, *c, *b;
  506|  7.65k|    int i;
  507|       |
  508|  7.65k|    b = X509_NAME_oneline(name, NULL, 0);
  509|  7.65k|    if (b == NULL)
  ------------------
  |  Branch (509:9): [True: 4, False: 7.64k]
  ------------------
  510|      4|        return 0;
  511|  7.64k|    if (*b == '\0') {
  ------------------
  |  Branch (511:9): [True: 3.19k, False: 4.45k]
  ------------------
  512|  3.19k|        OPENSSL_free(b);
  ------------------
  |  |  115|  3.19k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.19k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.19k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  513|  3.19k|        return 1;
  514|  3.19k|    }
  515|  4.45k|    s = b + 1;                  /* skip the first slash */
  516|       |
  517|  4.45k|    c = s;
  518|  56.1M|    for (;;) {
  519|  56.1M|        if (((*s == '/') &&
  ------------------
  |  Branch (519:14): [True: 29.0k, False: 56.1M]
  ------------------
  520|  56.1M|             (ossl_isupper(s[1]) && ((s[2] == '=') ||
  ------------------
  |  Branch (520:15): [True: 10.3k, False: 18.6k]
  |  Branch (520:38): [True: 2.40k, False: 7.98k]
  ------------------
  521|  10.3k|                                (ossl_isupper(s[2]) && (s[3] == '='))
  ------------------
  |  Branch (521:34): [True: 6.24k, False: 1.74k]
  |  Branch (521:56): [True: 5.21k, False: 1.02k]
  ------------------
  522|  56.1M|              ))) || (*s == '\0'))
  ------------------
  |  Branch (522:22): [True: 4.45k, False: 56.1M]
  ------------------
  523|  12.0k|        {
  524|  12.0k|            i = s - c;
  525|  12.0k|            if (BIO_write(bp, c, i) != i)
  ------------------
  |  Branch (525:17): [True: 0, False: 12.0k]
  ------------------
  526|      0|                goto err;
  527|  12.0k|            c = s + 1;          /* skip following slash */
  528|  12.0k|            if (*s != '\0') {
  ------------------
  |  Branch (528:17): [True: 7.61k, False: 4.45k]
  ------------------
  529|  7.61k|                if (BIO_write(bp, ", ", 2) != 2)
  ------------------
  |  Branch (529:21): [True: 0, False: 7.61k]
  ------------------
  530|      0|                    goto err;
  531|  7.61k|            }
  532|  12.0k|        }
  533|  56.1M|        if (*s == '\0')
  ------------------
  |  Branch (533:13): [True: 4.45k, False: 56.1M]
  ------------------
  534|  4.45k|            break;
  535|  56.1M|        s++;
  536|  56.1M|    }
  537|       |
  538|  4.45k|    OPENSSL_free(b);
  ------------------
  |  |  115|  4.45k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.45k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.45k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  539|  4.45k|    return 1;
  540|      0| err:
  541|      0|    ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  542|      0|    OPENSSL_free(b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  543|      0|    return 0;
  544|  4.45k|}
x_name.c:x509_name_ex_new:
   91|  67.8k|{
   92|  67.8k|    X509_NAME *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  67.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|  67.8k|    if (ret == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 67.8k]
  ------------------
   95|      0|        return 0;
   96|  67.8k|    if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) {
  ------------------
  |  |  207|  67.8k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (96:9): [True: 0, False: 67.8k]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|  67.8k|    if ((ret->bytes = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (100:9): [True: 0, False: 67.8k]
  ------------------
  101|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|        goto err;
  103|      0|    }
  104|  67.8k|    ret->modified = 1;
  105|  67.8k|    *val = (ASN1_VALUE *)ret;
  106|  67.8k|    return 1;
  107|       |
  108|      0| err:
  109|      0|    if (ret) {
  ------------------
  |  Branch (109:9): [True: 0, False: 0]
  ------------------
  110|      0|        sk_X509_NAME_ENTRY_free(ret->entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  111|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|      0|    }
  113|      0|    return 0;
  114|  67.8k|}
x_name.c:x509_name_ex_free:
  117|  67.8k|{
  118|  67.8k|    X509_NAME *a;
  119|       |
  120|  67.8k|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 67.8k]
  |  Branch (120:25): [True: 0, False: 67.8k]
  ------------------
  121|      0|        return;
  122|  67.8k|    a = (X509_NAME *)*pval;
  123|       |
  124|  67.8k|    BUF_MEM_free(a->bytes);
  125|  67.8k|    sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|  67.8k|#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|  67.8k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|  67.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|  67.8k|    OPENSSL_free(a);
  ------------------
  |  |  115|  67.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  67.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  67.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|  67.8k|    *pval = NULL;
  129|  67.8k|}
x_name.c:x509_name_ex_d2i:
  145|  30.3k|{
  146|  30.3k|    const unsigned char *p = *in, *q;
  147|  30.3k|    union {
  148|  30.3k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  149|  30.3k|        ASN1_VALUE *a;
  150|  30.3k|    } intname = {
  151|  30.3k|        NULL
  152|  30.3k|    };
  153|  30.3k|    union {
  154|  30.3k|        X509_NAME *x;
  155|  30.3k|        ASN1_VALUE *a;
  156|  30.3k|    } nm = {
  157|  30.3k|        NULL
  158|  30.3k|    };
  159|  30.3k|    int i, j, ret;
  160|  30.3k|    STACK_OF(X509_NAME_ENTRY) *entries;
  ------------------
  |  |   31|  30.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  161|  30.3k|    X509_NAME_ENTRY *entry;
  162|       |
  163|  30.3k|    if (len > X509_NAME_MAX)
  ------------------
  |  |   24|  30.3k|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  |  Branch (163:9): [True: 0, False: 30.3k]
  ------------------
  164|      0|        len = X509_NAME_MAX;
  ------------------
  |  |   24|      0|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  165|  30.3k|    q = p;
  166|       |
  167|       |    /* Get internal representation of Name */
  168|  30.3k|    ret = ASN1_item_ex_d2i(&intname.a,
  169|  30.3k|                           &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
  ------------------
  |  |  427|  30.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  170|  30.3k|                           tag, aclass, opt, ctx);
  171|       |
  172|  30.3k|    if (ret <= 0)
  ------------------
  |  Branch (172:9): [True: 76, False: 30.2k]
  ------------------
  173|     76|        return ret;
  174|       |
  175|  30.2k|    if (*val)
  ------------------
  |  Branch (175:9): [True: 5.07k, False: 25.1k]
  ------------------
  176|  5.07k|        x509_name_ex_free(val, NULL);
  177|  30.2k|    if (!x509_name_ex_new(&nm.a, NULL))
  ------------------
  |  Branch (177:9): [True: 0, False: 30.2k]
  ------------------
  178|      0|        goto err;
  179|       |    /* We've decoded it: now cache encoding */
  180|  30.2k|    if (!BUF_MEM_grow(nm.x->bytes, p - q))
  ------------------
  |  Branch (180:9): [True: 0, False: 30.2k]
  ------------------
  181|      0|        goto err;
  182|  30.2k|    memcpy(nm.x->bytes->data, q, p - q);
  183|       |
  184|       |    /* Convert internal representation to X509_NAME structure */
  185|  2.39M|    for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
  ------------------
  |  Branch (185:17): [True: 2.36M, False: 30.2k]
  ------------------
  186|  2.36M|        entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
  187|  2.51M|        for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
  ------------------
  |  |  204|  2.51M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (187:21): [True: 151k, False: 2.36M]
  ------------------
  188|   151k|            entry = sk_X509_NAME_ENTRY_value(entries, j);
  ------------------
  |  |  205|   151k|#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|   151k|            entry->set = i;
  190|   151k|            if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
  ------------------
  |  |  214|   151k|#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: 151k]
  ------------------
  191|      0|                goto err;
  192|   151k|            (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
  ------------------
  |  |  220|   151k|#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|   151k|        }
  194|  2.36M|    }
  195|  30.2k|    ret = x509_name_canon(nm.x);
  196|  30.2k|    if (!ret)
  ------------------
  |  Branch (196:9): [True: 85, False: 30.1k]
  ------------------
  197|     85|        goto err;
  198|  30.1k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  199|  30.1k|                                         local_sk_X509_NAME_ENTRY_free);
  200|  30.1k|    nm.x->modified = 0;
  201|  30.1k|    *val = nm.a;
  202|  30.1k|    *in = p;
  203|  30.1k|    return ret;
  204|       |
  205|     85| err:
  206|     85|    if (nm.x != NULL)
  ------------------
  |  Branch (206:9): [True: 85, False: 0]
  ------------------
  207|     85|        X509_NAME_free(nm.x);
  208|     85|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  209|     85|                                         local_sk_X509_NAME_ENTRY_pop_free);
  210|     85|    ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|     85|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     85|    (ERR_new(),                                                 \
  |  |  |  |  404|     85|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     85|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     85|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     85|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     85|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|     85|    return 0;
  212|  30.2k|}
x_name.c:x509_name_canon:
  311|  37.9k|{
  312|  37.9k|    unsigned char *p;
  313|  37.9k|    STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
  ------------------
  |  |   31|  37.9k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  314|  37.9k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|  37.9k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  315|  37.9k|    X509_NAME_ENTRY *entry, *tmpentry = NULL;
  316|  37.9k|    int i, set = -1, ret = 0, len;
  317|       |
  318|  37.9k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|  37.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|  37.9k|    a->canon_enc = NULL;
  320|       |    /* Special case: empty X509_NAME => null encoding */
  321|  37.9k|    if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
  ------------------
  |  |  204|  37.9k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (321:9): [True: 24.5k, False: 13.3k]
  ------------------
  322|  24.5k|        a->canon_enclen = 0;
  323|  24.5k|        return 1;
  324|  24.5k|    }
  325|  13.3k|    intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  326|  13.3k|    if (intname == NULL) {
  ------------------
  |  Branch (326:9): [True: 0, False: 13.3k]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|   148k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|   148k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (330:17): [True: 135k, False: 13.2k]
  ------------------
  331|   135k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|   135k|#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|   135k|        if (entry->set != set) {
  ------------------
  |  Branch (332:13): [True: 23.2k, False: 112k]
  ------------------
  333|  23.2k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|  23.2k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  334|  23.2k|            if (entries == NULL)
  ------------------
  |  Branch (334:17): [True: 0, False: 23.2k]
  ------------------
  335|      0|                goto err;
  336|  23.2k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
  ------------------
  |  Branch (336:17): [True: 0, False: 23.2k]
  ------------------
  337|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  338|      0|                ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|      0|                goto err;
  340|      0|            }
  341|  23.2k|            set = entry->set;
  342|  23.2k|        }
  343|   135k|        tmpentry = X509_NAME_ENTRY_new();
  344|   135k|        if (tmpentry == NULL) {
  ------------------
  |  Branch (344:13): [True: 0, False: 135k]
  ------------------
  345|      0|            ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|   135k|        tmpentry->object = OBJ_dup(entry->object);
  349|   135k|        if (tmpentry->object == NULL) {
  ------------------
  |  Branch (349:13): [True: 0, False: 135k]
  ------------------
  350|      0|            ERR_raise(ERR_LIB_X509, ERR_R_OBJ_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            goto err;
  352|      0|        }
  353|   135k|        if (!asn1_string_canon(tmpentry->value, entry->value))
  ------------------
  |  Branch (353:13): [True: 85, False: 135k]
  ------------------
  354|     85|            goto err;
  355|   135k|        if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) {
  ------------------
  |  |  214|   135k|#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: 135k]
  ------------------
  356|      0|            ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|            goto err;
  358|      0|        }
  359|   135k|        tmpentry = NULL;
  360|   135k|    }
  361|       |
  362|       |    /* Finally generate encoding */
  363|  13.2k|    len = i2d_name_canon(intname, NULL);
  364|  13.2k|    if (len < 0)
  ------------------
  |  Branch (364:9): [True: 0, False: 13.2k]
  ------------------
  365|      0|        goto err;
  366|  13.2k|    a->canon_enclen = len;
  367|       |
  368|  13.2k|    p = OPENSSL_malloc(a->canon_enclen);
  ------------------
  |  |  102|  13.2k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  13.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  13.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  13.2k|    if (p == NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 13.2k]
  ------------------
  370|      0|        goto err;
  371|       |
  372|  13.2k|    a->canon_enc = p;
  373|       |
  374|  13.2k|    i2d_name_canon(intname, &p);
  375|       |
  376|  13.2k|    ret = 1;
  377|       |
  378|  13.3k| err:
  379|  13.3k|    X509_NAME_ENTRY_free(tmpentry);
  380|  13.3k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
  381|  13.3k|                                         local_sk_X509_NAME_ENTRY_pop_free);
  382|  13.3k|    return ret;
  383|  13.2k|}
x_name.c:asn1_string_canon:
  393|   135k|{
  394|   135k|    unsigned char *to, *from;
  395|   135k|    int len, i;
  396|       |
  397|       |    /* If type not in bitmask just copy string across */
  398|   135k|    if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
  ------------------
  |  |  388|   135k|        (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  117|   135k|# define B_ASN1_UTF8STRING       0x2000
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  115|   135k|# define B_ASN1_BMPSTRING        0x0800
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  112|   135k|# define B_ASN1_UNIVERSALSTRING  0x0100
  |  |  ------------------
  |  |  389|   135k|        | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  103|   135k|# define B_ASN1_PRINTABLESTRING  0x0002
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  104|   135k|# define B_ASN1_T61STRING        0x0004
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  107|   135k|# define B_ASN1_IA5STRING        0x0010
  |  |  ------------------
  |  |  390|   135k|        | B_ASN1_VISIBLESTRING)
  |  |  ------------------
  |  |  |  |  110|   135k|# define B_ASN1_VISIBLESTRING    0x0040
  |  |  ------------------
  ------------------
  |  Branch (398:9): [True: 92.2k, False: 43.3k]
  ------------------
  399|  92.2k|        if (!ASN1_STRING_copy(out, in))
  ------------------
  |  Branch (399:13): [True: 0, False: 92.2k]
  ------------------
  400|      0|            return 0;
  401|  92.2k|        return 1;
  402|  92.2k|    }
  403|       |
  404|  43.3k|    out->type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|  43.3k|# define V_ASN1_UTF8STRING               12
  ------------------
  405|  43.3k|    out->length = ASN1_STRING_to_UTF8(&out->data, in);
  406|  43.3k|    if (out->length == -1)
  ------------------
  |  Branch (406:9): [True: 85, False: 43.2k]
  ------------------
  407|     85|        return 0;
  408|       |
  409|  43.2k|    to = out->data;
  410|  43.2k|    from = to;
  411|       |
  412|  43.2k|    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|  44.7k|    while (len > 0 && ossl_isspace(*from)) {
  ------------------
  |  |   82|  38.2k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  38.2k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 1.53k, False: 36.7k]
  |  |  ------------------
  ------------------
  |  Branch (422:12): [True: 38.2k, False: 6.48k]
  ------------------
  423|  1.53k|        from++;
  424|  1.53k|        len--;
  425|  1.53k|    }
  426|       |
  427|  43.2k|    to = from + len;
  428|       |
  429|       |    /* Ignore trailing spaces */
  430|  43.6k|    while (len > 0 && ossl_isspace(to[-1])) {
  ------------------
  |  |   82|  37.1k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  37.1k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 385, False: 36.7k]
  |  |  ------------------
  ------------------
  |  Branch (430:12): [True: 37.1k, False: 6.48k]
  ------------------
  431|    385|        to--;
  432|    385|        len--;
  433|    385|    }
  434|       |
  435|  43.2k|    to = out->data;
  436|       |
  437|  43.2k|    i = 0;
  438|  16.4M|    while (i < len) {
  ------------------
  |  Branch (438:12): [True: 16.4M, False: 43.2k]
  ------------------
  439|       |        /* If not ASCII set just copy across */
  440|  16.4M|        if (!ossl_isascii(*from)) {
  ------------------
  |  |   75|  16.4M|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (440:13): [True: 15.7M, False: 662k]
  ------------------
  441|  15.7M|            *to++ = *from++;
  442|  15.7M|            i++;
  443|  15.7M|        }
  444|       |        /* Collapse multiple spaces */
  445|   662k|        else if (ossl_isspace(*from)) {
  ------------------
  |  |   82|   662k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   662k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 18.8k, False: 643k]
  |  |  ------------------
  ------------------
  446|       |            /* Copy one space across */
  447|  18.8k|            *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|  23.2k|            do {
  454|  23.2k|                from++;
  455|  23.2k|                i++;
  456|  23.2k|            }
  457|  23.2k|            while (ossl_isspace(*from));
  ------------------
  |  |   82|  23.2k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  23.2k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 4.42k, False: 18.8k]
  |  |  ------------------
  ------------------
  458|   643k|        } else {
  459|   643k|            *to++ = ossl_tolower(*from);
  460|   643k|            from++;
  461|   643k|            i++;
  462|   643k|        }
  463|  16.4M|    }
  464|       |
  465|  43.2k|    out->length = to - out->data;
  466|       |
  467|  43.2k|    return 1;
  468|       |
  469|  43.3k|}
x_name.c:i2d_name_canon:
  473|  26.5k|{
  474|  26.5k|    int i, len, ltmp;
  475|  26.5k|    const ASN1_VALUE *v;
  476|  26.5k|    STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
  ------------------
  |  |   31|  26.5k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  477|       |
  478|  26.5k|    len = 0;
  479|  72.8k|    for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
  ------------------
  |  |  898|  72.8k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (479:17): [True: 46.2k, False: 26.5k]
  ------------------
  480|  46.2k|        v = sk_ASN1_VALUE_value(intname, i);
  ------------------
  |  |  899|  46.2k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  481|  46.2k|        ltmp = ASN1_item_ex_i2d(&v, in,
  482|  46.2k|                                ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
  ------------------
  |  |  427|  46.2k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  483|  46.2k|        if (ltmp < 0 || len > INT_MAX - ltmp)
  ------------------
  |  Branch (483:13): [True: 0, False: 46.2k]
  |  Branch (483:25): [True: 0, False: 46.2k]
  ------------------
  484|      0|            return -1;
  485|  46.2k|        len += ltmp;
  486|  46.2k|    }
  487|  26.5k|    return len;
  488|  26.5k|}
x_name.c:local_sk_X509_NAME_ENTRY_free:
  132|  2.36M|{
  133|  2.36M|    sk_X509_NAME_ENTRY_free(ne);
  ------------------
  |  |  210|  2.36M|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  134|  2.36M|}
x_name.c:local_sk_X509_NAME_ENTRY_pop_free:
  137|  23.6k|{
  138|  23.6k|    sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|  23.6k|#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|  23.6k|}
x_name.c:x509_name_ex_i2d:
  216|  95.9k|{
  217|  95.9k|    int ret;
  218|  95.9k|    X509_NAME *a = (X509_NAME *)*val;
  219|       |
  220|  95.9k|    if (a->modified) {
  ------------------
  |  Branch (220:9): [True: 7.65k, False: 88.2k]
  ------------------
  221|  7.65k|        ret = x509_name_encode(a);
  222|  7.65k|        if (ret < 0)
  ------------------
  |  Branch (222:13): [True: 0, False: 7.65k]
  ------------------
  223|      0|            return ret;
  224|  7.65k|        ret = x509_name_canon(a);
  225|  7.65k|        if (!ret)
  ------------------
  |  Branch (225:13): [True: 0, False: 7.65k]
  ------------------
  226|      0|            return -1;
  227|  7.65k|    }
  228|  95.9k|    ret = a->bytes->length;
  229|  95.9k|    if (out != NULL) {
  ------------------
  |  Branch (229:9): [True: 23.0k, False: 72.9k]
  ------------------
  230|  23.0k|        memcpy(*out, a->bytes->data, ret);
  231|  23.0k|        *out += ret;
  232|  23.0k|    }
  233|  95.9k|    return ret;
  234|  95.9k|}
x_name.c:x509_name_encode:
  237|  7.65k|{
  238|  7.65k|    union {
  239|  7.65k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  240|  7.65k|        const ASN1_VALUE *a;
  241|  7.65k|    } intname = {
  242|  7.65k|        NULL
  243|  7.65k|    };
  244|  7.65k|    int len;
  245|  7.65k|    unsigned char *p;
  246|  7.65k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|  7.65k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  247|  7.65k|    X509_NAME_ENTRY *entry;
  248|  7.65k|    int i, set = -1;
  249|       |
  250|  7.65k|    intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  251|  7.65k|    if (!intname.s)
  ------------------
  |  Branch (251:9): [True: 0, False: 7.65k]
  ------------------
  252|      0|        goto cerr;
  253|  7.65k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|  7.65k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (253:17): [True: 0, False: 7.65k]
  ------------------
  254|      0|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  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)))
  ------------------
  255|      0|        if (entry->set != set) {
  ------------------
  |  Branch (255:13): [True: 0, False: 0]
  ------------------
  256|      0|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|      0|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  257|      0|            if (!entries)
  ------------------
  |  Branch (257:17): [True: 0, False: 0]
  ------------------
  258|      0|                goto cerr;
  259|      0|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) {
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  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|      0|            set = entry->set;
  264|      0|        }
  265|      0|        if (!sk_X509_NAME_ENTRY_push(entries, entry))
  ------------------
  |  |  214|      0|#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: 0]
  ------------------
  266|      0|            goto cerr;
  267|      0|    }
  268|  7.65k|    len = ASN1_item_ex_i2d(&intname.a, NULL,
  269|  7.65k|                           ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  427|  7.65k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  270|  7.65k|    if (!BUF_MEM_grow(a->bytes, len)) {
  ------------------
  |  Branch (270:9): [True: 0, False: 7.65k]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        goto err;
  273|      0|    }
  274|  7.65k|    p = (unsigned char *)a->bytes->data;
  275|  7.65k|    ASN1_item_ex_i2d(&intname.a,
  276|  7.65k|                     &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  427|  7.65k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  277|  7.65k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  278|  7.65k|                                         local_sk_X509_NAME_ENTRY_free);
  279|  7.65k|    a->modified = 0;
  280|  7.65k|    return len;
  281|      0| cerr:
  282|      0|    ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0| err:
  284|      0|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  285|      0|                                         local_sk_X509_NAME_ENTRY_free);
  286|      0|    return -1;
  287|      0|}
x_name.c:x509_name_ex_print:
  292|  7.65k|{
  293|  7.65k|    if (X509_NAME_print_ex(out, (const X509_NAME *)*pval,
  ------------------
  |  Branch (293:9): [True: 4, False: 7.64k]
  ------------------
  294|  7.65k|                           indent, pctx->nm_flags) <= 0)
  295|      4|        return 0;
  296|  7.64k|    return 2;
  297|  7.65k|}

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

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

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

FuzzerInitialize:
   21|      2|{
   22|      2|    FuzzerSetRand();
   23|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
   24|      2|    ERR_clear_error();
   25|      2|    CRYPTO_free_ex_index(0, -1);
   26|      2|    return 1;
   27|      2|}
FuzzerTestOneInput:
  171|  10.4k|{
  172|  10.4k|    OSSL_CMP_MSG *msg;
  173|  10.4k|    BIO *in;
  174|       |
  175|  10.4k|    if (len == 0)
  ------------------
  |  Branch (175:9): [True: 0, False: 10.4k]
  ------------------
  176|      0|        return 0;
  177|       |
  178|  10.4k|    in = BIO_new(BIO_s_mem());
  179|  10.4k|    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
  ------------------
  |  |  438|  10.4k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 10.4k, False: 0]
  |  |  ------------------
  ------------------
  180|  10.4k|    msg = d2i_OSSL_CMP_MSG_bio(in, NULL);
  181|  10.4k|    if (msg != NULL) {
  ------------------
  |  Branch (181:9): [True: 6.94k, False: 3.49k]
  ------------------
  182|  6.94k|        BIO *out = BIO_new(BIO_s_null());
  183|  6.94k|        OSSL_CMP_SRV_CTX *srv_ctx = OSSL_CMP_SRV_CTX_new(NULL, NULL);
  184|  6.94k|        OSSL_CMP_CTX *client_ctx = OSSL_CMP_CTX_new(NULL, NULL);
  185|       |
  186|  6.94k|        i2d_OSSL_CMP_MSG_bio(out, msg);
  187|  6.94k|        ASN1_item_print(out, (ASN1_VALUE *)msg, 4,
  188|  6.94k|                        ASN1_ITEM_rptr(OSSL_CMP_MSG), NULL);
  ------------------
  |  |  427|  6.94k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  189|  6.94k|        BIO_free(out);
  190|       |
  191|  6.94k|        if (client_ctx != NULL)
  ------------------
  |  Branch (191:13): [True: 6.94k, False: 0]
  ------------------
  192|  6.94k|            cmp_client_process_response(client_ctx, msg);
  193|  6.94k|        if (srv_ctx != NULL
  ------------------
  |  Branch (193:13): [True: 6.94k, False: 0]
  ------------------
  194|  6.94k|            && OSSL_CMP_CTX_set_log_cb(OSSL_CMP_SRV_CTX_get0_cmp_ctx(srv_ctx),
  ------------------
  |  Branch (194:16): [True: 6.94k, False: 0]
  ------------------
  195|  6.94k|                                       print_noop)
  196|  6.94k|            && OSSL_CMP_SRV_CTX_init(srv_ctx, NULL, process_cert_request,
  ------------------
  |  Branch (196:16): [True: 6.94k, False: 0]
  ------------------
  197|  6.94k|                                     process_rr, process_genm, process_error,
  198|  6.94k|                                     process_certConf, process_pollReq)
  199|  6.94k|            && OSSL_CMP_SRV_CTX_init_trans(srv_ctx, delayed_delivery,
  ------------------
  |  Branch (199:16): [True: 6.94k, False: 0]
  ------------------
  200|  6.94k|                                           clean_transaction))
  201|  6.94k|            OSSL_CMP_MSG_free(OSSL_CMP_SRV_process_request(srv_ctx, msg));
  202|       |
  203|  6.94k|        OSSL_CMP_CTX_free(client_ctx);
  204|  6.94k|        OSSL_CMP_SRV_CTX_free(srv_ctx);
  205|  6.94k|        OSSL_CMP_MSG_free(msg);
  206|  6.94k|    }
  207|       |
  208|  10.4k|    BIO_free(in);
  209|  10.4k|    ERR_clear_error();
  210|       |
  211|  10.4k|    return 0;
  212|  10.4k|}
cmp.c:cmp_client_process_response:
   52|  6.94k|{
   53|  6.94k|    X509_NAME *name = X509_NAME_new();
   54|  6.94k|    ASN1_INTEGER *serial = ASN1_INTEGER_new();
   55|       |
   56|  6.94k|    ctx->unprotectedSend = 1; /* satisfy ossl_cmp_msg_protect() */
   57|  6.94k|    ctx->disableConfirm = 1; /* check just one response message */
   58|  6.94k|    ctx->popoMethod = OSSL_CRMF_POPO_NONE; /* satisfy ossl_cmp_certReq_new() */
  ------------------
  |  |  224|  6.94k|#  define OSSL_CRMF_POPO_NONE       -1
  ------------------
   59|  6.94k|    ctx->oldCert = X509_new(); /* satisfy crm_new() and ossl_cmp_rr_new() */
   60|  6.94k|    if (!OSSL_CMP_CTX_set1_secretValue(ctx, (unsigned char *)"",
  ------------------
  |  Branch (60:9): [True: 0, False: 6.94k]
  ------------------
   61|  6.94k|                                       0) /* prevent too unspecific error */
   62|  6.94k|            || ctx->oldCert == NULL
  ------------------
  |  Branch (62:16): [True: 0, False: 6.94k]
  ------------------
   63|  6.94k|            || name == NULL || !X509_set_issuer_name(ctx->oldCert, name)
  ------------------
  |  Branch (63:16): [True: 0, False: 6.94k]
  |  Branch (63:32): [True: 0, False: 6.94k]
  ------------------
   64|  6.94k|            || serial == NULL || !X509_set_serialNumber(ctx->oldCert, serial))
  ------------------
  |  Branch (64:16): [True: 0, False: 6.94k]
  |  Branch (64:34): [True: 0, False: 6.94k]
  ------------------
   65|      0|        goto err;
   66|       |
   67|  6.94k|    (void)OSSL_CMP_CTX_set_transfer_cb(ctx, transfer_cb);
   68|  6.94k|    (void)OSSL_CMP_CTX_set_transfer_cb_arg(ctx, msg);
   69|  6.94k|    (void)OSSL_CMP_CTX_set_log_cb(ctx, print_noop);
   70|  6.94k|    num_responses = 0;
   71|  6.94k|    switch (msg->body != NULL ? msg->body->type : -1) {
  ------------------
  |  Branch (71:13): [True: 6.94k, False: 0]
  ------------------
   72|    255|    case OSSL_CMP_PKIBODY_IP:
  ------------------
  |  |  913|    255|# define OSSL_CMP_PKIBODY_IP        1
  ------------------
  |  Branch (72:5): [True: 255, False: 6.69k]
  ------------------
   73|    255|        (void)OSSL_CMP_exec_IR_ses(ctx);
  ------------------
  |  |  699|    255|    OSSL_CMP_exec_certreq(ctx, OSSL_CMP_IR, NULL)
  |  |  ------------------
  |  |  |  |  692|    255|#  define OSSL_CMP_IR    0
  |  |  ------------------
  ------------------
   74|    255|        break;
   75|     25|    case OSSL_CMP_PKIBODY_CP:
  ------------------
  |  |  915|     25|# define OSSL_CMP_PKIBODY_CP        3
  ------------------
  |  Branch (75:5): [True: 25, False: 6.92k]
  ------------------
   76|     25|        (void)OSSL_CMP_exec_CR_ses(ctx);
  ------------------
  |  |  701|     25|    OSSL_CMP_exec_certreq(ctx, OSSL_CMP_CR, NULL)
  |  |  ------------------
  |  |  |  |  693|     25|#  define OSSL_CMP_CR    2
  |  |  ------------------
  ------------------
   77|     25|        (void)OSSL_CMP_exec_P10CR_ses(ctx);
  ------------------
  |  |  703|     25|    OSSL_CMP_exec_certreq(ctx, OSSL_CMP_P10CR, NULL)
  |  |  ------------------
  |  |  |  |  694|     25|#  define OSSL_CMP_P10CR 4
  |  |  ------------------
  ------------------
   78|     25|        break;
   79|     23|    case OSSL_CMP_PKIBODY_KUP:
  ------------------
  |  |  920|     23|# define OSSL_CMP_PKIBODY_KUP       8
  ------------------
  |  Branch (79:5): [True: 23, False: 6.92k]
  ------------------
   80|     23|        (void)OSSL_CMP_exec_KUR_ses(ctx);
  ------------------
  |  |  705|     23|    OSSL_CMP_exec_certreq(ctx, OSSL_CMP_KUR, NULL)
  |  |  ------------------
  |  |  |  |  695|     23|#  define OSSL_CMP_KUR   7
  |  |  ------------------
  ------------------
   81|     23|        break;
   82|     70|    case OSSL_CMP_PKIBODY_POLLREP:
  ------------------
  |  |  938|     70|# define OSSL_CMP_PKIBODY_POLLREP  26
  ------------------
  |  Branch (82:5): [True: 70, False: 6.87k]
  ------------------
   83|     70|        ctx->status = OSSL_CMP_PKISTATUS_waiting;
  ------------------
  |  |  203|     70|#  define OSSL_CMP_PKISTATUS_waiting                3
  ------------------
   84|     70|        (void)OSSL_CMP_try_certreq(ctx, OSSL_CMP_PKIBODY_CR, NULL, NULL);
  ------------------
  |  |  914|     70|# define OSSL_CMP_PKIBODY_CR        2
  ------------------
   85|     70|        break;
   86|    109|    case OSSL_CMP_PKIBODY_RP:
  ------------------
  |  |  924|    109|# define OSSL_CMP_PKIBODY_RP       12
  ------------------
  |  Branch (86:5): [True: 109, False: 6.83k]
  ------------------
   87|    109|        (void)OSSL_CMP_exec_RR_ses(ctx);
   88|    109|        break;
   89|    226|    case OSSL_CMP_PKIBODY_GENP:
  ------------------
  |  |  934|    226|# define OSSL_CMP_PKIBODY_GENP     22
  ------------------
  |  Branch (89:5): [True: 226, False: 6.72k]
  ------------------
   90|    226|        sk_OSSL_CMP_ITAV_pop_free(OSSL_CMP_exec_GENM_ses(ctx),
  ------------------
  |  |  266|    226|#define sk_OSSL_CMP_ITAV_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc))
  ------------------
   91|    226|                                  OSSL_CMP_ITAV_free);
   92|    226|        break;
   93|  6.24k|    default:
  ------------------
  |  Branch (93:5): [True: 6.24k, False: 708]
  ------------------
   94|  6.24k|        (void)ossl_cmp_msg_check_update(ctx, msg, allow_unprotected, 0);
   95|  6.24k|        break;
   96|  6.94k|    }
   97|  6.94k| err:
   98|  6.94k|    X509_NAME_free(name);
   99|  6.94k|    ASN1_INTEGER_free(serial);
  100|  6.94k|}
cmp.c:allow_unprotected:
   47|  6.23k|{
   48|  6.23k|    return 1;
   49|  6.23k|}
cmp.c:print_noop:
   41|  63.1k|{
   42|  63.1k|    return 1;
   43|  63.1k|}
cmp.c:process_cert_request:
  110|    899|{
  111|    899|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
  ------------------
  |  |  401|    899|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    899|    (ERR_new(),                                                 \
  |  |  |  |  404|    899|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    899|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    899|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    899|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    899|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|    899|    return NULL;
  113|    899|}
cmp.c:process_rr:
  119|      4|{
  120|      4|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  121|      4|    return NULL;
  122|      4|}
cmp.c:process_genm:
  128|    161|{
  129|    161|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
  ------------------
  |  |  401|    161|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    161|    (ERR_new(),                                                 \
  |  |  |  |  404|    161|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    161|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    161|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    161|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    161|     ERR_set_error)
  |  |  ------------------
  ------------------
  130|    161|    return 0;
  131|    161|}
cmp.c:process_error:
  137|     90|{
  138|     90|    ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
  ------------------
  |  |  401|     90|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     90|    (ERR_new(),                                                 \
  |  |  |  |  404|     90|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     90|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     90|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     90|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     90|     ERR_set_error)
  |  |  ------------------
  ------------------
  139|     90|}
cmp.c:delayed_delivery:
  166|  2.29k|{
  167|  2.29k|    return 0;
  168|  2.29k|}
cmp.c:clean_transaction:
  160|  8.30k|{
  161|  8.30k|    return 1;
  162|  8.30k|}

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

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|  1.73k|{
  129|  1.73k|    *no_cache = 0;
  130|  1.73k|    switch (operation_id) {
  ------------------
  |  Branch (130:13): [True: 1.73k, False: 2]
  ------------------
  131|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  314|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (131:5): [True: 2, False: 1.73k]
  ------------------
  132|      2|        return fuzz_rand_rand;
  133|  1.73k|    }
  134|  1.73k|    return NULL;
  135|  1.73k|}
fuzz_rand.c:fuzz_rand_newctx:
   27|      3|{
   28|      3|    int *st = OPENSSL_malloc(sizeof(*st));
  ------------------
  |  |  102|      3|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|       |
   30|      3|    if (st != NULL)
  ------------------
  |  Branch (30:9): [True: 3, False: 0]
  ------------------
   31|      3|        *st = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1347|      3|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   32|      3|    return st;
   33|      3|}
fuzz_rand.c:fuzz_rand_freectx:
   36|      3|{
   37|      3|    OPENSSL_free(vrng);
  ------------------
  |  |  115|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      3|}
fuzz_rand.c:fuzz_rand_instantiate:
   46|      3|{
   47|      3|    *(int *)vrng = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      3|# define EVP_RAND_STATE_READY            1
  ------------------
   48|      3|    return 1;
   49|      3|}
fuzz_rand.c:fuzz_rand_generate:
   63|  46.6k|{
   64|  46.6k|    unsigned char val = 1;
   65|  46.6k|    size_t i;
   66|       |
   67|  1.57M|    for (i = 0; i < outlen; i++)
  ------------------
  |  Branch (67:17): [True: 1.52M, False: 46.6k]
  ------------------
   68|  1.52M|        out[i] = val++;
   69|  46.6k|    return 1;
   70|  46.6k|}
fuzz_rand.c:fuzz_rand_enable_locking:
   73|      1|{
   74|      1|    return 1;
   75|      1|}
fuzz_rand.c:fuzz_rand_get_ctx_params:
   78|  46.6k|{
   79|  46.6k|    OSSL_PARAM *p;
   80|       |
   81|  46.6k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|  46.6k|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
   82|  46.6k|    if (p != NULL && !OSSL_PARAM_set_int(p, *(int *)vrng))
  ------------------
  |  Branch (82:9): [True: 0, False: 46.6k]
  |  Branch (82:22): [True: 0, False: 0]
  ------------------
   83|      0|        return 0;
   84|       |
   85|  46.6k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|  46.6k|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   86|  46.6k|    if (p != NULL && !OSSL_PARAM_set_int(p, 500))
  ------------------
  |  Branch (86:9): [True: 0, False: 46.6k]
  |  Branch (86:22): [True: 0, False: 0]
  ------------------
   87|      0|        return 0;
   88|       |
   89|  46.6k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|  46.6k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
   90|  46.6k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, INT_MAX))
  ------------------
  |  Branch (90:9): [True: 46.6k, False: 0]
  |  Branch (90:22): [True: 0, False: 46.6k]
  ------------------
   91|      0|        return 0;
   92|  46.6k|    return 1;
   93|  46.6k|}

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

SHA1_Update:
  155|   231k|{
  156|   231k|    const unsigned char *data = data_;
  157|   231k|    unsigned char *p;
  158|   231k|    HASH_LONG l;
  ------------------
  |  |   19|   231k|#define HASH_LONG               SHA_LONG
  |  |  ------------------
  |  |  |  |   34|   231k|#  define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  159|   231k|    size_t n;
  160|       |
  161|   231k|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 231k]
  ------------------
  162|      0|        return 1;
  163|       |
  164|   231k|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|   231k|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 231k]
  ------------------
  166|      0|        c->Nh++;
  167|   231k|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|   231k|    c->Nl = l;
  170|       |
  171|   231k|    n = c->num;
  172|   231k|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 180, False: 231k]
  ------------------
  173|    180|        p = (unsigned char *)c->data;
  174|       |
  175|    180|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   21|    180|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|    360|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|    180|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   21|    180|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|    180|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|    180|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (175:13): [True: 0, False: 180]
  |  Branch (175:35): [True: 0, False: 180]
  ------------------
  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|    180|        } else {
  190|    180|            memcpy(p + n, data, len);
  191|    180|            c->num += (unsigned int)len;
  192|    180|            return 1;
  193|    180|        }
  194|    180|    }
  195|       |
  196|   231k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   21|   231k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   231k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   231k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|   231k|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 1.97k, False: 229k]
  ------------------
  198|  1.97k|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |   35|  1.97k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  199|  1.97k|        n *= HASH_CBLOCK;
  ------------------
  |  |   21|  1.97k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  1.97k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.97k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|  1.97k|        data += n;
  201|  1.97k|        len -= n;
  202|  1.97k|    }
  203|       |
  204|   231k|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 231k, False: 65]
  ------------------
  205|   231k|        p = (unsigned char *)c->data;
  206|   231k|        c->num = (unsigned int)len;
  207|   231k|        memcpy(p, data, len);
  208|   231k|    }
  209|   231k|    return 1;
  210|   231k|}
SHA1_Final:
  218|   231k|{
  219|   231k|    unsigned char *p = (unsigned char *)c->data;
  220|   231k|    size_t n = c->num;
  221|       |
  222|   231k|    p[n] = 0x80;                /* there is always room for one */
  223|   231k|    n++;
  224|       |
  225|   231k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   21|   231k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   231k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   231k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 102, False: 230k]
  ------------------
  226|    102|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   21|    102|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|    102|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|    102|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|    102|        n = 0;
  228|    102|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|    102|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  229|    102|    }
  230|   231k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   21|   231k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   231k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   231k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|   231k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   21|   231k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   231k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   231k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|   231k|# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|   231k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|   231k|                         l)
  ------------------
  235|   231k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|   231k|                         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|   231k|    p -= HASH_CBLOCK;
  ------------------
  |  |   21|   231k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   231k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   231k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|   231k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|   231k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  242|   231k|    c->num = 0;
  243|   231k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   21|   231k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   231k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   231k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|   231k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   22|   231k|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   23|   231k|        unsigned long ll;               \
  |  |   24|   231k|        ll=(c)->h0; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   231k|                         l)
  |  |  ------------------
  |  |   25|   231k|        ll=(c)->h1; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   231k|                         l)
  |  |  ------------------
  |  |   26|   231k|        ll=(c)->h2; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   231k|                         l)
  |  |  ------------------
  |  |   27|   231k|        ll=(c)->h3; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   231k|                         l)
  |  |  ------------------
  |  |   28|   231k|        ll=(c)->h4; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|   231k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   231k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   231k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   231k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   231k|                         l)
  |  |  ------------------
  |  |   29|   231k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (29:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|   231k|# endif
  250|       |
  251|   231k|    return 1;
  252|   231k|}
SHA256_Update:
  155|  74.2k|{
  156|  74.2k|    const unsigned char *data = data_;
  157|  74.2k|    unsigned char *p;
  158|  74.2k|    HASH_LONG l;
  ------------------
  |  |   76|  74.2k|#define HASH_LONG               SHA_LONG
  |  |  ------------------
  |  |  |  |   34|  74.2k|#  define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  159|  74.2k|    size_t n;
  160|       |
  161|  74.2k|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 74.2k]
  ------------------
  162|      0|        return 1;
  163|       |
  164|  74.2k|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|  74.2k|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 74.2k]
  ------------------
  166|      0|        c->Nh++;
  167|  74.2k|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|  74.2k|    c->Nl = l;
  170|       |
  171|  74.2k|    n = c->num;
  172|  74.2k|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 0, False: 74.2k]
  ------------------
  173|      0|        p = (unsigned char *)c->data;
  174|       |
  175|      0|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   78|      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) {
  ------------------
  |  |   78|      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);
  ------------------
  |  |   78|      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);
  ------------------
  |  |  120|      0|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  178|      0|            n = HASH_CBLOCK - n;
  ------------------
  |  |   78|      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 */
  ------------------
  |  |   78|      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|  74.2k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   78|  74.2k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  74.2k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  74.2k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  74.2k|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 225, False: 73.9k]
  ------------------
  198|    225|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |  120|    225|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  199|    225|        n *= HASH_CBLOCK;
  ------------------
  |  |   78|    225|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|    225|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|    225|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|    225|        data += n;
  201|    225|        len -= n;
  202|    225|    }
  203|       |
  204|  74.2k|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 74.1k, False: 14]
  ------------------
  205|  74.1k|        p = (unsigned char *)c->data;
  206|  74.1k|        c->num = (unsigned int)len;
  207|  74.1k|        memcpy(p, data, len);
  208|  74.1k|    }
  209|  74.2k|    return 1;
  210|  74.2k|}
SHA256_Final:
  218|  74.1k|{
  219|  74.1k|    unsigned char *p = (unsigned char *)c->data;
  220|  74.1k|    size_t n = c->num;
  221|       |
  222|  74.1k|    p[n] = 0x80;                /* there is always room for one */
  223|  74.1k|    n++;
  224|       |
  225|  74.1k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   78|  74.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  74.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  74.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 2, False: 74.1k]
  ------------------
  226|      2|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   78|      2|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      2|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      2|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|      2|        n = 0;
  228|      2|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  120|      2|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  229|      2|    }
  230|  74.1k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   78|  74.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  74.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  74.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|  74.1k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   78|  74.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  74.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  74.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|  74.1k|# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|  74.1k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  130|  74.1k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|  74.1k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|  74.1k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|  74.1k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|  74.1k|                         l)
  ------------------
  235|  74.1k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  130|  74.1k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|  74.1k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|  74.1k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|  74.1k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|  74.1k|                         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|  74.1k|    p -= HASH_CBLOCK;
  ------------------
  |  |   78|  74.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  74.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  74.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  74.1k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  120|  74.1k|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  242|  74.1k|    c->num = 0;
  243|  74.1k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   78|  74.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  74.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  74.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|  74.1k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   88|  74.1k|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   89|  74.1k|        unsigned long ll;               \
  |  |   90|  74.1k|        unsigned int  nn;               \
  |  |   91|  74.1k|        switch ((c)->md_len) {          \
  |  |   92|      0|            case SHA256_192_DIGEST_LENGTH: \
  |  |  ------------------
  |  |  |  |   84|      0|# define SHA256_192_DIGEST_LENGTH 24
  |  |  ------------------
  |  |  |  Branch (92:13): [True: 0, False: 74.1k]
  |  |  ------------------
  |  |   93|      0|                for (nn=0;nn<SHA256_192_DIGEST_LENGTH/4;nn++) { \
  |  |  ------------------
  |  |  |  |   84|      0|# define SHA256_192_DIGEST_LENGTH 24
  |  |  ------------------
  |  |  |  Branch (93:27): [True: 0, False: 0]
  |  |  ------------------
  |  |   94|      0|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|      0|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|      0|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|      0|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|      0|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|      0|                         l)
  |  |  ------------------
  |  |   95|      0|                }                       \
  |  |   96|      0|                break;                  \
  |  |   97|  52.2k|            case SHA224_DIGEST_LENGTH:  \
  |  |  ------------------
  |  |  |  |   85|  52.2k|# define SHA224_DIGEST_LENGTH    28
  |  |  ------------------
  |  |  |  Branch (97:13): [True: 52.2k, False: 21.9k]
  |  |  ------------------
  |  |   98|   418k|                for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) {     \
  |  |  ------------------
  |  |  |  |   85|   418k|# define SHA224_DIGEST_LENGTH    28
  |  |  ------------------
  |  |  |  Branch (98:27): [True: 366k, False: 52.2k]
  |  |  ------------------
  |  |   99|   366k|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|   366k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   366k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   366k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   366k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   366k|                         l)
  |  |  ------------------
  |  |  100|   366k|                }                       \
  |  |  101|  52.2k|                break;                  \
  |  |  102|  21.9k|            case SHA256_DIGEST_LENGTH:  \
  |  |  ------------------
  |  |  |  |   86|  21.9k|# define SHA256_DIGEST_LENGTH    32
  |  |  ------------------
  |  |  |  Branch (102:13): [True: 21.9k, False: 52.2k]
  |  |  ------------------
  |  |  103|   197k|                for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) {     \
  |  |  ------------------
  |  |  |  |   86|   197k|# define SHA256_DIGEST_LENGTH    32
  |  |  ------------------
  |  |  |  Branch (103:27): [True: 175k, False: 21.9k]
  |  |  ------------------
  |  |  104|   175k|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|   175k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|   175k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|   175k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|   175k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|   175k|                         l)
  |  |  ------------------
  |  |  105|   175k|                }                       \
  |  |  106|  21.9k|                break;                  \
  |  |  107|      0|            default:                    \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 0, False: 74.1k]
  |  |  ------------------
  |  |  108|      0|                if ((c)->md_len > SHA256_DIGEST_LENGTH) \
  |  |  ------------------
  |  |  |  |   86|      0|# define SHA256_DIGEST_LENGTH    32
  |  |  ------------------
  |  |  |  Branch (108:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|                    return 0;                           \
  |  |  110|      0|                for (nn=0;nn<(c)->md_len/4;nn++) {              \
  |  |  ------------------
  |  |  |  Branch (110:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  111|      0|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|      0|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|      0|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|      0|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|      0|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|      0|                         l)
  |  |  ------------------
  |  |  112|      0|                }                       \
  |  |  113|      0|                break;                  \
  |  |  114|  74.1k|        }                               \
  |  |  115|  74.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (115:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|  74.1k|# endif
  250|       |
  251|  74.1k|    return 1;
  252|  74.1k|}
MD5_Update:
  155|     88|{
  156|     88|    const unsigned char *data = data_;
  157|     88|    unsigned char *p;
  158|     88|    HASH_LONG l;
  ------------------
  |  |   32|     88|#define HASH_LONG               MD5_LONG
  |  |  ------------------
  |  |  |  |   36|     88|#   define MD5_LONG unsigned int
  |  |  ------------------
  ------------------
  159|     88|    size_t n;
  160|       |
  161|     88|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 88]
  ------------------
  162|      0|        return 1;
  163|       |
  164|     88|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|     88|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 88]
  ------------------
  166|      0|        c->Nh++;
  167|     88|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|     88|    c->Nl = l;
  170|       |
  171|     88|    n = c->num;
  172|     88|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 0, False: 88]
  ------------------
  173|      0|        p = (unsigned char *)c->data;
  174|       |
  175|      0|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   34|      0|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|      0|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   34|      0|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|      0|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  |  Branch (175:13): [True: 0, False: 0]
  |  Branch (175:35): [True: 0, False: 0]
  ------------------
  176|      0|            memcpy(p + n, data, HASH_CBLOCK - n);
  ------------------
  |  |   34|      0|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|      0|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  177|      0|            HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   45|      0|#define HASH_BLOCK_DATA_ORDER   md5_block_data_order
  |  |  ------------------
  |  |  |  |   20|      0|#  define md5_block_data_order ossl_md5_block_asm_data_order
  |  |  ------------------
  ------------------
  178|      0|            n = HASH_CBLOCK - n;
  ------------------
  |  |   34|      0|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|      0|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  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 */
  ------------------
  |  |   34|      0|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|      0|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  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|     88|    n = len / HASH_CBLOCK;
  ------------------
  |  |   34|     88|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     88|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  197|     88|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 75, False: 13]
  ------------------
  198|     75|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |   45|     75|#define HASH_BLOCK_DATA_ORDER   md5_block_data_order
  |  |  ------------------
  |  |  |  |   20|     75|#  define md5_block_data_order ossl_md5_block_asm_data_order
  |  |  ------------------
  ------------------
  199|     75|        n *= HASH_CBLOCK;
  ------------------
  |  |   34|     75|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     75|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  200|     75|        data += n;
  201|     75|        len -= n;
  202|     75|    }
  203|       |
  204|     88|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 59, False: 29]
  ------------------
  205|     59|        p = (unsigned char *)c->data;
  206|     59|        c->num = (unsigned int)len;
  207|     59|        memcpy(p, data, len);
  208|     59|    }
  209|     88|    return 1;
  210|     88|}
MD5_Final:
  218|     62|{
  219|     62|    unsigned char *p = (unsigned char *)c->data;
  220|     62|    size_t n = c->num;
  221|       |
  222|     62|    p[n] = 0x80;                /* there is always room for one */
  223|     62|    n++;
  224|       |
  225|     62|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   34|     62|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     62|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 1, False: 61]
  ------------------
  226|      1|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   34|      1|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|      1|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  227|      1|        n = 0;
  228|      1|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   45|      1|#define HASH_BLOCK_DATA_ORDER   md5_block_data_order
  |  |  ------------------
  |  |  |  |   20|      1|#  define md5_block_data_order ossl_md5_block_asm_data_order
  |  |  ------------------
  ------------------
  229|      1|    }
  230|     62|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   34|     62|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     62|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  231|       |
  232|     62|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   34|     62|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     62|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  233|       |# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|       |    (void)HOST_l2c(c->Nh, p);
  235|       |    (void)HOST_l2c(c->Nl, p);
  236|       |# elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
  237|     62|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  142|     62|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  143|     62|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  144|     62|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  145|     62|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  146|     62|                         l)
  ------------------
  238|     62|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  142|     62|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  143|     62|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  144|     62|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  145|     62|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  146|     62|                         l)
  ------------------
  239|     62|# endif
  240|     62|    p -= HASH_CBLOCK;
  ------------------
  |  |   34|     62|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     62|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  241|     62|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   45|     62|#define HASH_BLOCK_DATA_ORDER   md5_block_data_order
  |  |  ------------------
  |  |  |  |   20|     62|#  define md5_block_data_order ossl_md5_block_asm_data_order
  |  |  ------------------
  ------------------
  242|     62|    c->num = 0;
  243|     62|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   34|     62|#define HASH_CBLOCK             MD5_CBLOCK
  |  |  ------------------
  |  |  |  |   38|     62|#   define MD5_CBLOCK      64
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|     62|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   38|     62|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   39|     62|        unsigned long ll;               \
  |  |   40|     62|        ll=(c)->A; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|     62|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|     62|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|     62|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|     62|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|     62|                         l)
  |  |  ------------------
  |  |   41|     62|        ll=(c)->B; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|     62|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|     62|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|     62|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|     62|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|     62|                         l)
  |  |  ------------------
  |  |   42|     62|        ll=(c)->C; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|     62|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|     62|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|     62|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|     62|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|     62|                         l)
  |  |  ------------------
  |  |   43|     62|        ll=(c)->D; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|     62|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|     62|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|     62|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|     62|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|     62|                         l)
  |  |  ------------------
  |  |   44|     62|        } while (0)
  |  |  ------------------
  |  |  |  Branch (44:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|     62|# endif
  250|       |
  251|     62|    return 1;
  252|     62|}
RIPEMD160_Update:
  155|   199k|{
  156|   199k|    const unsigned char *data = data_;
  157|   199k|    unsigned char *p;
  158|   199k|    HASH_LONG l;
  ------------------
  |  |   29|   199k|#define HASH_LONG               RIPEMD160_LONG
  |  |  ------------------
  |  |  |  |   32|   199k|#   define RIPEMD160_LONG unsigned int
  |  |  ------------------
  ------------------
  159|   199k|    size_t n;
  160|       |
  161|   199k|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 199k]
  ------------------
  162|      0|        return 1;
  163|       |
  164|   199k|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|   199k|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 199k]
  ------------------
  166|      0|        c->Nh++;
  167|   199k|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|   199k|    c->Nl = l;
  170|       |
  171|   199k|    n = c->num;
  172|   199k|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 0, False: 199k]
  ------------------
  173|      0|        p = (unsigned char *)c->data;
  174|       |
  175|      0|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  |  Branch (175:13): [True: 0, False: 0]
  |  Branch (175:35): [True: 0, False: 0]
  ------------------
  176|      0|            memcpy(p + n, data, HASH_CBLOCK - n);
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  177|      0|            HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   43|      0|#define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
  ------------------
  178|      0|            n = HASH_CBLOCK - n;
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  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 */
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  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|   199k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   31|   199k|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|   199k|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  197|   199k|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 0, False: 199k]
  ------------------
  198|      0|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |   43|      0|#define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
  ------------------
  199|      0|        n *= HASH_CBLOCK;
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  200|      0|        data += n;
  201|      0|        len -= n;
  202|      0|    }
  203|       |
  204|   199k|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 199k, False: 0]
  ------------------
  205|   199k|        p = (unsigned char *)c->data;
  206|   199k|        c->num = (unsigned int)len;
  207|   199k|        memcpy(p, data, len);
  208|   199k|    }
  209|   199k|    return 1;
  210|   199k|}
RIPEMD160_Final:
  218|   199k|{
  219|   199k|    unsigned char *p = (unsigned char *)c->data;
  220|   199k|    size_t n = c->num;
  221|       |
  222|   199k|    p[n] = 0x80;                /* there is always room for one */
  223|   199k|    n++;
  224|       |
  225|   199k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   31|   199k|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|   199k|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 0, False: 199k]
  ------------------
  226|      0|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   31|      0|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|      0|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  227|      0|        n = 0;
  228|      0|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   43|      0|#define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
  ------------------
  229|      0|    }
  230|   199k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   31|   199k|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|   199k|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  231|       |
  232|   199k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   31|   199k|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|   199k|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  233|       |# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|       |    (void)HOST_l2c(c->Nh, p);
  235|       |    (void)HOST_l2c(c->Nl, p);
  236|       |# elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
  237|   199k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  146|   199k|                         l)
  ------------------
  238|   199k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  146|   199k|                         l)
  ------------------
  239|   199k|# endif
  240|   199k|    p -= HASH_CBLOCK;
  ------------------
  |  |   31|   199k|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|   199k|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  241|   199k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   43|   199k|#define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
  ------------------
  242|   199k|    c->num = 0;
  243|   199k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   31|   199k|#define HASH_CBLOCK             RIPEMD160_CBLOCK
  |  |  ------------------
  |  |  |  |   34|   199k|#   define RIPEMD160_CBLOCK        64
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|   199k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   35|   199k|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   36|   199k|        unsigned long ll;               \
  |  |   37|   199k|        ll=(c)->A; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|   199k|                         l)
  |  |  ------------------
  |  |   38|   199k|        ll=(c)->B; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|   199k|                         l)
  |  |  ------------------
  |  |   39|   199k|        ll=(c)->C; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|   199k|                         l)
  |  |  ------------------
  |  |   40|   199k|        ll=(c)->D; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|   199k|                         l)
  |  |  ------------------
  |  |   41|   199k|        ll=(c)->E; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  142|   199k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  143|   199k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  144|   199k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  145|   199k|                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  146|   199k|                         l)
  |  |  ------------------
  |  |   42|   199k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (42:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|   199k|# endif
  250|       |
  251|   199k|    return 1;
  252|   199k|}

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|  1.64k|    { \
   57|  1.64k|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|  1.64k|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|  1.64k|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    342|    { \
   69|    342|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    342|    } \
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|  43.3k|    { \
   63|  43.3k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  43.3k|    } \
property.c:ossl_sa_ALGORITHM_num:
   42|  1.63k|    { \
   43|  1.63k|        return ossl_sa_num((OPENSSL_SA *)sa); \
   44|  1.63k|    } \
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|   178M|{
   46|   178M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 178M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   178M|    return expr;
   50|   178M|}
cmp_ctx.c:ossl_assert_int:
   45|    303|{
   46|    303|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 303]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    303|    return expr;
   50|    303|}
cmp_hdr.c:ossl_assert_int:
   45|  64.7k|{
   46|  64.7k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 64.7k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  64.7k|    return expr;
   50|  64.7k|}
cmp_msg.c:ossl_assert_int:
   45|  45.9k|{
   46|  45.9k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 45.9k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  45.9k|    return expr;
   50|  45.9k|}
cmp_protect.c:ossl_assert_int:
   45|  8.62k|{
   46|  8.62k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 8.62k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  8.62k|    return expr;
   50|  8.62k|}
cmp_server.c:ossl_assert_int:
   45|  8.55k|{
   46|  8.55k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 8.55k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  8.55k|    return expr;
   50|  8.55k|}
cmp_util.c:ossl_assert_int:
   45|  14.2k|{
   46|  14.2k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 14.2k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  14.2k|    return expr;
   50|  14.2k|}
cmp_vfy.c:ossl_assert_int:
   45|  15.4k|{
   46|  15.4k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 15.4k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  15.4k|    return expr;
   50|  15.4k|}
err.c:ossl_assert_int:
   45|  1.23k|{
   46|  1.23k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.23k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.23k|    return expr;
   50|  1.23k|}
digest.c:ossl_assert_int:
   45|   660k|{
   46|   660k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 660k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   660k|    return expr;
   50|   660k|}
evp_fetch.c:ossl_assert_int:
   45|   129k|{
   46|   129k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 129k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   129k|    return expr;
   50|   129k|}
m_sigver.c:ossl_assert_int:
   45|    982|{
   46|    982|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 982]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    982|    return expr;
   50|    982|}
p_lib.c:ossl_assert_int:
   45|   324k|{
   46|   324k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 324k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   324k|    return expr;
   50|   324k|}
pmeth_lib.c:ossl_assert_int:
   45|  2.04k|{
   46|  2.04k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.04k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.04k|    return expr;
   50|  2.04k|}
core_algorithm.c:ossl_assert_int:
   45|      3|{
   46|      3|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 3]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|      3|    return expr;
   50|      3|}
core_fetch.c:ossl_assert_int:
   45|  3.48k|{
   46|  3.48k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 3.48k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  3.48k|    return expr;
   50|  3.48k|}
core_namemap.c:ossl_assert_int:
   45|  1.02k|{
   46|  1.02k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.02k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.02k|    return expr;
   50|  1.02k|}
provider_core.c:ossl_assert_int:
   45|  3.48k|{
   46|  3.48k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 3.48k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  3.48k|    return expr;
   50|  3.48k|}
threads_pthread.c:ossl_assert_int:
   45|  1.59M|{
   46|  1.59M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.59M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.59M|    return expr;
   50|  1.59M|}
defn_cache.c:ossl_assert_int:
   45|    434|{
   46|    434|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 434]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    434|    return expr;
   50|    434|}
property.c:ossl_assert_int:
   45|    240|{
   46|    240|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 240]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    240|    return expr;
   50|    240|}
x_pubkey.c:ossl_assert_int:
   45|   112k|{
   46|   112k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 112k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   112k|    return expr;
   50|   112k|}
decoder_lib.c:ossl_assert_int:
   45|   306k|{
   46|   306k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 306k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   306k|    return expr;
   50|   306k|}
decoder_meth.c:ossl_assert_int:
   45|   545k|{
   46|   545k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 545k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   545k|    return expr;
   50|   545k|}
ctrl_params_translate.c:ossl_assert_int:
   45|  80.6k|{
   46|  80.6k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 80.6k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  80.6k|    return expr;
   50|  80.6k|}
hmac.c:ossl_assert_int:
   45|     60|{
   46|     60|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 60]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     60|    return expr;
   50|     60|}
packet.c:ossl_assert_int:
   45|   241k|{
   46|   241k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 241k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   241k|    return expr;
   50|   241k|}

bn_lib.c:constant_time_msb:
  104|  1.15k|{
  105|  1.15k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  106|  1.15k|}
bn_lib.c:constant_time_eq_int:
  262|  1.15k|{
  263|  1.15k|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  264|  1.15k|}
bn_lib.c:constant_time_eq:
  241|  1.15k|{
  242|  1.15k|    return constant_time_is_zero(a ^ b);
  243|  1.15k|}
bn_lib.c:constant_time_is_zero:
  215|  1.15k|{
  216|  1.15k|    return constant_time_msb(~a & (a - 1));
  217|  1.15k|}

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

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

tasn_utl.c:CRYPTO_NEW_REF:
  280|  10.5k|{
  281|  10.5k|    refcnt->val = n;
  282|  10.5k|    return 1;
  283|  10.5k|}
tasn_utl.c:CRYPTO_FREE_REF:
  285|  10.5k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  10.5k|{
  287|  10.5k|}
tasn_utl.c:CRYPTO_DOWN_REF:
   56|  12.4k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  12.4k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  12.4k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 10.5k, False: 1.85k]
  ------------------
   66|  10.5k|        atomic_thread_fence(memory_order_acquire);
   67|  12.4k|#   endif
   68|  12.4k|    return 1;
   69|  12.4k|}
bio_lib.c:CRYPTO_NEW_REF:
  280|   311k|{
  281|   311k|    refcnt->val = n;
  282|   311k|    return 1;
  283|   311k|}
bio_lib.c:CRYPTO_FREE_REF:
  285|   311k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|   311k|{
  287|   311k|}
bio_lib.c:CRYPTO_DOWN_REF:
   56|   425k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   425k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   425k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 311k, False: 113k]
  ------------------
   66|   311k|        atomic_thread_fence(memory_order_acquire);
   67|   425k|#   endif
   68|   425k|    return 1;
   69|   425k|}
bio_lib.c:CRYPTO_UP_REF:
   40|   113k|{
   41|   113k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   113k|    return 1;
   43|   113k|}
digest.c:CRYPTO_NEW_REF:
  280|     27|{
  281|     27|    refcnt->val = n;
  282|     27|    return 1;
  283|     27|}
digest.c:CRYPTO_UP_REF:
   40|  44.5k|{
   41|  44.5k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  44.5k|    return 1;
   43|  44.5k|}
digest.c:CRYPTO_DOWN_REF:
   56|  44.5k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  44.5k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  44.5k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 27, False: 44.5k]
  ------------------
   66|     27|        atomic_thread_fence(memory_order_acquire);
   67|  44.5k|#   endif
   68|  44.5k|    return 1;
   69|  44.5k|}
evp_lib.c:CRYPTO_FREE_REF:
  285|     27|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     27|{
  287|     27|}
keymgmt_meth.c:CRYPTO_NEW_REF:
  280|     40|{
  281|     40|    refcnt->val = n;
  282|     40|    return 1;
  283|     40|}
keymgmt_meth.c:CRYPTO_UP_REF:
   40|   131k|{
   41|   131k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   131k|    return 1;
   43|   131k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   56|   131k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   131k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   131k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 40, False: 131k]
  ------------------
   66|     40|        atomic_thread_fence(memory_order_acquire);
   67|   131k|#   endif
   68|   131k|    return 1;
   69|   131k|}
keymgmt_meth.c:CRYPTO_FREE_REF:
  285|     40|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     40|{
  287|     40|}
mac_meth.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
mac_meth.c:CRYPTO_UP_REF:
   40|  2.65k|{
   41|  2.65k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  2.65k|    return 1;
   43|  2.65k|}
mac_meth.c:CRYPTO_DOWN_REF:
   56|  2.66k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  2.66k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.66k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 2.65k]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|  2.66k|#   endif
   68|  2.66k|    return 1;
   69|  2.66k|}
mac_meth.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}
p_lib.c:CRYPTO_NEW_REF:
  280|  69.7k|{
  281|  69.7k|    refcnt->val = n;
  282|  69.7k|    return 1;
  283|  69.7k|}
p_lib.c:CRYPTO_FREE_REF:
  285|  69.7k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  69.7k|{
  287|  69.7k|}
p_lib.c:CRYPTO_UP_REF:
   40|  21.5k|{
   41|  21.5k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  21.5k|    return 1;
   43|  21.5k|}
p_lib.c:CRYPTO_DOWN_REF:
   56|  91.3k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  91.3k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  91.3k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 69.7k, False: 21.5k]
  ------------------
   66|  69.7k|        atomic_thread_fence(memory_order_acquire);
   67|  91.3k|#   endif
   68|  91.3k|    return 1;
   69|  91.3k|}
signature.c:CRYPTO_DOWN_REF:
   56|  2.06k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  2.06k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.06k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 59, False: 2.00k]
  ------------------
   66|     59|        atomic_thread_fence(memory_order_acquire);
   67|  2.06k|#   endif
   68|  2.06k|    return 1;
   69|  2.06k|}
signature.c:CRYPTO_FREE_REF:
  285|     59|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     59|{
  287|     59|}
signature.c:CRYPTO_UP_REF:
   40|  2.00k|{
   41|  2.00k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  2.00k|    return 1;
   43|  2.00k|}
signature.c:CRYPTO_NEW_REF:
  280|     59|{
  281|     59|    refcnt->val = n;
  282|     59|    return 1;
  283|     59|}
provider_core.c:CRYPTO_UP_REF:
   40|  3.69k|{
   41|  3.69k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  3.69k|    return 1;
   43|  3.69k|}
provider_core.c:CRYPTO_NEW_REF:
  280|      3|{
  281|      3|    refcnt->val = n;
  282|      3|    return 1;
  283|      3|}
provider_core.c:CRYPTO_DOWN_REF:
   56|  3.69k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  3.69k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  3.69k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1, False: 3.69k]
  ------------------
   66|      1|        atomic_thread_fence(memory_order_acquire);
   67|  3.69k|#   endif
   68|  3.69k|    return 1;
   69|  3.69k|}
provider_core.c:CRYPTO_FREE_REF:
  285|      1|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      1|{
  287|      1|}
rsa_lib.c:CRYPTO_NEW_REF:
  280|  9.12k|{
  281|  9.12k|    refcnt->val = n;
  282|  9.12k|    return 1;
  283|  9.12k|}
rsa_lib.c:CRYPTO_DOWN_REF:
   56|  17.3k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  17.3k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  17.3k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9.12k, False: 8.24k]
  ------------------
   66|  9.12k|        atomic_thread_fence(memory_order_acquire);
   67|  17.3k|#   endif
   68|  17.3k|    return 1;
   69|  17.3k|}
rsa_lib.c:CRYPTO_FREE_REF:
  285|  9.12k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  9.12k|{
  287|  9.12k|}
rsa_lib.c:CRYPTO_UP_REF:
   40|  8.24k|{
   41|  8.24k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  8.24k|    return 1;
   43|  8.24k|}
x509_set.c:CRYPTO_UP_REF:
   40|  1.85k|{
   41|  1.85k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  1.85k|    return 1;
   43|  1.85k|}
ossl_core_bio.c:CRYPTO_UP_REF:
   40|   113k|{
   41|   113k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   113k|    return 1;
   43|   113k|}
ossl_core_bio.c:CRYPTO_DOWN_REF:
   56|   227k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   227k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   227k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 113k, False: 113k]
  ------------------
   66|   113k|        atomic_thread_fence(memory_order_acquire);
   67|   227k|#   endif
   68|   227k|    return 1;
   69|   227k|}
ossl_core_bio.c:CRYPTO_FREE_REF:
  285|   113k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|   113k|{
  287|   113k|}
ossl_core_bio.c:CRYPTO_NEW_REF:
  280|   113k|{
  281|   113k|    refcnt->val = n;
  282|   113k|    return 1;
  283|   113k|}
dh_lib.c:CRYPTO_NEW_REF:
  280|  2.29k|{
  281|  2.29k|    refcnt->val = n;
  282|  2.29k|    return 1;
  283|  2.29k|}
dh_lib.c:CRYPTO_DOWN_REF:
   56|  2.43k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  2.43k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.43k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 2.29k, False: 143]
  ------------------
   66|  2.29k|        atomic_thread_fence(memory_order_acquire);
   67|  2.43k|#   endif
   68|  2.43k|    return 1;
   69|  2.43k|}
dh_lib.c:CRYPTO_FREE_REF:
  285|  2.29k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  2.29k|{
  287|  2.29k|}
dh_lib.c:CRYPTO_UP_REF:
   40|    143|{
   41|    143|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    143|    return 1;
   43|    143|}
dsa_lib.c:CRYPTO_NEW_REF:
  280|  1.99k|{
  281|  1.99k|    refcnt->val = n;
  282|  1.99k|    return 1;
  283|  1.99k|}
dsa_lib.c:CRYPTO_DOWN_REF:
   56|  2.07k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  2.07k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.07k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1.99k, False: 86]
  ------------------
   66|  1.99k|        atomic_thread_fence(memory_order_acquire);
   67|  2.07k|#   endif
   68|  2.07k|    return 1;
   69|  2.07k|}
dsa_lib.c:CRYPTO_FREE_REF:
  285|  1.99k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  1.99k|{
  287|  1.99k|}
dsa_lib.c:CRYPTO_UP_REF:
   40|     86|{
   41|     86|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     86|    return 1;
   43|     86|}
ec_key.c:CRYPTO_DOWN_REF:
   56|  45.4k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  45.4k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  45.4k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 32.7k, False: 12.7k]
  ------------------
   66|  32.7k|        atomic_thread_fence(memory_order_acquire);
   67|  45.4k|#   endif
   68|  45.4k|    return 1;
   69|  45.4k|}
ec_key.c:CRYPTO_FREE_REF:
  285|  32.7k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  32.7k|{
  287|  32.7k|}
ec_key.c:CRYPTO_UP_REF:
   40|  12.7k|{
   41|  12.7k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  12.7k|    return 1;
   43|  12.7k|}
ec_kmeth.c:CRYPTO_NEW_REF:
  280|  32.7k|{
  281|  32.7k|    refcnt->val = n;
  282|  32.7k|    return 1;
  283|  32.7k|}
ecx_key.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
ecx_key.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}
ecx_key.c:CRYPTO_DOWN_REF:
   56|     18|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     18|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     18|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 9]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|     18|#   endif
   68|     18|    return 1;
   69|     18|}
ecx_key.c:CRYPTO_UP_REF:
   40|      9|{
   41|      9|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|      9|    return 1;
   43|      9|}
decoder_meth.c:CRYPTO_UP_REF:
   40|   276k|{
   41|   276k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   276k|    return 1;
   43|   276k|}
decoder_meth.c:CRYPTO_DOWN_REF:
   56|   276k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|   276k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   276k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 76, False: 276k]
  ------------------
   66|     76|        atomic_thread_fence(memory_order_acquire);
   67|   276k|#   endif
   68|   276k|    return 1;
   69|   276k|}
decoder_meth.c:CRYPTO_FREE_REF:
  285|     76|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     76|{
  287|     76|}
decoder_meth.c:CRYPTO_NEW_REF:
  280|     76|{
  281|     76|    refcnt->val = n;
  282|     76|    return 1;
  283|     76|}
evp_rand.c:CRYPTO_UP_REF:
   40|     19|{
   41|     19|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     19|    return 1;
   43|     19|}
evp_rand.c:CRYPTO_NEW_REF:
  280|     10|{
  281|     10|    refcnt->val = n;
  282|     10|    return 1;
  283|     10|}
evp_rand.c:CRYPTO_FREE_REF:
  285|     10|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     10|{
  287|     10|}
evp_rand.c:CRYPTO_DOWN_REF:
   56|     29|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     29|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     29|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 10, False: 19]
  ------------------
   66|     10|        atomic_thread_fence(memory_order_acquire);
   67|     29|#   endif
   68|     29|    return 1;
   69|     29|}

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

err.c:do_err_strings_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
err.c:err_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
context.c:default_context_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_add_all_ciphers_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
init.c:ossl_init_add_all_digests_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
init.c:ossl_init_config_ossl_:
   73|      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|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
obj_dat.c:obj_lock_initialise_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
obj_xref.c:o_sig_init_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
rand_lib.c:do_rand_init_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
do_engine_lock_init_ossl_:
   41|      1|    {                                           \
   42|      1|        init##_ossl_ret_ = init();              \
   43|      1|    }                                           \

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

a_utf8.c:is_unicode_surrogate:
   22|   209k|{
   23|   209k|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 70.5k, False: 139k]
  |  Branch (23:38): [True: 698, False: 69.8k]
  ------------------
   24|   209k|}
a_mbstr.c:is_unicode_valid:
   27|  8.84M|{
   28|  8.84M|    return value <= UNICODE_MAX && !is_unicode_surrogate(value);
  ------------------
  |  Branch (28:12): [True: 8.84M, False: 35]
  |  Branch (28:36): [True: 8.84M, False: 13]
  ------------------
   29|  8.84M|}
a_mbstr.c:is_unicode_surrogate:
   22|  8.84M|{
   23|  8.84M|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 69.6k, False: 8.77M]
  |  Branch (23:38): [True: 13, False: 69.6k]
  ------------------
   24|  8.84M|}

ASN1_OCTET_STRING_it:
  764|  1.08M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.08M|        { \
  |  |   96|  1.08M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.08M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.08M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.08M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.08M|                }; \
  |  |  103|  1.08M|        return &local_it; \
  |  |  104|  1.08M|        }
  ------------------
d2i_ASN1_OCTET_STRING:
  826|  3.56k|        { \
  827|  3.56k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  3.56k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  3.56k|        } \
ASN1_INTEGER_it:
  764|  1.68M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.68M|        { \
  |  |   96|  1.68M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.68M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.68M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.68M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.68M|                }; \
  |  |  103|  1.68M|        return &local_it; \
  |  |  104|  1.68M|        }
  ------------------
d2i_ASN1_INTEGER:
  826|  5.54k|        { \
  827|  5.54k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  5.54k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  5.54k|        } \
ASN1_ENUMERATED_it:
  764|  2.01k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.01k|        { \
  |  |   96|  2.01k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  2.01k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  2.01k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  2.01k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.01k|                }; \
  |  |  103|  2.01k|        return &local_it; \
  |  |  104|  2.01k|        }
  ------------------
d2i_ASN1_ENUMERATED:
  826|  1.88k|        { \
  827|  1.88k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  1.88k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  1.88k|        } \
ASN1_BIT_STRING_it:
  764|  1.84M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.84M|        { \
  |  |   96|  1.84M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.84M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.84M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.84M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.84M|                }; \
  |  |  103|  1.84M|        return &local_it; \
  |  |  104|  1.84M|        }
  ------------------
ASN1_UTF8STRING_it:
  764|   352k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   352k|        { \
  |  |   96|   352k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   352k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   352k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   352k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   352k|                }; \
  |  |  103|   352k|        return &local_it; \
  |  |  104|   352k|        }
  ------------------
ASN1_IA5STRING_it:
  764|   114k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   114k|        { \
  |  |   96|   114k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   114k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   114k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   114k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   114k|                }; \
  |  |  103|   114k|        return &local_it; \
  |  |  104|   114k|        }
  ------------------
ASN1_GENERALIZEDTIME_it:
  764|   182k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   182k|        { \
  |  |   96|   182k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   182k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   182k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   182k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   182k|                }; \
  |  |  103|   182k|        return &local_it; \
  |  |  104|   182k|        }
  ------------------
ASN1_NULL_it:
  764|  1.99k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.99k|        { \
  |  |   96|  1.99k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.99k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.99k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.99k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.99k|                }; \
  |  |  103|  1.99k|        return &local_it; \
  |  |  104|  1.99k|        }
  ------------------
ASN1_OBJECT_it:
  764|  2.16M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.16M|        { \
  |  |   96|  2.16M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  2.16M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  2.16M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  2.16M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.16M|                }; \
  |  |  103|  2.16M|        return &local_it; \
  |  |  104|  2.16M|        }
  ------------------
ASN1_ANY_it:
  764|  1.22M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.22M|        { \
  |  |   96|  1.22M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.22M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.22M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.22M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.22M|                }; \
  |  |  103|  1.22M|        return &local_it; \
  |  |  104|  1.22M|        }
  ------------------
ASN1_SEQUENCE_it:
  764|  98.1k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  98.1k|        { \
  |  |   96|  98.1k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  98.1k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  98.1k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  98.1k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  98.1k|                }; \
  |  |  103|  98.1k|        return &local_it; \
  |  |  104|  98.1k|        }
  ------------------
i2d_ASN1_TYPE:
  830|    704|        { \
  831|    704|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    704|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    704|        }
ASN1_TYPE_new:
  812|   166k|        { \
  813|   166k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   166k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   166k|        } \
ASN1_TYPE_free:
  816|  3.13k|        { \
  817|  3.13k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  3.13k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  3.13k|        }
ASN1_PRINTABLE_it:
  770|  1.25M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.25M|        { \
  |  |   96|  1.25M|                static const ASN1_ITEM local_it = {
  ------------------
  771|  1.25M|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  1.25M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  1.25M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.25M|                }; \
  |  |  103|  1.25M|        return &local_it; \
  |  |  104|  1.25M|        }
  ------------------
DISPLAYTEXT_it:
  770|    143|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|    143|        { \
  |  |   96|    143|                static const ASN1_ITEM local_it = {
  ------------------
  771|    143|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|    143|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|    143|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|    143|                }; \
  |  |  103|    143|        return &local_it; \
  |  |  104|    143|        }
  ------------------
DIRECTORYSTRING_it:
  770|  1.57k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.57k|        { \
  |  |   96|  1.57k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  1.57k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  1.57k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  1.57k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.57k|                }; \
  |  |  103|  1.57k|        return &local_it; \
  |  |  104|  1.57k|        }
  ------------------
ASN1_TBOOLEAN_it:
  764|    345|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|    345|        { \
  |  |   96|    345|                static const ASN1_ITEM local_it = {
  ------------------
  765|    345|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|    345|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|    345|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|    345|                }; \
  |  |  103|    345|        return &local_it; \
  |  |  104|    345|        }
  ------------------
ASN1_FBOOLEAN_it:
  764|  54.9k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  54.9k|        { \
  |  |   96|  54.9k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  54.9k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  54.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  54.9k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  54.9k|                }; \
  |  |  103|  54.9k|        return &local_it; \
  |  |  104|  54.9k|        }
  ------------------
ASN1_OCTET_STRING_NDEF_it:
  764|    117|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|    117|        { \
  |  |   96|    117|                static const ASN1_ITEM local_it = {
  ------------------
  765|    117|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|    117|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|    117|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|    117|                }; \
  |  |  103|    117|        return &local_it; \
  |  |  104|    117|        }
  ------------------
OSSL_CMP_REVANNCONTENT_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|        }
  ------------------
OSSL_CMP_CHALLENGE_it:
  166|  3.25k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.25k|        { \
  |  |   96|  3.25k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  3.25k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.25k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  3.25k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.25k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  3.25k|                tname##_seq_tt,\
  170|  3.25k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  3.25k|                NULL,\
  172|  3.25k|                sizeof(stname),\
  173|  3.25k|                #tname \
  174|  3.25k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.25k|                }; \
  |  |  103|  3.25k|        return &local_it; \
  |  |  104|  3.25k|        }
  ------------------
OSSL_CMP_POPODECKEYCHALLCONTENT_it:
  113|  2.30k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.30k|        { \
  |  |   96|  2.30k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  2.30k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  2.30k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  2.30k|                -1,\
  116|  2.30k|                &tname##_item_tt,\
  117|  2.30k|                0,\
  118|  2.30k|                NULL,\
  119|  2.30k|                0,\
  120|  2.30k|                #tname \
  121|  2.30k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.30k|                }; \
  |  |  103|  2.30k|        return &local_it; \
  |  |  104|  2.30k|        }
  ------------------
OSSL_CMP_POPODECKEYRESPCONTENT_it:
  113|  1.62k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.62k|        { \
  |  |   96|  1.62k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  1.62k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  1.62k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  1.62k|                -1,\
  116|  1.62k|                &tname##_item_tt,\
  117|  1.62k|                0,\
  118|  1.62k|                NULL,\
  119|  1.62k|                0,\
  120|  1.62k|                #tname \
  121|  1.62k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.62k|                }; \
  |  |  103|  1.62k|        return &local_it; \
  |  |  104|  1.62k|        }
  ------------------
OSSL_CMP_CAKEYUPDANNCONTENT_it:
  166|    333|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    333|        { \
  |  |   96|    333|                static const ASN1_ITEM local_it = {
  ------------------
  167|    333|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    333|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    333|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    333|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    333|                tname##_seq_tt,\
  170|    333|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    333|                NULL,\
  172|    333|                sizeof(stname),\
  173|    333|                #tname \
  174|    333|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    333|                }; \
  |  |  103|    333|        return &local_it; \
  |  |  104|    333|        }
  ------------------
OSSL_CMP_ERRORMSGCONTENT_it:
  166|  14.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.8k|        { \
  |  |   96|  14.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  14.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  14.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  14.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  14.8k|                tname##_seq_tt,\
  170|  14.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  14.8k|                NULL,\
  172|  14.8k|                sizeof(stname),\
  173|  14.8k|                #tname \
  174|  14.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.8k|                }; \
  |  |  103|  14.8k|        return &local_it; \
  |  |  104|  14.8k|        }
  ------------------
OSSL_CMP_ERRORMSGCONTENT_new:
  812|  6.94k|        { \
  813|  6.94k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  6.94k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  6.94k|        } \
OSSL_CMP_ITAV_it:
  166|  51.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  51.0k|        { \
  |  |   96|  51.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  51.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  51.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  51.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  51.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  51.0k|                tname##_seq_tt,\
  170|  51.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  51.0k|                NULL,\
  172|  51.0k|                sizeof(stname),\
  173|  51.0k|                #tname \
  174|  51.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  51.0k|                }; \
  |  |  103|  51.0k|        return &local_it; \
  |  |  104|  51.0k|        }
  ------------------
OSSL_CMP_ROOTCAKEYUPDATE_it:
  166|     69|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     69|        { \
  |  |   96|     69|                static const ASN1_ITEM local_it = {
  ------------------
  167|     69|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     69|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     69|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     69|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     69|                tname##_seq_tt,\
  170|     69|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     69|                NULL,\
  172|     69|                sizeof(stname),\
  173|     69|                #tname \
  174|     69|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     69|                }; \
  |  |  103|     69|        return &local_it; \
  |  |  104|     69|        }
  ------------------
OSSL_CMP_CERTREQTEMPLATE_it:
  166|     79|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     79|        { \
  |  |   96|     79|                static const ASN1_ITEM local_it = {
  ------------------
  167|     79|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     79|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     79|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     79|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     79|                tname##_seq_tt,\
  170|     79|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     79|                NULL,\
  172|     79|                sizeof(stname),\
  173|     79|                #tname \
  174|     79|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     79|                }; \
  |  |  103|     79|        return &local_it; \
  |  |  104|     79|        }
  ------------------
OSSL_CMP_CRLSOURCE_it:
  320|    121|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    121|        { \
  |  |   96|    121|                static const ASN1_ITEM local_it = {
  ------------------
  321|    121|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|    121|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|    121|                offsetof(stname,selname) ,\
  323|    121|                tname##_ch_tt,\
  324|    121|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|    121|                NULL,\
  326|    121|                sizeof(stname),\
  327|    121|                #stname \
  328|    121|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    121|                }; \
  |  |  103|    121|        return &local_it; \
  |  |  104|    121|        }
  ------------------
OSSL_CMP_CRLSTATUS_it:
  166|    101|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    101|        { \
  |  |   96|    101|                static const ASN1_ITEM local_it = {
  ------------------
  167|    101|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    101|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    101|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    101|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    101|                tname##_seq_tt,\
  170|    101|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    101|                NULL,\
  172|    101|                sizeof(stname),\
  173|    101|                #tname \
  174|    101|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    101|                }; \
  |  |  103|    101|        return &local_it; \
  |  |  104|    101|        }
  ------------------
OSSL_CMP_CERTORENCCERT_it:
  320|    276|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    276|        { \
  |  |   96|    276|                static const ASN1_ITEM local_it = {
  ------------------
  321|    276|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|    276|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|    276|                offsetof(stname,selname) ,\
  323|    276|                tname##_ch_tt,\
  324|    276|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|    276|                NULL,\
  326|    276|                sizeof(stname),\
  327|    276|                #stname \
  328|    276|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    276|                }; \
  |  |  103|    276|        return &local_it; \
  |  |  104|    276|        }
  ------------------
OSSL_CMP_CERTIFIEDKEYPAIR_it:
  166|  3.64k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.64k|        { \
  |  |   96|  3.64k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  3.64k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.64k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  3.64k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.64k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  3.64k|                tname##_seq_tt,\
  170|  3.64k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  3.64k|                NULL,\
  172|  3.64k|                sizeof(stname),\
  173|  3.64k|                #tname \
  174|  3.64k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.64k|                }; \
  |  |  103|  3.64k|        return &local_it; \
  |  |  104|  3.64k|        }
  ------------------
OSSL_CMP_REVDETAILS_it:
  166|   282k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   282k|        { \
  |  |   96|   282k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   282k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   282k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   282k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   282k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   282k|                tname##_seq_tt,\
  170|   282k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   282k|                NULL,\
  172|   282k|                sizeof(stname),\
  173|   282k|                #tname \
  174|   282k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   282k|                }; \
  |  |  103|   282k|        return &local_it; \
  |  |  104|   282k|        }
  ------------------
OSSL_CMP_REVDETAILS_new:
  812|    109|        { \
  813|    109|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    109|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    109|        } \
OSSL_CMP_REVDETAILS_free:
  816|    109|        { \
  817|    109|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    109|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    109|        }
OSSL_CMP_REVREQCONTENT_it:
  113|  15.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  15.3k|        { \
  |  |   96|  15.3k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  15.3k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  15.3k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  15.3k|                -1,\
  116|  15.3k|                &tname##_item_tt,\
  117|  15.3k|                0,\
  118|  15.3k|                NULL,\
  119|  15.3k|                0,\
  120|  15.3k|                #tname \
  121|  15.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  15.3k|                }; \
  |  |  103|  15.3k|        return &local_it; \
  |  |  104|  15.3k|        }
  ------------------
OSSL_CMP_REVREPCONTENT_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_CMP_KEYRECREPCONTENT_it:
  166|    159|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    159|        { \
  |  |   96|    159|                static const ASN1_ITEM local_it = {
  ------------------
  167|    159|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    159|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    159|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    159|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    159|                tname##_seq_tt,\
  170|    159|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    159|                NULL,\
  172|    159|                sizeof(stname),\
  173|    159|                #tname \
  174|    159|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    159|                }; \
  |  |  103|    159|        return &local_it; \
  |  |  104|    159|        }
  ------------------
OSSL_CMP_PKISTATUS_it:
  113|  95.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  95.9k|        { \
  |  |   96|  95.9k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  95.9k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  95.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  95.9k|                -1,\
  116|  95.9k|                &tname##_item_tt,\
  117|  95.9k|                0,\
  118|  95.9k|                NULL,\
  119|  95.9k|                0,\
  120|  95.9k|                #tname \
  121|  95.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  95.9k|                }; \
  |  |  103|  95.9k|        return &local_it; \
  |  |  104|  95.9k|        }
  ------------------
OSSL_CMP_PKISI_it:
  166|  66.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  66.4k|        { \
  |  |   96|  66.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  66.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  66.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  66.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  66.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  66.4k|                tname##_seq_tt,\
  170|  66.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  66.4k|                NULL,\
  172|  66.4k|                sizeof(stname),\
  173|  66.4k|                #tname \
  174|  66.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  66.4k|                }; \
  |  |  103|  66.4k|        return &local_it; \
  |  |  104|  66.4k|        }
  ------------------
OSSL_CMP_PKISI_new:
  812|  6.94k|        { \
  813|  6.94k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  6.94k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  6.94k|        } \
OSSL_CMP_PKISI_free:
  816|  14.7k|        { \
  817|  14.7k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  14.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  14.7k|        }
OSSL_CMP_PKISI_dup:
  855|  6.94k|        { \
  856|  6.94k|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  427|  6.94k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|  6.94k|        }
OSSL_CMP_CERTSTATUS_it:
  166|    421|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    421|        { \
  |  |   96|    421|                static const ASN1_ITEM local_it = {
  ------------------
  167|    421|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    421|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    421|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    421|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    421|                tname##_seq_tt,\
  170|    421|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    421|                NULL,\
  172|    421|                sizeof(stname),\
  173|    421|                #tname \
  174|    421|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    421|                }; \
  |  |  103|    421|        return &local_it; \
  |  |  104|    421|        }
  ------------------
OSSL_CMP_CERTCONFIRMCONTENT_it:
  113|  2.58k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.58k|        { \
  |  |   96|  2.58k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  2.58k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  2.58k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  2.58k|                -1,\
  116|  2.58k|                &tname##_item_tt,\
  117|  2.58k|                0,\
  118|  2.58k|                NULL,\
  119|  2.58k|                0,\
  120|  2.58k|                #tname \
  121|  2.58k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.58k|                }; \
  |  |  103|  2.58k|        return &local_it; \
  |  |  104|  2.58k|        }
  ------------------
OSSL_CMP_CERTRESPONSE_it:
  166|  3.08k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.08k|        { \
  |  |   96|  3.08k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  3.08k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.08k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  3.08k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.08k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  3.08k|                tname##_seq_tt,\
  170|  3.08k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  3.08k|                NULL,\
  172|  3.08k|                sizeof(stname),\
  173|  3.08k|                #tname \
  174|  3.08k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.08k|                }; \
  |  |  103|  3.08k|        return &local_it; \
  |  |  104|  3.08k|        }
  ------------------
OSSL_CMP_POLLREQ_it:
  166|    789|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    789|        { \
  |  |   96|    789|                static const ASN1_ITEM local_it = {
  ------------------
  167|    789|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    789|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    789|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    789|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    789|                tname##_seq_tt,\
  170|    789|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    789|                NULL,\
  172|    789|                sizeof(stname),\
  173|    789|                #tname \
  174|    789|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    789|                }; \
  |  |  103|    789|        return &local_it; \
  |  |  104|    789|        }
  ------------------
OSSL_CMP_POLLREQ_new:
  812|     70|        { \
  813|     70|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     70|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|     70|        } \
OSSL_CMP_POLLREQ_free:
  816|     70|        { \
  817|     70|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     70|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     70|        }
OSSL_CMP_POLLREQCONTENT_it:
  113|  2.46k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.46k|        { \
  |  |   96|  2.46k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  2.46k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  2.46k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  2.46k|                -1,\
  116|  2.46k|                &tname##_item_tt,\
  117|  2.46k|                0,\
  118|  2.46k|                NULL,\
  119|  2.46k|                0,\
  120|  2.46k|                #tname \
  121|  2.46k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.46k|                }; \
  |  |  103|  2.46k|        return &local_it; \
  |  |  104|  2.46k|        }
  ------------------
OSSL_CMP_POLLREP_it:
  166|  1.46k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.46k|        { \
  |  |   96|  1.46k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.46k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.46k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.46k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.46k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.46k|                tname##_seq_tt,\
  170|  1.46k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.46k|                NULL,\
  172|  1.46k|                sizeof(stname),\
  173|  1.46k|                #tname \
  174|  1.46k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.46k|                }; \
  |  |  103|  1.46k|        return &local_it; \
  |  |  104|  1.46k|        }
  ------------------
OSSL_CMP_POLLREPCONTENT_it:
  113|  10.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.3k|        { \
  |  |   96|  10.3k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  10.3k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  10.3k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  10.3k|                -1,\
  116|  10.3k|                &tname##_item_tt,\
  117|  10.3k|                0,\
  118|  10.3k|                NULL,\
  119|  10.3k|                0,\
  120|  10.3k|                #tname \
  121|  10.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.3k|                }; \
  |  |  103|  10.3k|        return &local_it; \
  |  |  104|  10.3k|        }
  ------------------
OSSL_CMP_CERTREPMESSAGE_it:
  166|  2.43k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.43k|        { \
  |  |   96|  2.43k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  2.43k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.43k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  2.43k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.43k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  2.43k|                tname##_seq_tt,\
  170|  2.43k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  2.43k|                NULL,\
  172|  2.43k|                sizeof(stname),\
  173|  2.43k|                #tname \
  174|  2.43k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.43k|                }; \
  |  |  103|  2.43k|        return &local_it; \
  |  |  104|  2.43k|        }
  ------------------
OSSL_CMP_GENMSGCONTENT_it:
  113|  5.22k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.22k|        { \
  |  |   96|  5.22k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  5.22k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  5.22k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  5.22k|                -1,\
  116|  5.22k|                &tname##_item_tt,\
  117|  5.22k|                0,\
  118|  5.22k|                NULL,\
  119|  5.22k|                0,\
  120|  5.22k|                #tname \
  121|  5.22k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.22k|                }; \
  |  |  103|  5.22k|        return &local_it; \
  |  |  104|  5.22k|        }
  ------------------
OSSL_CMP_GENREPCONTENT_it:
  113|  2.24k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.24k|        { \
  |  |   96|  2.24k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  2.24k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  2.24k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  2.24k|                -1,\
  116|  2.24k|                &tname##_item_tt,\
  117|  2.24k|                0,\
  118|  2.24k|                NULL,\
  119|  2.24k|                0,\
  120|  2.24k|                #tname \
  121|  2.24k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.24k|                }; \
  |  |  103|  2.24k|        return &local_it; \
  |  |  104|  2.24k|        }
  ------------------
OSSL_CMP_CRLANNCONTENT_it:
  113|  3.56k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.56k|        { \
  |  |   96|  3.56k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  3.56k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  3.56k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  3.56k|                -1,\
  116|  3.56k|                &tname##_item_tt,\
  117|  3.56k|                0,\
  118|  3.56k|                NULL,\
  119|  3.56k|                0,\
  120|  3.56k|                #tname \
  121|  3.56k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.56k|                }; \
  |  |  103|  3.56k|        return &local_it; \
  |  |  104|  3.56k|        }
  ------------------
OSSL_CMP_PKIBODY_it:
  320|   144k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   144k|        { \
  |  |   96|   144k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   144k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   144k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   144k|                offsetof(stname,selname) ,\
  323|   144k|                tname##_ch_tt,\
  324|   144k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   144k|                NULL,\
  326|   144k|                sizeof(stname),\
  327|   144k|                #stname \
  328|   144k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   144k|                }; \
  |  |  103|   144k|        return &local_it; \
  |  |  104|   144k|        }
  ------------------
OSSL_CMP_PKIHEADER_it:
  166|   147k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   147k|        { \
  |  |   96|   147k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   147k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   147k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   147k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   147k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   147k|                tname##_seq_tt,\
  170|   147k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   147k|                NULL,\
  172|   147k|                sizeof(stname),\
  173|   147k|                #tname \
  174|   147k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   147k|                }; \
  |  |  103|   147k|        return &local_it; \
  |  |  104|   147k|        }
  ------------------
OSSL_CMP_PROTECTEDPART_it:
  166|    433|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    433|        { \
  |  |   96|    433|                static const ASN1_ITEM local_it = {
  ------------------
  167|    433|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    433|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    433|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    433|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    433|                tname##_seq_tt,\
  170|    433|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    433|                NULL,\
  172|    433|                sizeof(stname),\
  173|    433|                #tname \
  174|    433|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    433|                }; \
  |  |  103|    433|        return &local_it; \
  |  |  104|    433|        }
  ------------------
i2d_OSSL_CMP_PROTECTEDPART:
  830|    171|        { \
  831|    171|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    171|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    171|        }
OSSL_CMP_MSG_it:
  247|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   118k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   118k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   118k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   118k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   118k|                tname##_seq_tt,\
  251|   118k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   118k|                &tname##_aux,\
  253|   118k|                sizeof(stname),\
  254|   118k|                #tname \
  255|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
OSSL_CMP_MSGS_it:
  113|  17.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  17.0k|        { \
  |  |   96|  17.0k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  17.0k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  17.0k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  17.0k|                -1,\
  116|  17.0k|                &tname##_item_tt,\
  117|  17.0k|                0,\
  118|  17.0k|                NULL,\
  119|  17.0k|                0,\
  120|  17.0k|                #tname \
  121|  17.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  17.0k|                }; \
  |  |  103|  17.0k|        return &local_it; \
  |  |  104|  17.0k|        }
  ------------------
cmp_asn.c:OSSL_CMP_ITAV_adb:
  463|  40.4k|        { \
  464|  40.4k|        static const ASN1_ADB internal_adb = \
  465|  40.4k|                {\
  466|  40.4k|                flags,\
  467|  40.4k|                offsetof(name, field),\
  468|  40.4k|                adb_cb,\
  469|  40.4k|                name##_adbtbl,\
  470|  40.4k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  40.4k|                def,\
  472|  40.4k|                none\
  473|  40.4k|                }; \
  474|  40.4k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  40.4k|        } \
CMS_IssuerAndSerialNumber_it:
  166|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  167|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      3|                tname##_seq_tt,\
  170|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      3|                NULL,\
  172|      3|                sizeof(stname),\
  173|      3|                #tname \
  174|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
CMS_CertificateChoices_it:
  320|     13|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     13|        { \
  |  |   96|     13|                static const ASN1_ITEM local_it = {
  ------------------
  321|     13|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     13|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     13|                offsetof(stname,selname) ,\
  323|     13|                tname##_ch_tt,\
  324|     13|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     13|                NULL,\
  326|     13|                sizeof(stname),\
  327|     13|                #stname \
  328|     13|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     13|                }; \
  |  |  103|     13|        return &local_it; \
  |  |  104|     13|        }
  ------------------
CMS_RevocationInfoChoice_it:
  320|      9|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      9|        { \
  |  |   96|      9|                static const ASN1_ITEM local_it = {
  ------------------
  321|      9|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|      9|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|      9|                offsetof(stname,selname) ,\
  323|      9|                tname##_ch_tt,\
  324|      9|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|      9|                NULL,\
  326|      9|                sizeof(stname),\
  327|      9|                #stname \
  328|      9|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      9|                }; \
  |  |  103|      9|        return &local_it; \
  |  |  104|      9|        }
  ------------------
CMS_EncryptedContentInfo_it:
  270|     79|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     79|        { \
  |  |   96|     79|                static const ASN1_ITEM local_it = {
  ------------------
  271|     79|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     79|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|     79|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     79|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|     79|                tname##_seq_tt,\
  274|     79|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|     79|                &tname##_aux,\
  276|     79|                sizeof(stname),\
  277|     79|                #stname \
  278|     79|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     79|                }; \
  |  |  103|     79|        return &local_it; \
  |  |  104|     79|        }
  ------------------
CMS_KeyTransRecipientInfo_it:
  166|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  167|     11|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     11|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     11|                tname##_seq_tt,\
  170|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     11|                NULL,\
  172|     11|                sizeof(stname),\
  173|     11|                #tname \
  174|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
CMS_OtherKeyAttribute_it:
  166|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  167|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      3|                tname##_seq_tt,\
  170|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      3|                NULL,\
  172|      3|                sizeof(stname),\
  173|      3|                #tname \
  174|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
CMS_RecipientEncryptedKey_it:
  247|      1|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      1|        { \
  |  |   96|      1|                static const ASN1_ITEM local_it = {
  ------------------
  248|      1|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      1|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|      1|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      1|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|      1|                tname##_seq_tt,\
  251|      1|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|      1|                &tname##_aux,\
  253|      1|                sizeof(stname),\
  254|      1|                #tname \
  255|      1|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      1|                }; \
  |  |  103|      1|        return &local_it; \
  |  |  104|      1|        }
  ------------------
CMS_KeyAgreeRecipientInfo_it:
  247|      6|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      6|        { \
  |  |   96|      6|                static const ASN1_ITEM local_it = {
  ------------------
  248|      6|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      6|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|      6|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      6|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|      6|                tname##_seq_tt,\
  251|      6|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|      6|                &tname##_aux,\
  253|      6|                sizeof(stname),\
  254|      6|                #tname \
  255|      6|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      6|                }; \
  |  |  103|      6|        return &local_it; \
  |  |  104|      6|        }
  ------------------
CMS_KEKRecipientInfo_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_PasswordRecipientInfo_it:
  166|      4|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      4|        { \
  |  |   96|      4|                static const ASN1_ITEM local_it = {
  ------------------
  167|      4|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      4|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      4|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      4|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      4|                tname##_seq_tt,\
  170|      4|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      4|                NULL,\
  172|      4|                sizeof(stname),\
  173|      4|                #tname \
  174|      4|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      4|                }; \
  |  |  103|      4|        return &local_it; \
  |  |  104|      4|        }
  ------------------
CMS_RecipientInfo_it:
  344|     55|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     55|        { \
  |  |   96|     55|                static const ASN1_ITEM local_it = {
  ------------------
  345|     55|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     55|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|     55|                offsetof(stname,selname) ,\
  347|     55|                tname##_ch_tt,\
  348|     55|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|     55|                &tname##_aux,\
  350|     55|                sizeof(stname),\
  351|     55|                #stname \
  352|     55|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     55|                }; \
  |  |  103|     55|        return &local_it; \
  |  |  104|     55|        }
  ------------------
CMS_EnvelopedData_it:
  218|     79|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     79|        { \
  |  |   96|     79|                static const ASN1_ITEM local_it = {
  ------------------
  219|     79|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     79|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     79|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     79|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     79|                tname##_seq_tt,\
  222|     79|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     79|                NULL,\
  224|     79|                sizeof(tname),\
  225|     79|                #tname \
  226|     79|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     79|                }; \
  |  |  103|     79|        return &local_it; \
  |  |  104|     79|        }
  ------------------
cms_asn1.c:CMS_OtherCertificateFormat_it:
  178|      3|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      3|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      3|        { \
  |  |  |  |   96|      3|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      3|                tname##_seq_tt,\
  182|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      3|                NULL,\
  184|      3|                sizeof(stname),\
  185|      3|                #stname \
  186|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
cms_asn1.c:CMS_SignerIdentifier_it:
  332|      8|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      8|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      8|        { \
  |  |  |  |   96|      8|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|      8|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|      8|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|      8|                offsetof(stname,selname) ,\
  335|      8|                tname##_ch_tt,\
  336|      8|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|      8|                NULL,\
  338|      8|                sizeof(stname),\
  339|      8|                #stname \
  340|      8|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      8|                }; \
  |  |  103|      8|        return &local_it; \
  |  |  104|      8|        }
  ------------------
cms_asn1.c:CMS_OtherRevocationInfoFormat_it:
  178|      3|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      3|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      3|        { \
  |  |  |  |   96|      3|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      3|                tname##_seq_tt,\
  182|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      3|                NULL,\
  184|      3|                sizeof(stname),\
  185|      3|                #stname \
  186|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
cms_asn1.c:CMS_OriginatorIdentifierOrKey_it:
  332|      2|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      2|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      2|        { \
  |  |  |  |   96|      2|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|      2|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|      2|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|      2|                offsetof(stname,selname) ,\
  335|      2|                tname##_ch_tt,\
  336|      2|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|      2|                NULL,\
  338|      2|                sizeof(stname),\
  339|      2|                #stname \
  340|      2|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      2|                }; \
  |  |  103|      2|        return &local_it; \
  |  |  104|      2|        }
  ------------------
cms_asn1.c:CMS_KEKIdentifier_it:
  178|      2|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      2|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      2|        { \
  |  |  |  |   96|      2|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      2|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      2|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      2|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      2|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      2|                tname##_seq_tt,\
  182|      2|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      2|                NULL,\
  184|      2|                sizeof(stname),\
  185|      2|                #stname \
  186|      2|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      2|                }; \
  |  |  103|      2|        return &local_it; \
  |  |  104|      2|        }
  ------------------
cms_asn1.c:CMS_OtherRecipientInfo_it:
  178|      3|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      3|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      3|        { \
  |  |  |  |   96|      3|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      3|                tname##_seq_tt,\
  182|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      3|                NULL,\
  184|      3|                sizeof(stname),\
  185|      3|                #stname \
  186|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
cms_asn1.c:CMS_OriginatorInfo_it:
  178|    142|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    142|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    142|        { \
  |  |  |  |   96|    142|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    142|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    142|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    142|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    142|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    142|                tname##_seq_tt,\
  182|    142|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    142|                NULL,\
  184|    142|                sizeof(stname),\
  185|    142|                #stname \
  186|    142|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    142|                }; \
  |  |  103|    142|        return &local_it; \
  |  |  104|    142|        }
  ------------------
OSSL_CRMF_CERTID_it:
  166|  1.29k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.29k|        { \
  |  |   96|  1.29k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.29k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.29k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.29k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.29k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.29k|                tname##_seq_tt,\
  170|  1.29k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.29k|                NULL,\
  172|  1.29k|                sizeof(stname),\
  173|  1.29k|                #tname \
  174|  1.29k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.29k|                }; \
  |  |  103|  1.29k|        return &local_it; \
  |  |  104|  1.29k|        }
  ------------------
OSSL_CRMF_CERTID_new:
  812|     25|        { \
  813|     25|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     25|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|     25|        } \
OSSL_CRMF_CERTID_free:
  816|     27|        { \
  817|     27|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     27|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     27|        }
OSSL_CRMF_CERTID_dup:
  855|     23|        { \
  856|     23|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  427|     23|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|     23|        }
OSSL_CRMF_ENCRYPTEDVALUE_it:
  166|    115|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    115|        { \
  |  |   96|    115|                static const ASN1_ITEM local_it = {
  ------------------
  167|    115|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    115|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    115|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    115|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    115|                tname##_seq_tt,\
  170|    115|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    115|                NULL,\
  172|    115|                sizeof(stname),\
  173|    115|                #tname \
  174|    115|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    115|                }; \
  |  |  103|    115|        return &local_it; \
  |  |  104|    115|        }
  ------------------
OSSL_CRMF_ENCRYPTEDKEY_it:
  320|    366|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    366|        { \
  |  |   96|    366|                static const ASN1_ITEM local_it = {
  ------------------
  321|    366|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|    366|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|    366|                offsetof(stname,selname) ,\
  323|    366|                tname##_ch_tt,\
  324|    366|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|    366|                NULL,\
  326|    366|                sizeof(stname),\
  327|    366|                #stname \
  328|    366|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    366|                }; \
  |  |  103|    366|        return &local_it; \
  |  |  104|    366|        }
  ------------------
OSSL_CRMF_SINGLEPUBINFO_it:
  166|      4|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      4|        { \
  |  |   96|      4|                static const ASN1_ITEM local_it = {
  ------------------
  167|      4|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      4|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      4|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      4|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      4|                tname##_seq_tt,\
  170|      4|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      4|                NULL,\
  172|      4|                sizeof(stname),\
  173|      4|                #tname \
  174|      4|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      4|                }; \
  |  |  103|      4|        return &local_it; \
  |  |  104|      4|        }
  ------------------
OSSL_CRMF_PKIPUBLICATIONINFO_it:
  166|    290|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    290|        { \
  |  |   96|    290|                static const ASN1_ITEM local_it = {
  ------------------
  167|    290|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    290|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    290|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    290|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    290|                tname##_seq_tt,\
  170|    290|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    290|                NULL,\
  172|    290|                sizeof(stname),\
  173|    290|                #tname \
  174|    290|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    290|                }; \
  |  |  103|    290|        return &local_it; \
  |  |  104|    290|        }
  ------------------
OSSL_CRMF_PKMACVALUE_it:
  166|    124|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    124|        { \
  |  |   96|    124|                static const ASN1_ITEM local_it = {
  ------------------
  167|    124|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    124|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    124|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    124|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    124|                tname##_seq_tt,\
  170|    124|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    124|                NULL,\
  172|    124|                sizeof(stname),\
  173|    124|                #tname \
  174|    124|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    124|                }; \
  |  |  103|    124|        return &local_it; \
  |  |  104|    124|        }
  ------------------
OSSL_CRMF_POPOPRIVKEY_it:
  320|    968|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    968|        { \
  |  |   96|    968|                static const ASN1_ITEM local_it = {
  ------------------
  321|    968|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|    968|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|    968|                offsetof(stname,selname) ,\
  323|    968|                tname##_ch_tt,\
  324|    968|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|    968|                NULL,\
  326|    968|                sizeof(stname),\
  327|    968|                #stname \
  328|    968|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    968|                }; \
  |  |  103|    968|        return &local_it; \
  |  |  104|    968|        }
  ------------------
OSSL_CRMF_PBMPARAMETER_it:
  166|    342|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    342|        { \
  |  |   96|    342|                static const ASN1_ITEM local_it = {
  ------------------
  167|    342|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    342|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    342|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    342|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    342|                tname##_seq_tt,\
  170|    342|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    342|                NULL,\
  172|    342|                sizeof(stname),\
  173|    342|                #tname \
  174|    342|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    342|                }; \
  |  |  103|    342|        return &local_it; \
  |  |  104|    342|        }
  ------------------
d2i_OSSL_CRMF_PBMPARAMETER:
  826|    171|        { \
  827|    171|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    171|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|    171|        } \
OSSL_CRMF_PBMPARAMETER_free:
  816|    171|        { \
  817|    171|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    171|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    171|        }
OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO_it:
  320|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  321|     11|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     11|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     11|                offsetof(stname,selname) ,\
  323|     11|                tname##_ch_tt,\
  324|     11|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     11|                NULL,\
  326|     11|                sizeof(stname),\
  327|     11|                #stname \
  328|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
OSSL_CRMF_POPOSIGNINGKEYINPUT_it:
  166|  4.99k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  4.99k|        { \
  |  |   96|  4.99k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  4.99k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  4.99k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  4.99k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  4.99k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  4.99k|                tname##_seq_tt,\
  170|  4.99k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  4.99k|                NULL,\
  172|  4.99k|                sizeof(stname),\
  173|  4.99k|                #tname \
  174|  4.99k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.99k|                }; \
  |  |  103|  4.99k|        return &local_it; \
  |  |  104|  4.99k|        }
  ------------------
OSSL_CRMF_POPOSIGNINGKEY_it:
  166|  4.13k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  4.13k|        { \
  |  |   96|  4.13k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  4.13k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  4.13k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  4.13k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  4.13k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  4.13k|                tname##_seq_tt,\
  170|  4.13k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  4.13k|                NULL,\
  172|  4.13k|                sizeof(stname),\
  173|  4.13k|                #tname \
  174|  4.13k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.13k|                }; \
  |  |  103|  4.13k|        return &local_it; \
  |  |  104|  4.13k|        }
  ------------------
OSSL_CRMF_POPO_it:
  320|  12.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.0k|        { \
  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  12.0k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  12.0k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  12.0k|                offsetof(stname,selname) ,\
  323|  12.0k|                tname##_ch_tt,\
  324|  12.0k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  12.0k|                NULL,\
  326|  12.0k|                sizeof(stname),\
  327|  12.0k|                #stname \
  328|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
OSSL_CRMF_POPO_free:
  816|    303|        { \
  817|    303|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    303|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    303|        }
OSSL_CRMF_ATTRIBUTETYPEANDVALUE_it:
  166|  5.83k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.83k|        { \
  |  |   96|  5.83k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  5.83k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  5.83k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  5.83k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.83k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  5.83k|                tname##_seq_tt,\
  170|  5.83k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  5.83k|                NULL,\
  172|  5.83k|                sizeof(stname),\
  173|  5.83k|                #tname \
  174|  5.83k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.83k|                }; \
  |  |  103|  5.83k|        return &local_it; \
  |  |  104|  5.83k|        }
  ------------------
OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new:
  812|     23|        { \
  813|     23|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     23|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|     23|        } \
OSSL_CRMF_OPTIONALVALIDITY_it:
  166|   579k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   579k|        { \
  |  |   96|   579k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   579k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   579k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   579k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   579k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   579k|                tname##_seq_tt,\
  170|   579k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   579k|                NULL,\
  172|   579k|                sizeof(stname),\
  173|   579k|                #tname \
  174|   579k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   579k|                }; \
  |  |  103|   579k|        return &local_it; \
  |  |  104|   579k|        }
  ------------------
OSSL_CRMF_CERTTEMPLATE_it:
  166|   418k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   418k|        { \
  |  |   96|   418k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   418k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   418k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   418k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   418k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   418k|                tname##_seq_tt,\
  170|   418k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   418k|                NULL,\
  172|   418k|                sizeof(stname),\
  173|   418k|                #tname \
  174|   418k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   418k|                }; \
  |  |  103|   418k|        return &local_it; \
  |  |  104|   418k|        }
  ------------------
OSSL_CRMF_CERTREQUEST_it:
  166|  10.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.0k|        { \
  |  |   96|  10.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  10.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  10.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  10.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  10.0k|                tname##_seq_tt,\
  170|  10.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  10.0k|                NULL,\
  172|  10.0k|                sizeof(stname),\
  173|  10.0k|                #tname \
  174|  10.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.0k|                }; \
  |  |  103|  10.0k|        return &local_it; \
  |  |  104|  10.0k|        }
  ------------------
OSSL_CRMF_MSG_it:
  166|  9.06k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  9.06k|        { \
  |  |   96|  9.06k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  9.06k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  9.06k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  9.06k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  9.06k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  9.06k|                tname##_seq_tt,\
  170|  9.06k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  9.06k|                NULL,\
  172|  9.06k|                sizeof(stname),\
  173|  9.06k|                #tname \
  174|  9.06k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.06k|                }; \
  |  |  103|  9.06k|        return &local_it; \
  |  |  104|  9.06k|        }
  ------------------
OSSL_CRMF_MSG_new:
  812|    303|        { \
  813|    303|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    303|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    303|        } \
OSSL_CRMF_MSG_free:
  816|    328|        { \
  817|    328|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    328|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    328|        }
OSSL_CRMF_MSGS_it:
  113|  13.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.9k|        { \
  |  |   96|  13.9k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  13.9k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  13.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  13.9k|                -1,\
  116|  13.9k|                &tname##_item_tt,\
  117|  13.9k|                0,\
  118|  13.9k|                NULL,\
  119|  13.9k|                0,\
  120|  13.9k|                #tname \
  121|  13.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.9k|                }; \
  |  |  103|  13.9k|        return &local_it; \
  |  |  104|  13.9k|        }
  ------------------
OSSL_CRMF_MSGS_new:
  812|    303|        { \
  813|    303|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    303|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    303|        } \
crmf_asn.c:OSSL_CRMF_ATTRIBUTETYPEANDVALUE_adb:
  463|  3.90k|        { \
  464|  3.90k|        static const ASN1_ADB internal_adb = \
  465|  3.90k|                {\
  466|  3.90k|                flags,\
  467|  3.90k|                offsetof(name, field),\
  468|  3.90k|                adb_cb,\
  469|  3.90k|                name##_adbtbl,\
  470|  3.90k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  3.90k|                def,\
  472|  3.90k|                none\
  473|  3.90k|                }; \
  474|  3.90k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  3.90k|        } \
AUTHORITY_KEYID_it:
  166|  11.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.2k|        { \
  |  |   96|  11.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.2k|                tname##_seq_tt,\
  170|  11.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.2k|                NULL,\
  172|  11.2k|                sizeof(stname),\
  173|  11.2k|                #tname \
  174|  11.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.2k|                }; \
  |  |  103|  11.2k|        return &local_it; \
  |  |  104|  11.2k|        }
  ------------------
AUTHORITY_KEYID_free:
  816|  9.91k|        { \
  817|  9.91k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  9.91k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  9.91k|        }
CERTIFICATEPOLICIES_it:
  113|     50|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     50|        { \
  |  |   96|     50|                static const ASN1_ITEM local_it = {
  ------------------
  114|     50|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     50|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     50|                -1,\
  116|     50|                &tname##_item_tt,\
  117|     50|                0,\
  118|     50|                NULL,\
  119|     50|                0,\
  120|     50|                #tname \
  121|     50|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     50|                }; \
  |  |  103|     50|        return &local_it; \
  |  |  104|     50|        }
  ------------------
POLICYINFO_it:
  166|     40|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     40|        { \
  |  |   96|     40|                static const ASN1_ITEM local_it = {
  ------------------
  167|     40|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     40|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     40|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     40|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     40|                tname##_seq_tt,\
  170|     40|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     40|                NULL,\
  172|     40|                sizeof(stname),\
  173|     40|                #tname \
  174|     40|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     40|                }; \
  |  |  103|     40|        return &local_it; \
  |  |  104|     40|        }
  ------------------
POLICYQUALINFO_it:
  166|      9|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      9|        { \
  |  |   96|      9|                static const ASN1_ITEM local_it = {
  ------------------
  167|      9|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      9|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      9|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      9|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      9|                tname##_seq_tt,\
  170|      9|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      9|                NULL,\
  172|      9|                sizeof(stname),\
  173|      9|                #tname \
  174|      9|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      9|                }; \
  |  |  103|      9|        return &local_it; \
  |  |  104|      9|        }
  ------------------
USERNOTICE_it:
  166|     84|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     84|        { \
  |  |   96|     84|                static const ASN1_ITEM local_it = {
  ------------------
  167|     84|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     84|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     84|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     84|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     84|                tname##_seq_tt,\
  170|     84|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     84|                NULL,\
  172|     84|                sizeof(stname),\
  173|     84|                #tname \
  174|     84|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     84|                }; \
  |  |  103|     84|        return &local_it; \
  |  |  104|     84|        }
  ------------------
NOTICEREF_it:
  166|    159|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    159|        { \
  |  |   96|    159|                static const ASN1_ITEM local_it = {
  ------------------
  167|    159|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    159|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    159|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    159|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    159|                tname##_seq_tt,\
  170|    159|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    159|                NULL,\
  172|    159|                sizeof(stname),\
  173|    159|                #tname \
  174|    159|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    159|                }; \
  |  |  103|    159|        return &local_it; \
  |  |  104|    159|        }
  ------------------
DIST_POINT_NAME_it:
  344|  1.49k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.49k|        { \
  |  |   96|  1.49k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  1.49k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  1.49k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  1.49k|                offsetof(stname,selname) ,\
  347|  1.49k|                tname##_ch_tt,\
  348|  1.49k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  1.49k|                &tname##_aux,\
  350|  1.49k|                sizeof(stname),\
  351|  1.49k|                #stname \
  352|  1.49k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.49k|                }; \
  |  |  103|  1.49k|        return &local_it; \
  |  |  104|  1.49k|        }
  ------------------
DIST_POINT_it:
  166|    586|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    586|        { \
  |  |   96|    586|                static const ASN1_ITEM local_it = {
  ------------------
  167|    586|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    586|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    586|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    586|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    586|                tname##_seq_tt,\
  170|    586|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    586|                NULL,\
  172|    586|                sizeof(stname),\
  173|    586|                #tname \
  174|    586|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    586|                }; \
  |  |  103|    586|        return &local_it; \
  |  |  104|    586|        }
  ------------------
CRL_DIST_POINTS_it:
  113|  10.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.4k|        { \
  |  |   96|  10.4k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  10.4k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  10.4k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  10.4k|                -1,\
  116|  10.4k|                &tname##_item_tt,\
  117|  10.4k|                0,\
  118|  10.4k|                NULL,\
  119|  10.4k|                0,\
  120|  10.4k|                #tname \
  121|  10.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.4k|                }; \
  |  |  103|  10.4k|        return &local_it; \
  |  |  104|  10.4k|        }
  ------------------
CRL_DIST_POINTS_free:
  816|  9.90k|        { \
  817|  9.90k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  9.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  9.90k|        }
ISSUING_DIST_POINT_it:
  166|    121|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    121|        { \
  |  |   96|    121|                static const ASN1_ITEM local_it = {
  ------------------
  167|    121|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    121|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    121|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    121|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    121|                tname##_seq_tt,\
  170|    121|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    121|                NULL,\
  172|    121|                sizeof(stname),\
  173|    121|                #tname \
  174|    121|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    121|                }; \
  |  |  103|    121|        return &local_it; \
  |  |  104|    121|        }
  ------------------
ISSUING_DIST_POINT_free:
  816|      8|        { \
  817|      8|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|      8|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|      8|        }
OSSL_AA_DIST_POINT_it:
  166|     56|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     56|        { \
  |  |   96|     56|                static const ASN1_ITEM local_it = {
  ------------------
  167|     56|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     56|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     56|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     56|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     56|                tname##_seq_tt,\
  170|     56|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     56|                NULL,\
  172|     56|                sizeof(stname),\
  173|     56|                #tname \
  174|     56|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     56|                }; \
  |  |  103|     56|        return &local_it; \
  |  |  104|     56|        }
  ------------------
OTHERNAME_it:
  166|  34.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  34.7k|        { \
  |  |   96|  34.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  34.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  34.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  34.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  34.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  34.7k|                tname##_seq_tt,\
  170|  34.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  34.7k|                NULL,\
  172|  34.7k|                sizeof(stname),\
  173|  34.7k|                #tname \
  174|  34.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  34.7k|                }; \
  |  |  103|  34.7k|        return &local_it; \
  |  |  104|  34.7k|        }
  ------------------
EDIPARTYNAME_it:
  166|  14.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.4k|        { \
  |  |   96|  14.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  14.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  14.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  14.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  14.4k|                tname##_seq_tt,\
  170|  14.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  14.4k|                NULL,\
  172|  14.4k|                sizeof(stname),\
  173|  14.4k|                #tname \
  174|  14.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.4k|                }; \
  |  |  103|  14.4k|        return &local_it; \
  |  |  104|  14.4k|        }
  ------------------
GENERAL_NAME_it:
  320|   355k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   355k|        { \
  |  |   96|   355k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   355k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   355k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   355k|                offsetof(stname,selname) ,\
  323|   355k|                tname##_ch_tt,\
  324|   355k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   355k|                NULL,\
  326|   355k|                sizeof(stname),\
  327|   355k|                #stname \
  328|   355k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   355k|                }; \
  |  |  103|   355k|        return &local_it; \
  |  |  104|   355k|        }
  ------------------
GENERAL_NAME_new:
  812|  15.5k|        { \
  813|  15.5k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  15.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  15.5k|        } \
GENERAL_NAME_free:
  816|  15.5k|        { \
  817|  15.5k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  15.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  15.5k|        }
GENERAL_NAMES_it:
  113|  10.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.5k|        { \
  |  |   96|  10.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  10.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  10.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  10.5k|                -1,\
  116|  10.5k|                &tname##_item_tt,\
  117|  10.5k|                0,\
  118|  10.5k|                NULL,\
  119|  10.5k|                0,\
  120|  10.5k|                #tname \
  121|  10.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.5k|                }; \
  |  |  103|  10.5k|        return &local_it; \
  |  |  104|  10.5k|        }
  ------------------
GENERAL_NAMES_free:
  816|  9.90k|        { \
  817|  9.90k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  9.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  9.90k|        }
GENERAL_SUBTREE_it:
  166|     78|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     78|        { \
  |  |   96|     78|                static const ASN1_ITEM local_it = {
  ------------------
  167|     78|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     78|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     78|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     78|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     78|                tname##_seq_tt,\
  170|     78|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     78|                NULL,\
  172|     78|                sizeof(stname),\
  173|     78|                #tname \
  174|     78|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     78|                }; \
  |  |  103|     78|        return &local_it; \
  |  |  104|     78|        }
  ------------------
NAME_CONSTRAINTS_it:
  166|  10.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.0k|        { \
  |  |   96|  10.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  10.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  10.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  10.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  10.0k|                tname##_seq_tt,\
  170|  10.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  10.0k|                NULL,\
  172|  10.0k|                sizeof(stname),\
  173|  10.0k|                #tname \
  174|  10.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.0k|                }; \
  |  |  103|  10.0k|        return &local_it; \
  |  |  104|  10.0k|        }
  ------------------
NAME_CONSTRAINTS_free:
  816|  9.90k|        { \
  817|  9.90k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  9.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  9.90k|        }
PROXY_POLICY_it:
  166|     47|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     47|        { \
  |  |   96|     47|                static const ASN1_ITEM local_it = {
  ------------------
  167|     47|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     47|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     47|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     47|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     47|                tname##_seq_tt,\
  170|     47|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     47|                NULL,\
  172|     47|                sizeof(stname),\
  173|     47|                #tname \
  174|     47|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     47|                }; \
  |  |  103|     47|        return &local_it; \
  |  |  104|     47|        }
  ------------------
PROXY_CERT_INFO_EXTENSION_it:
  166|     30|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     30|        { \
  |  |   96|     30|                static const ASN1_ITEM local_it = {
  ------------------
  167|     30|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     30|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     30|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     30|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     30|                tname##_seq_tt,\
  170|     30|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     30|                NULL,\
  172|     30|                sizeof(stname),\
  173|     30|                #tname \
  174|     30|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     30|                }; \
  |  |  103|     30|        return &local_it; \
  |  |  104|     30|        }
  ------------------
PROXY_CERT_INFO_EXTENSION_free:
  816|     14|        { \
  817|     14|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|     14|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     14|        }
POLICY_CONSTRAINTS_it:
  166|     38|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     38|        { \
  |  |   96|     38|                static const ASN1_ITEM local_it = {
  ------------------
  167|     38|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     38|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     38|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     38|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     38|                tname##_seq_tt,\
  170|     38|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     38|                NULL,\
  172|     38|                sizeof(stname),\
  173|     38|                #tname \
  174|     38|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     38|                }; \
  |  |  103|     38|        return &local_it; \
  |  |  104|     38|        }
  ------------------
PKEY_USAGE_PERIOD_it:
  166|     48|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     48|        { \
  |  |   96|     48|                static const ASN1_ITEM local_it = {
  ------------------
  167|     48|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     48|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     48|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     48|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     48|                tname##_seq_tt,\
  170|     48|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     48|                NULL,\
  172|     48|                sizeof(stname),\
  173|     48|                #tname \
  174|     48|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     48|                }; \
  |  |  103|     48|        return &local_it; \
  |  |  104|     48|        }
  ------------------
POLICY_MAPPING_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|        }
  ------------------
POLICY_MAPPINGS_it:
  113|     47|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     47|        { \
  |  |   96|     47|                static const ASN1_ITEM local_it = {
  ------------------
  114|     47|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     47|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     47|                -1,\
  116|     47|                &tname##_item_tt,\
  117|     47|                0,\
  118|     47|                NULL,\
  119|     47|                0,\
  120|     47|                #tname \
  121|     47|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     47|                }; \
  |  |  103|     47|        return &local_it; \
  |  |  104|     47|        }
  ------------------
OSSL_ROLE_SPEC_CERT_ID_it:
  166|     18|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     18|        { \
  |  |   96|     18|                static const ASN1_ITEM local_it = {
  ------------------
  167|     18|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     18|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     18|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     18|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     18|                tname##_seq_tt,\
  170|     18|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     18|                NULL,\
  172|     18|                sizeof(stname),\
  173|     18|                #tname \
  174|     18|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     18|                }; \
  |  |  103|     18|        return &local_it; \
  |  |  104|     18|        }
  ------------------
OSSL_ROLE_SPEC_CERT_ID_SYNTAX_it:
  113|     34|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     34|        { \
  |  |   96|     34|                static const ASN1_ITEM local_it = {
  ------------------
  114|     34|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     34|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     34|                -1,\
  116|     34|                &tname##_item_tt,\
  117|     34|                0,\
  118|     34|                NULL,\
  119|     34|                0,\
  120|     34|                #tname \
  121|     34|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     34|                }; \
  |  |  103|     34|        return &local_it; \
  |  |  104|     34|        }
  ------------------
OSSL_ATTRIBUTES_SYNTAX_it:
  113|     38|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     38|        { \
  |  |   96|     38|                static const ASN1_ITEM local_it = {
  ------------------
  114|     38|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     38|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     38|                -1,\
  116|     38|                &tname##_item_tt,\
  117|     38|                0,\
  118|     38|                NULL,\
  119|     38|                0,\
  120|     38|                #tname \
  121|     38|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     38|                }; \
  |  |  103|     38|        return &local_it; \
  |  |  104|     38|        }
  ------------------
OSSL_TIME_SPEC_ABSOLUTE_it:
  166|     63|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     63|        { \
  |  |   96|     63|                static const ASN1_ITEM local_it = {
  ------------------
  167|     63|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     63|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     63|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     63|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     63|                tname##_seq_tt,\
  170|     63|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     63|                NULL,\
  172|     63|                sizeof(stname),\
  173|     63|                #tname \
  174|     63|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     63|                }; \
  |  |  103|     63|        return &local_it; \
  |  |  104|     63|        }
  ------------------
OSSL_DAY_TIME_BAND_it:
  166|      6|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      6|        { \
  |  |   96|      6|                static const ASN1_ITEM local_it = {
  ------------------
  167|      6|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      6|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      6|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      6|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      6|                tname##_seq_tt,\
  170|      6|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      6|                NULL,\
  172|      6|                sizeof(stname),\
  173|      6|                #tname \
  174|      6|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      6|                }; \
  |  |  103|      6|        return &local_it; \
  |  |  104|      6|        }
  ------------------
OSSL_TIME_SPEC_DAY_it:
  320|     23|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     23|        { \
  |  |   96|     23|                static const ASN1_ITEM local_it = {
  ------------------
  321|     23|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     23|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     23|                offsetof(stname,selname) ,\
  323|     23|                tname##_ch_tt,\
  324|     23|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     23|                NULL,\
  326|     23|                sizeof(stname),\
  327|     23|                #stname \
  328|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
OSSL_TIME_SPEC_WEEKS_it:
  320|     23|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     23|        { \
  |  |   96|     23|                static const ASN1_ITEM local_it = {
  ------------------
  321|     23|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     23|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     23|                offsetof(stname,selname) ,\
  323|     23|                tname##_ch_tt,\
  324|     23|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     23|                NULL,\
  326|     23|                sizeof(stname),\
  327|     23|                #stname \
  328|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
OSSL_TIME_SPEC_MONTH_it:
  320|     23|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     23|        { \
  |  |   96|     23|                static const ASN1_ITEM local_it = {
  ------------------
  321|     23|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     23|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     23|                offsetof(stname,selname) ,\
  323|     23|                tname##_ch_tt,\
  324|     23|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     23|                NULL,\
  326|     23|                sizeof(stname),\
  327|     23|                #stname \
  328|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
OSSL_TIME_PERIOD_it:
  166|     18|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     18|        { \
  |  |   96|     18|                static const ASN1_ITEM local_it = {
  ------------------
  167|     18|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     18|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     18|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     18|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     18|                tname##_seq_tt,\
  170|     18|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     18|                NULL,\
  172|     18|                sizeof(stname),\
  173|     18|                #tname \
  174|     18|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     18|                }; \
  |  |  103|     18|        return &local_it; \
  |  |  104|     18|        }
  ------------------
OSSL_TIME_SPEC_TIME_it:
  320|    155|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    155|        { \
  |  |   96|    155|                static const ASN1_ITEM local_it = {
  ------------------
  321|    155|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|    155|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|    155|                offsetof(stname,selname) ,\
  323|    155|                tname##_ch_tt,\
  324|    155|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|    155|                NULL,\
  326|    155|                sizeof(stname),\
  327|    155|                #stname \
  328|    155|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    155|                }; \
  |  |  103|    155|        return &local_it; \
  |  |  104|    155|        }
  ------------------
OSSL_TIME_SPEC_it:
  166|     70|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     70|        { \
  |  |   96|     70|                static const ASN1_ITEM local_it = {
  ------------------
  167|     70|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     70|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     70|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     70|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     70|                tname##_seq_tt,\
  170|     70|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     70|                NULL,\
  172|     70|                sizeof(stname),\
  173|     70|                #tname \
  174|     70|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     70|                }; \
  |  |  103|     70|        return &local_it; \
  |  |  104|     70|        }
  ------------------
v3_tlsf.c:TLS_FEATURE_it:
  124|      7|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      7|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      7|        { \
  |  |  |  |   96|      7|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|      7|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|      7|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|      7|                -1,\
  127|      7|                &tname##_item_tt,\
  128|      7|                0,\
  129|      7|                NULL,\
  130|      7|                0,\
  131|      7|                #tname \
  132|      7|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      7|                }; \
  |  |  103|      7|        return &local_it; \
  |  |  104|      7|        }
  ------------------
OSSL_USER_NOTICE_SYNTAX_it:
  113|    114|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    114|        { \
  |  |   96|    114|                static const ASN1_ITEM local_it = {
  ------------------
  114|    114|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|    114|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|    114|                -1,\
  116|    114|                &tname##_item_tt,\
  117|    114|                0,\
  118|    114|                NULL,\
  119|    114|                0,\
  120|    114|                #tname \
  121|    114|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    114|                }; \
  |  |  103|    114|        return &local_it; \
  |  |  104|    114|        }
  ------------------
X509_ATTRIBUTE_it:
  166|  2.22k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.22k|        { \
  |  |   96|  2.22k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  2.22k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.22k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  2.22k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.22k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  2.22k|                tname##_seq_tt,\
  170|  2.22k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  2.22k|                NULL,\
  172|  2.22k|                sizeof(stname),\
  173|  2.22k|                #tname \
  174|  2.22k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.22k|                }; \
  |  |  103|  2.22k|        return &local_it; \
  |  |  104|  2.22k|        }
  ------------------
X509_REVOKED_it:
  166|      4|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      4|        { \
  |  |   96|      4|                static const ASN1_ITEM local_it = {
  ------------------
  167|      4|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      4|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      4|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      4|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      4|                tname##_seq_tt,\
  170|      4|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      4|                NULL,\
  172|      4|                sizeof(stname),\
  173|      4|                #tname \
  174|      4|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      4|                }; \
  |  |  103|      4|        return &local_it; \
  |  |  104|      4|        }
  ------------------
X509_CRL_INFO_it:
  247|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  248|     11|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     11|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|     11|                tname##_seq_tt,\
  251|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|     11|                &tname##_aux,\
  253|     11|                sizeof(stname),\
  254|     11|                #tname \
  255|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
X509_CRL_it:
  247|  1.45k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.45k|        { \
  |  |   96|  1.45k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  1.45k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.45k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  1.45k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.45k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  1.45k|                tname##_seq_tt,\
  251|  1.45k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  1.45k|                &tname##_aux,\
  253|  1.45k|                sizeof(stname),\
  254|  1.45k|                #tname \
  255|  1.45k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.45k|                }; \
  |  |  103|  1.45k|        return &local_it; \
  |  |  104|  1.45k|        }
  ------------------
X509_EXTENSION_it:
  166|   112k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   112k|        { \
  |  |   96|   112k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   112k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   112k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   112k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   112k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   112k|                tname##_seq_tt,\
  170|   112k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   112k|                NULL,\
  172|   112k|                sizeof(stname),\
  173|   112k|                #tname \
  174|   112k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   112k|                }; \
  |  |  103|   112k|        return &local_it; \
  |  |  104|   112k|        }
  ------------------
X509_EXTENSIONS_it:
  113|   476k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   476k|        { \
  |  |   96|   476k|                static const ASN1_ITEM local_it = {
  ------------------
  114|   476k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   476k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|   476k|                -1,\
  116|   476k|                &tname##_item_tt,\
  117|   476k|                0,\
  118|   476k|                NULL,\
  119|   476k|                0,\
  120|   476k|                #tname \
  121|   476k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   476k|                }; \
  |  |  103|   476k|        return &local_it; \
  |  |  104|   476k|        }
  ------------------
X509_NAME_ENTRY_it:
  166|   877k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   877k|        { \
  |  |   96|   877k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   877k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   877k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   877k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   877k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   877k|                tname##_seq_tt,\
  170|   877k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   877k|                NULL,\
  172|   877k|                sizeof(stname),\
  173|   877k|                #tname \
  174|   877k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   877k|                }; \
  |  |  103|   877k|        return &local_it; \
  |  |  104|   877k|        }
  ------------------
X509_NAME_ENTRY_new:
  812|   135k|        { \
  813|   135k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   135k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   135k|        } \
X509_NAME_ENTRY_free:
  816|   300k|        { \
  817|   300k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   300k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   300k|        }
X509_NAME_it:
  775|  1.28M|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|  1.28M|        { \
  |  |   96|  1.28M|                static const ASN1_ITEM local_it = {
  ------------------
  776|  1.28M|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|  1.28M|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|  1.28M|                tag, \
  778|  1.28M|                NULL, \
  779|  1.28M|                0, \
  780|  1.28M|                &fptrs, \
  781|  1.28M|                0, \
  782|  1.28M|                #sname \
  783|  1.28M|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|  1.28M|                }; \
  |  |  103|  1.28M|        return &local_it; \
  |  |  104|  1.28M|        }
  ------------------
i2d_X509_NAME:
  830|     18|        { \
  831|     18|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     18|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     18|        }
X509_NAME_new:
  812|  18.5k|        { \
  813|  18.5k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  18.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  18.5k|        } \
X509_NAME_free:
  816|  76.8k|        { \
  817|  76.8k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  76.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  76.8k|        }
X509_NAME_dup:
  855|  13.9k|        { \
  856|  13.9k|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  427|  13.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|  13.9k|        }
x_name.c:X509_NAME_INTERNAL_it:
  124|  45.6k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  45.6k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  45.6k|        { \
  |  |  |  |   96|  45.6k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  45.6k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  45.6k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  45.6k|                -1,\
  127|  45.6k|                &tname##_item_tt,\
  128|  45.6k|                0,\
  129|  45.6k|                NULL,\
  130|  45.6k|                0,\
  131|  45.6k|                #tname \
  132|  45.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  45.6k|                }; \
  |  |  103|  45.6k|        return &local_it; \
  |  |  104|  45.6k|        }
  ------------------
x_name.c:X509_NAME_ENTRIES_it:
  124|  4.21M|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  4.21M|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  4.21M|        { \
  |  |  |  |   96|  4.21M|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  4.21M|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  4.21M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  4.21M|                -1,\
  127|  4.21M|                &tname##_item_tt,\
  128|  4.21M|                0,\
  129|  4.21M|                NULL,\
  130|  4.21M|                0,\
  131|  4.21M|                #tname \
  132|  4.21M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.21M|                }; \
  |  |  103|  4.21M|        return &local_it; \
  |  |  104|  4.21M|        }
  ------------------
X509_PUBKEY_it:
  775|   698k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   698k|        { \
  |  |   96|   698k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   698k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   698k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   698k|                tag, \
  778|   698k|                NULL, \
  779|   698k|                0, \
  780|   698k|                &fptrs, \
  781|   698k|                0, \
  782|   698k|                #sname \
  783|   698k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   698k|                }; \
  |  |  103|   698k|        return &local_it; \
  |  |  104|   698k|        }
  ------------------
d2i_X509_PUBKEY:
  826|  50.6k|        { \
  827|  50.6k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  50.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  50.6k|        } \
X509_PUBKEY_free:
  816|   101k|        { \
  817|   101k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   101k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   101k|        }
x_pubkey.c:X509_PUBKEY_INTERNAL_it:
  178|   431k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   431k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   431k|        { \
  |  |  |  |   96|   431k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|   431k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   431k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|   431k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   431k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|   431k|                tname##_seq_tt,\
  182|   431k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|   431k|                NULL,\
  184|   431k|                sizeof(stname),\
  185|   431k|                #stname \
  186|   431k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   431k|                }; \
  |  |  103|   431k|        return &local_it; \
  |  |  104|   431k|        }
  ------------------
X509_REQ_INFO_it:
  247|  20.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  20.0k|        { \
  |  |   96|  20.0k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  20.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  20.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  20.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  20.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  20.0k|                tname##_seq_tt,\
  251|  20.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  20.0k|                &tname##_aux,\
  253|  20.0k|                sizeof(stname),\
  254|  20.0k|                #tname \
  255|  20.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  20.0k|                }; \
  |  |  103|  20.0k|        return &local_it; \
  |  |  104|  20.0k|        }
  ------------------
X509_REQ_it:
  247|  29.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  29.7k|        { \
  |  |   96|  29.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  29.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  29.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  29.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  29.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  29.7k|                tname##_seq_tt,\
  251|  29.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  29.7k|                &tname##_aux,\
  253|  29.7k|                sizeof(stname),\
  254|  29.7k|                #tname \
  255|  29.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.7k|                }; \
  |  |  103|  29.7k|        return &local_it; \
  |  |  104|  29.7k|        }
  ------------------
X509_REQ_free:
  816|  13.8k|        { \
  817|  13.8k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  13.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  13.8k|        }
X509_CINF_it:
  247|  30.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  30.1k|        { \
  |  |   96|  30.1k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  30.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  30.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  30.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  30.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  30.1k|                tname##_seq_tt,\
  251|  30.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  30.1k|                &tname##_aux,\
  253|  30.1k|                sizeof(stname),\
  254|  30.1k|                #tname \
  255|  30.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  30.1k|                }; \
  |  |  103|  30.1k|        return &local_it; \
  |  |  104|  30.1k|        }
  ------------------
X509_it:
  247|   114k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   114k|        { \
  |  |   96|   114k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   114k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   114k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   114k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   114k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   114k|                tname##_seq_tt,\
  251|   114k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   114k|                &tname##_aux,\
  253|   114k|                sizeof(stname),\
  254|   114k|                #tname \
  255|   114k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   114k|                }; \
  |  |  103|   114k|        return &local_it; \
  |  |  104|   114k|        }
  ------------------
X509_new:
  812|  6.94k|        { \
  813|  6.94k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  6.94k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  6.94k|        } \
X509_free:
  816|  72.5k|        { \
  817|  72.5k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  72.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  72.5k|        }
X509_CERT_AUX_it:
  166|  9.90k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  9.90k|        { \
  |  |   96|  9.90k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  9.90k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  9.90k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  9.90k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  9.90k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  9.90k|                tname##_seq_tt,\
  170|  9.90k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  9.90k|                NULL,\
  172|  9.90k|                sizeof(stname),\
  173|  9.90k|                #tname \
  174|  9.90k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.90k|                }; \
  |  |  103|  9.90k|        return &local_it; \
  |  |  104|  9.90k|        }
  ------------------
X509_CERT_AUX_free:
  816|  9.90k|        { \
  817|  9.90k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  9.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  9.90k|        }
decode_der2key.c:BARE_PUBKEY_it:
  178|    362|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    362|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    362|        { \
  |  |  |  |   96|    362|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    362|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    362|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    362|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    362|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    362|                tname##_seq_tt,\
  182|    362|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    362|                NULL,\
  184|    362|                sizeof(stname),\
  185|    362|                #stname \
  186|    362|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    362|                }; \
  |  |  103|    362|        return &local_it; \
  |  |  104|    362|        }
  ------------------
decode_der2key.c:BARE_ALGOR_it:
  178|    722|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    722|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    722|        { \
  |  |  |  |   96|    722|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    722|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    722|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    722|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    722|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    722|                tname##_seq_tt,\
  182|    722|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    722|                NULL,\
  184|    722|                sizeof(stname),\
  185|    722|                #stname \
  186|    722|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    722|                }; \
  |  |  103|    722|        return &local_it; \
  |  |  104|    722|        }
  ------------------
ASN1_TIME_it:
  770|  48.1k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  48.1k|        { \
  |  |   96|  48.1k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  48.1k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  48.1k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  48.1k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  48.1k|                }; \
  |  |  103|  48.1k|        return &local_it; \
  |  |  104|  48.1k|        }
  ------------------
ASN1_TIME_free:
  816|  2.96k|        { \
  817|  2.96k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  2.96k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  2.96k|        }
X509_ALGOR_it:
  166|  1.51M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.51M|        { \
  |  |   96|  1.51M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.51M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.51M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.51M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.51M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.51M|                tname##_seq_tt,\
  170|  1.51M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.51M|                NULL,\
  172|  1.51M|                sizeof(stname),\
  173|  1.51M|                #tname \
  174|  1.51M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.51M|                }; \
  |  |  103|  1.51M|        return &local_it; \
  |  |  104|  1.51M|        }
  ------------------
X509_ALGOR_new:
  812|   120k|        { \
  813|   120k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   120k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   120k|        } \
X509_ALGOR_free:
  816|   130k|        { \
  817|   130k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|   130k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   130k|        }
X509_VAL_it:
  166|  18.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  18.7k|        { \
  |  |   96|  18.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  18.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  18.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  18.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  18.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  18.7k|                tname##_seq_tt,\
  170|  18.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  18.7k|                NULL,\
  172|  18.7k|                sizeof(stname),\
  173|  18.7k|                #tname \
  174|  18.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  18.7k|                }; \
  |  |  103|  18.7k|        return &local_it; \
  |  |  104|  18.7k|        }
  ------------------
DHparams_it:
  247|    674|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    674|        { \
  |  |   96|    674|                static const ASN1_ITEM local_it = {
  ------------------
  248|    674|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    674|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|    674|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    674|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|    674|                tname##_seq_tt,\
  251|    674|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|    674|                &tname##_aux,\
  253|    674|                sizeof(stname),\
  254|    674|                #tname \
  255|    674|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    674|                }; \
  |  |  103|    674|        return &local_it; \
  |  |  104|    674|        }
  ------------------
d2i_DHparams:
  826|    674|        { \
  827|    674|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|    674|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|    674|        } \
d2i_int_dhx:
  826|  1.62k|        { \
  827|  1.62k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  1.62k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  1.62k|        } \
dh_asn1.c:DHxparams_it:
  178|  1.62k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.62k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.62k|        { \
  |  |  |  |   96|  1.62k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.62k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.62k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.62k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.62k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.62k|                tname##_seq_tt,\
  182|  1.62k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.62k|                NULL,\
  184|  1.62k|                sizeof(stname),\
  185|  1.62k|                #stname \
  186|  1.62k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.62k|                }; \
  |  |  103|  1.62k|        return &local_it; \
  |  |  104|  1.62k|        }
  ------------------
dh_asn1.c:DHvparams_it:
  178|  5.35k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  5.35k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  5.35k|        { \
  |  |  |  |   96|  5.35k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  5.35k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  5.35k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  5.35k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.35k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  5.35k|                tname##_seq_tt,\
  182|  5.35k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  5.35k|                NULL,\
  184|  5.35k|                sizeof(stname),\
  185|  5.35k|                #stname \
  186|  5.35k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.35k|                }; \
  |  |  103|  5.35k|        return &local_it; \
  |  |  104|  5.35k|        }
  ------------------
d2i_DSAparams:
  826|  1.45k|        { \
  827|  1.45k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  1.45k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  1.45k|        } \
d2i_DSAPublicKey:
  826|     16|        { \
  827|     16|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|     16|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|     16|        } \
dsa_asn1.c:DSAparams_it:
  258|  1.45k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.45k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.45k|        { \
  |  |  |  |   96|  1.45k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  1.45k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.45k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  1.45k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.45k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  1.45k|                tname##_seq_tt,\
  262|  1.45k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  1.45k|                &tname##_aux,\
  264|  1.45k|                sizeof(stname),\
  265|  1.45k|                #stname \
  266|  1.45k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.45k|                }; \
  |  |  103|  1.45k|        return &local_it; \
  |  |  104|  1.45k|        }
  ------------------
dsa_asn1.c:DSAPublicKey_it:
  258|     16|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     16|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     16|        { \
  |  |  |  |   96|     16|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|     16|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     16|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|     16|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     16|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|     16|                tname##_seq_tt,\
  262|     16|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|     16|                &tname##_aux,\
  264|     16|                sizeof(stname),\
  265|     16|                #stname \
  266|     16|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     16|                }; \
  |  |  103|     16|        return &local_it; \
  |  |  104|     16|        }
  ------------------
ECPARAMETERS_it:
  166|  11.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.3k|        { \
  |  |   96|  11.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.3k|                tname##_seq_tt,\
  170|  11.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.3k|                NULL,\
  172|  11.3k|                sizeof(stname),\
  173|  11.3k|                #tname \
  174|  11.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.3k|                }; \
  |  |  103|  11.3k|        return &local_it; \
  |  |  104|  11.3k|        }
  ------------------
ECPKPARAMETERS_it:
  320|  11.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.3k|        { \
  |  |   96|  11.3k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  11.3k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  11.3k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  11.3k|                offsetof(stname,selname) ,\
  323|  11.3k|                tname##_ch_tt,\
  324|  11.3k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  11.3k|                NULL,\
  326|  11.3k|                sizeof(stname),\
  327|  11.3k|                #stname \
  328|  11.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.3k|                }; \
  |  |  103|  11.3k|        return &local_it; \
  |  |  104|  11.3k|        }
  ------------------
d2i_ECPKPARAMETERS:
  826|  5.65k|        { \
  827|  5.65k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  5.65k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  5.65k|        } \
ECPKPARAMETERS_free:
  816|  5.65k|        { \
  817|  5.65k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  5.65k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  5.65k|        }
ec_asn1.c:X9_62_FIELDID_it:
  178|  15.2k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  15.2k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  15.2k|        { \
  |  |  |  |   96|  15.2k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  15.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  15.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  15.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  15.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  15.2k|                tname##_seq_tt,\
  182|  15.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  15.2k|                NULL,\
  184|  15.2k|                sizeof(stname),\
  185|  15.2k|                #stname \
  186|  15.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  15.2k|                }; \
  |  |  103|  15.2k|        return &local_it; \
  |  |  104|  15.2k|        }
  ------------------
ec_asn1.c:X9_62_FIELDID_adb:
  463|  13.1k|        { \
  464|  13.1k|        static const ASN1_ADB internal_adb = \
  465|  13.1k|                {\
  466|  13.1k|                flags,\
  467|  13.1k|                offsetof(name, field),\
  468|  13.1k|                adb_cb,\
  469|  13.1k|                name##_adbtbl,\
  470|  13.1k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  13.1k|                def,\
  472|  13.1k|                none\
  473|  13.1k|                }; \
  474|  13.1k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  13.1k|        } \
ec_asn1.c:X9_62_CURVE_it:
  178|  11.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  11.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  11.3k|        { \
  |  |  |  |   96|  11.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  11.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  11.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  11.3k|                tname##_seq_tt,\
  182|  11.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  11.3k|                NULL,\
  184|  11.3k|                sizeof(stname),\
  185|  11.3k|                #stname \
  186|  11.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.3k|                }; \
  |  |  103|  11.3k|        return &local_it; \
  |  |  104|  11.3k|        }
  ------------------
RSAPublicKey_it:
  247|  11.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.2k|        { \
  |  |   96|  11.2k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  11.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  11.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  11.2k|                tname##_seq_tt,\
  251|  11.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  11.2k|                &tname##_aux,\
  253|  11.2k|                sizeof(stname),\
  254|  11.2k|                #tname \
  255|  11.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.2k|                }; \
  |  |  103|  11.2k|        return &local_it; \
  |  |  104|  11.2k|        }
  ------------------
RSA_PSS_PARAMS_it:
  247|  15.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  15.9k|        { \
  |  |   96|  15.9k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  15.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  15.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  15.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  15.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  15.9k|                tname##_seq_tt,\
  251|  15.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  15.9k|                &tname##_aux,\
  253|  15.9k|                sizeof(stname),\
  254|  15.9k|                #tname \
  255|  15.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  15.9k|                }; \
  |  |  103|  15.9k|        return &local_it; \
  |  |  104|  15.9k|        }
  ------------------
RSA_PSS_PARAMS_free:
  816|  12.5k|        { \
  817|  12.5k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  12.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  12.5k|        }
d2i_RSAPublicKey:
  826|  11.2k|        { \
  827|  11.2k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  427|  11.2k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.2k|        } \
OSSL_ALLOWED_ATTRIBUTES_CHOICE_it:
  320|      5|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      5|        { \
  |  |   96|      5|                static const ASN1_ITEM local_it = {
  ------------------
  321|      5|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|      5|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|      5|                offsetof(stname,selname) ,\
  323|      5|                tname##_ch_tt,\
  324|      5|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|      5|                NULL,\
  326|      5|                sizeof(stname),\
  327|      5|                #stname \
  328|      5|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      5|                }; \
  |  |  103|      5|        return &local_it; \
  |  |  104|      5|        }
  ------------------
OSSL_ALLOWED_ATTRIBUTES_ITEM_it:
  166|     16|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     16|        { \
  |  |   96|     16|                static const ASN1_ITEM local_it = {
  ------------------
  167|     16|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     16|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     16|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     16|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     16|                tname##_seq_tt,\
  170|     16|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     16|                NULL,\
  172|     16|                sizeof(stname),\
  173|     16|                #tname \
  174|     16|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     16|                }; \
  |  |  103|     16|        return &local_it; \
  |  |  104|     16|        }
  ------------------
OSSL_ALLOWED_ATTRIBUTES_SYNTAX_it:
  113|     30|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     30|        { \
  |  |   96|     30|                static const ASN1_ITEM local_it = {
  ------------------
  114|     30|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     30|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     30|                -1,\
  116|     30|                &tname##_item_tt,\
  117|     30|                0,\
  118|     30|                NULL,\
  119|     30|                0,\
  120|     30|                #tname \
  121|     30|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     30|                }; \
  |  |  103|     30|        return &local_it; \
  |  |  104|     30|        }
  ------------------
OSSL_TARGET_it:
  320|     56|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     56|        { \
  |  |   96|     56|                static const ASN1_ITEM local_it = {
  ------------------
  321|     56|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     56|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     56|                offsetof(stname,selname) ,\
  323|     56|                tname##_ch_tt,\
  324|     56|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     56|                NULL,\
  326|     56|                sizeof(stname),\
  327|     56|                #stname \
  328|     56|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     56|                }; \
  |  |  103|     56|        return &local_it; \
  |  |  104|     56|        }
  ------------------
OSSL_TARGETS_it:
  113|    102|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    102|        { \
  |  |   96|    102|                static const ASN1_ITEM local_it = {
  ------------------
  114|    102|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|    102|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|    102|                -1,\
  116|    102|                &tname##_item_tt,\
  117|    102|                0,\
  118|    102|                NULL,\
  119|    102|                0,\
  120|    102|                #tname \
  121|    102|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    102|                }; \
  |  |  103|    102|        return &local_it; \
  |  |  104|    102|        }
  ------------------
OSSL_TARGETING_INFORMATION_it:
  113|     68|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     68|        { \
  |  |   96|     68|                static const ASN1_ITEM local_it = {
  ------------------
  114|     68|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     68|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     68|                -1,\
  116|     68|                &tname##_item_tt,\
  117|     68|                0,\
  118|     68|                NULL,\
  119|     68|                0,\
  120|     68|                #tname \
  121|     68|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     68|                }; \
  |  |  103|     68|        return &local_it; \
  |  |  104|     68|        }
  ------------------
v3_ac_tgt.c:OSSL_TARGET_CERT_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|        }
  ------------------
v3_ac_tgt.c:OSSL_ISSUER_SERIAL_it:
  178|     11|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     11|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     11|        { \
  |  |  |  |   96|     11|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     11|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     11|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     11|                tname##_seq_tt,\
  182|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     11|                NULL,\
  184|     11|                sizeof(stname),\
  185|     11|                #stname \
  186|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
v3_ac_tgt.c:OSSL_OBJECT_DIGEST_INFO_it:
  178|     12|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     12|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     12|        { \
  |  |  |  |   96|     12|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     12|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     12|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     12|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     12|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     12|                tname##_seq_tt,\
  182|     12|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     12|                NULL,\
  184|     12|                sizeof(stname),\
  185|     12|                #stname \
  186|     12|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     12|                }; \
  |  |  103|     12|        return &local_it; \
  |  |  104|     12|        }
  ------------------
IPAddressRange_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|        }
  ------------------
IPAddressOrRange_it:
  320|     78|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     78|        { \
  |  |   96|     78|                static const ASN1_ITEM local_it = {
  ------------------
  321|     78|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     78|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     78|                offsetof(stname,selname) ,\
  323|     78|                tname##_ch_tt,\
  324|     78|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     78|                NULL,\
  326|     78|                sizeof(stname),\
  327|     78|                #stname \
  328|     78|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     78|                }; \
  |  |  103|     78|        return &local_it; \
  |  |  104|     78|        }
  ------------------
IPAddressChoice_it:
  320|     37|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     37|        { \
  |  |   96|     37|                static const ASN1_ITEM local_it = {
  ------------------
  321|     37|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     37|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     37|                offsetof(stname,selname) ,\
  323|     37|                tname##_ch_tt,\
  324|     37|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     37|                NULL,\
  326|     37|                sizeof(stname),\
  327|     37|                #stname \
  328|     37|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     37|                }; \
  |  |  103|     37|        return &local_it; \
  |  |  104|     37|        }
  ------------------
IPAddressFamily_it:
  166|     28|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     28|        { \
  |  |   96|     28|                static const ASN1_ITEM local_it = {
  ------------------
  167|     28|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     28|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     28|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     28|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     28|                tname##_seq_tt,\
  170|     28|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     28|                NULL,\
  172|     28|                sizeof(stname),\
  173|     28|                #tname \
  174|     28|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     28|                }; \
  |  |  103|     28|        return &local_it; \
  |  |  104|     28|        }
  ------------------
IPAddressFamily_free:
  816|      5|        { \
  817|      5|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|      5|        }
v3_addr.c:IPAddrBlocks_it:
  124|     21|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     21|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     21|        { \
  |  |  |  |   96|     21|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|     21|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     21|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|     21|                -1,\
  127|     21|                &tname##_item_tt,\
  128|     21|                0,\
  129|     21|                NULL,\
  130|     21|                0,\
  131|     21|                #tname \
  132|     21|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     21|                }; \
  |  |  103|     21|        return &local_it; \
  |  |  104|     21|        }
  ------------------
ASRange_it:
  166|     10|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     10|        { \
  |  |   96|     10|                static const ASN1_ITEM local_it = {
  ------------------
  167|     10|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     10|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     10|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     10|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     10|                tname##_seq_tt,\
  170|     10|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     10|                NULL,\
  172|     10|                sizeof(stname),\
  173|     10|                #tname \
  174|     10|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     10|                }; \
  |  |  103|     10|        return &local_it; \
  |  |  104|     10|        }
  ------------------
ASIdOrRange_it:
  320|     34|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     34|        { \
  |  |   96|     34|                static const ASN1_ITEM local_it = {
  ------------------
  321|     34|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     34|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     34|                offsetof(stname,selname) ,\
  323|     34|                tname##_ch_tt,\
  324|     34|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     34|                NULL,\
  326|     34|                sizeof(stname),\
  327|     34|                #stname \
  328|     34|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     34|                }; \
  |  |  103|     34|        return &local_it; \
  |  |  104|     34|        }
  ------------------
ASIdentifierChoice_it:
  320|     83|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     83|        { \
  |  |   96|     83|                static const ASN1_ITEM local_it = {
  ------------------
  321|     83|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     83|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     83|                offsetof(stname,selname) ,\
  323|     83|                tname##_ch_tt,\
  324|     83|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     83|                NULL,\
  326|     83|                sizeof(stname),\
  327|     83|                #stname \
  328|     83|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     83|                }; \
  |  |  103|     83|        return &local_it; \
  |  |  104|     83|        }
  ------------------
ASIdentifiers_it:
  166|  9.92k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  9.92k|        { \
  |  |   96|  9.92k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  9.92k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  9.92k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  9.92k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  9.92k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  9.92k|                tname##_seq_tt,\
  170|  9.92k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  9.92k|                NULL,\
  172|  9.92k|                sizeof(stname),\
  173|  9.92k|                #tname \
  174|  9.92k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.92k|                }; \
  |  |  103|  9.92k|        return &local_it; \
  |  |  104|  9.92k|        }
  ------------------
ASIdentifiers_free:
  816|  9.90k|        { \
  817|  9.90k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|  9.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  9.90k|        }
OSSL_INFO_SYNTAX_it:
  320|     20|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     20|        { \
  |  |   96|     20|                static const ASN1_ITEM local_it = {
  ------------------
  321|     20|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     20|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     20|                offsetof(stname,selname) ,\
  323|     20|                tname##_ch_tt,\
  324|     20|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     20|                NULL,\
  326|     20|                sizeof(stname),\
  327|     20|                #stname \
  328|     20|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     20|                }; \
  |  |  103|     20|        return &local_it; \
  |  |  104|     20|        }
  ------------------
OSSL_PRIVILEGE_POLICY_ID_it:
  166|     20|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     20|        { \
  |  |   96|     20|                static const ASN1_ITEM local_it = {
  ------------------
  167|     20|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     20|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     20|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     20|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     20|                tname##_seq_tt,\
  170|     20|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     20|                NULL,\
  172|     20|                sizeof(stname),\
  173|     20|                #tname \
  174|     20|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     20|                }; \
  |  |  103|     20|        return &local_it; \
  |  |  104|     20|        }
  ------------------
OSSL_ATTRIBUTE_DESCRIPTOR_it:
  166|     18|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     18|        { \
  |  |   96|     18|                static const ASN1_ITEM local_it = {
  ------------------
  167|     18|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     18|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     18|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     18|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     18|                tname##_seq_tt,\
  170|     18|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     18|                NULL,\
  172|     18|                sizeof(stname),\
  173|     18|                #tname \
  174|     18|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     18|                }; \
  |  |  103|     18|        return &local_it; \
  |  |  104|     18|        }
  ------------------
OSSL_ATAV_it:
  166|     15|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     15|        { \
  |  |   96|     15|                static const ASN1_ITEM local_it = {
  ------------------
  167|     15|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     15|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     15|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     15|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     15|                tname##_seq_tt,\
  170|     15|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     15|                NULL,\
  172|     15|                sizeof(stname),\
  173|     15|                #tname \
  174|     15|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     15|                }; \
  |  |  103|     15|        return &local_it; \
  |  |  104|     15|        }
  ------------------
OSSL_ATTRIBUTE_TYPE_MAPPING_it:
  166|     20|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     20|        { \
  |  |   96|     20|                static const ASN1_ITEM local_it = {
  ------------------
  167|     20|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     20|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     20|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     20|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     20|                tname##_seq_tt,\
  170|     20|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     20|                NULL,\
  172|     20|                sizeof(stname),\
  173|     20|                #tname \
  174|     20|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     20|                }; \
  |  |  103|     20|        return &local_it; \
  |  |  104|     20|        }
  ------------------
OSSL_ATTRIBUTE_VALUE_MAPPING_it:
  166|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  167|     11|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     11|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     11|                tname##_seq_tt,\
  170|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     11|                NULL,\
  172|     11|                sizeof(stname),\
  173|     11|                #tname \
  174|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
OSSL_ATTRIBUTE_MAPPING_it:
  320|     28|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     28|        { \
  |  |   96|     28|                static const ASN1_ITEM local_it = {
  ------------------
  321|     28|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|     28|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|     28|                offsetof(stname,selname) ,\
  323|     28|                tname##_ch_tt,\
  324|     28|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|     28|                NULL,\
  326|     28|                sizeof(stname),\
  327|     28|                #stname \
  328|     28|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     28|                }; \
  |  |  103|     28|        return &local_it; \
  |  |  104|     28|        }
  ------------------
OSSL_ATTRIBUTE_MAPPINGS_it:
  113|     34|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     34|        { \
  |  |   96|     34|                static const ASN1_ITEM local_it = {
  ------------------
  114|     34|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     34|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     34|                -1,\
  116|     34|                &tname##_item_tt,\
  117|     34|                0,\
  118|     34|                NULL,\
  119|     34|                0,\
  120|     34|                #tname \
  121|     34|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     34|                }; \
  |  |  103|     34|        return &local_it; \
  |  |  104|     34|        }
  ------------------
OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_it:
  113|     29|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     29|        { \
  |  |   96|     29|                static const ASN1_ITEM local_it = {
  ------------------
  114|     29|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     29|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     29|                -1,\
  116|     29|                &tname##_item_tt,\
  117|     29|                0,\
  118|     29|                NULL,\
  119|     29|                0,\
  120|     29|                #tname \
  121|     29|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     29|                }; \
  |  |  103|     29|        return &local_it; \
  |  |  104|     29|        }
  ------------------
OSSL_BASIC_ATTR_CONSTRAINTS_it:
  166|     46|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     46|        { \
  |  |   96|     46|                static const ASN1_ITEM local_it = {
  ------------------
  167|     46|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     46|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     46|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     46|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     46|                tname##_seq_tt,\
  170|     46|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     46|                NULL,\
  172|     46|                sizeof(stname),\
  173|     46|                #tname \
  174|     46|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     46|                }; \
  |  |  103|     46|        return &local_it; \
  |  |  104|     46|        }
  ------------------
BASIC_CONSTRAINTS_it:
  166|  1.37k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.37k|        { \
  |  |   96|  1.37k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.37k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.37k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.37k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.37k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.37k|                tname##_seq_tt,\
  170|  1.37k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.37k|                NULL,\
  172|  1.37k|                sizeof(stname),\
  173|  1.37k|                #tname \
  174|  1.37k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.37k|                }; \
  |  |  103|  1.37k|        return &local_it; \
  |  |  104|  1.37k|        }
  ------------------
BASIC_CONSTRAINTS_free:
  816|    495|        { \
  817|    495|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    495|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    495|        }
EXTENDED_KEY_USAGE_it:
  113|     64|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     64|        { \
  |  |   96|     64|                static const ASN1_ITEM local_it = {
  ------------------
  114|     64|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     64|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     64|                -1,\
  116|     64|                &tname##_item_tt,\
  117|     64|                0,\
  118|     64|                NULL,\
  119|     64|                0,\
  120|     64|                #tname \
  121|     64|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     64|                }; \
  |  |  103|     64|        return &local_it; \
  |  |  104|     64|        }
  ------------------
ACCESS_DESCRIPTION_it:
  166|    218|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    218|        { \
  |  |   96|    218|                static const ASN1_ITEM local_it = {
  ------------------
  167|    218|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    218|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    218|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    218|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    218|                tname##_seq_tt,\
  170|    218|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    218|                NULL,\
  172|    218|                sizeof(stname),\
  173|    218|                #tname \
  174|    218|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    218|                }; \
  |  |  103|    218|        return &local_it; \
  |  |  104|    218|        }
  ------------------
AUTHORITY_INFO_ACCESS_it:
  113|    203|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    203|        { \
  |  |   96|    203|                static const ASN1_ITEM local_it = {
  ------------------
  114|    203|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|    203|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|    203|                -1,\
  116|    203|                &tname##_item_tt,\
  117|    203|                0,\
  118|    203|                NULL,\
  119|    203|                0,\
  120|    203|                #tname \
  121|    203|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    203|                }; \
  |  |  103|    203|        return &local_it; \
  |  |  104|    203|        }
  ------------------
OSSL_ISSUER_SERIAL_it:
  166|     22|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     22|        { \
  |  |   96|     22|                static const ASN1_ITEM local_it = {
  ------------------
  167|     22|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     22|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     22|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     22|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     22|                tname##_seq_tt,\
  170|     22|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     22|                NULL,\
  172|     22|                sizeof(stname),\
  173|     22|                #tname \
  174|     22|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     22|                }; \
  |  |  103|     22|        return &local_it; \
  |  |  104|     22|        }
  ------------------
OCSP_CRLID_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|        }
  ------------------
OCSP_SERVICELOC_it:
  166|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  167|     11|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     11|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     11|                tname##_seq_tt,\
  170|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     11|                NULL,\
  172|     11|                sizeof(stname),\
  173|     11|                #tname \
  174|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------

digest.c:OSSL_FUNC_digest_newctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_init:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_update:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_final:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_squeeze:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
digest.c:OSSL_FUNC_digest_freectx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_dupctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_get_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_copyctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_new:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_init:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_template:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_settable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_cleanup:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_free:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_load:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_get_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gettable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_set_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_settable_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_query_operation_name:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_has:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_dup:
   59|     33|    {                                                                   \
   60|     33|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     33|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_validate:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_match:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
mac_meth.c:OSSL_FUNC_mac_newctx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_dupctx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_freectx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_init:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_update:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_final:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
mac_meth.c:OSSL_FUNC_mac_gettable_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
mac_meth.c:OSSL_FUNC_mac_settable_ctx_params:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
mac_meth.c:OSSL_FUNC_mac_get_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
mac_meth.c:OSSL_FUNC_mac_set_ctx_params:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
signature.c:OSSL_FUNC_signature_newctx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_sign_init:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
signature.c:OSSL_FUNC_signature_sign:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_sign_message_init:
   59|     51|    {                                                                   \
   60|     51|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     51|    }
signature.c:OSSL_FUNC_signature_sign_message_update:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_sign_message_final:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_init:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
signature.c:OSSL_FUNC_signature_verify:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_verify_message_init:
   59|     51|    {                                                                   \
   60|     51|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     51|    }
signature.c:OSSL_FUNC_signature_verify_message_update:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_message_final:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_recover_init:
   59|     14|    {                                                                   \
   60|     14|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     14|    }
signature.c:OSSL_FUNC_signature_verify_recover:
   59|     14|    {                                                                   \
   60|     14|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     14|    }
signature.c:OSSL_FUNC_signature_digest_sign_init:
   59|     25|    {                                                                   \
   60|     25|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     25|    }
signature.c:OSSL_FUNC_signature_digest_sign_update:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
signature.c:OSSL_FUNC_signature_digest_sign_final:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
signature.c:OSSL_FUNC_signature_digest_sign:
   59|     17|    {                                                                   \
   60|     17|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     17|    }
signature.c:OSSL_FUNC_signature_digest_verify_init:
   59|     21|    {                                                                   \
   60|     21|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     21|    }
signature.c:OSSL_FUNC_signature_digest_verify_update:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_digest_verify_final:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_digest_verify:
   59|     17|    {                                                                   \
   60|     17|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     17|    }
signature.c:OSSL_FUNC_signature_freectx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_dupctx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_get_ctx_params:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_params:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_set_ctx_params:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_settable_ctx_params:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_get_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_set_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_settable_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_query_key_types:
   59|     36|    {                                                                   \
   60|     36|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     36|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
provider_core.c:OSSL_FUNC_provider_gettable_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_get_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_get_capabilities:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_query_operation:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
defltprov.c:OSSL_FUNC_core_gettable_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
defltprov.c:OSSL_FUNC_core_get_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
defltprov.c:OSSL_FUNC_core_get_libctx:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_file:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_membuf:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_read_ex:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_write_ex:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_gets:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_puts:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_ctrl:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_up_ref:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_free:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_vprintf:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
decoder_meth.c:OSSL_FUNC_decoder_newctx:
   59|     76|    {                                                                   \
   60|     76|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_freectx:
   59|     76|    {                                                                   \
   60|     76|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_set_ctx_params:
   59|     74|    {                                                                   \
   60|     74|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     74|    }
decoder_meth.c:OSSL_FUNC_decoder_settable_ctx_params:
   59|     74|    {                                                                   \
   60|     74|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     74|    }
decoder_meth.c:OSSL_FUNC_decoder_does_selection:
   59|     73|    {                                                                   \
   60|     73|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     73|    }
decoder_meth.c:OSSL_FUNC_decoder_decode:
   59|     76|    {                                                                   \
   60|     76|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_export_object:
   59|     73|    {                                                                   \
   60|     73|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     73|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_reseed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
evp_rand.c:OSSL_FUNC_rand_enable_locking:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_lock:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_unlock:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_settable_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_get_seed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_clear_seed:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }

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

err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|   115k|    { \
  197|   115k|        return (OPENSSL_LHASH *)lh; \
  198|   115k|    } \
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|   115k|    { \
  161|   115k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|   115k|        return hfn_conv((const type *)data); \
  163|   115k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|   111k|    { \
  166|   111k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|   111k|        return cfn_conv((const type *)da, (const type *)db); \
  168|   111k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  8.62k|    { \
  182|  8.62k|        return ptr; \
  183|  8.62k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|   106k|    { \
  187|   106k|        return ptr; \
  188|   106k|    } \
o_names.c:lh_OBJ_NAME_new:
  317|      1|    { \
  318|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      1|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      1|                                lh_##type##_doall_thunk, \
  321|      1|                                lh_##type##_doall_arg_thunk); \
  322|      1|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.93k|    { \
  244|  1.93k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.93k|        return hfn_conv((const type *)data); \
  246|  1.93k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|  1.60k|    { \
  249|  1.60k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.60k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.60k|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|    543|    { \
  300|    543|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    543|        doall_conv((type *)node); \
  302|    543|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|  1.27k|    { \
  275|  1.27k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  1.27k|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    424|    { \
  265|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    424|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    242|    { \
  280|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    242|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    242|    { \
  270|    242|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    242|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  354|      2|    { \
  355|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|      2|                             lh_##type##_doall_##argtype##_thunk, \
  357|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|      2|                             (void *)arg); \
  359|      2|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  346|    484|    { \
  347|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|    484|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|    484|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  289|      4|    { \
  290|      4|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      4|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|      7|    { \
  295|      7|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|      7|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      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|    251|    { \
  244|    251|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    251|        return hfn_conv((const type *)data); \
  246|    251|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    200|    { \
  249|    200|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    200|        return cfn_conv((const type *)da, (const type *)db); \
  251|    200|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|     17|    { \
  300|     17|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     17|        doall_conv((type *)node); \
  302|     17|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    234|    { \
  275|    234|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    234|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|     17|    { \
  265|     17|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     17|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|     17|    { \
  280|     17|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     17|    } \
property.c:lh_QUERY_doall:
  311|    217|    { \
  312|    217|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    217|    } \
property.c:lh_QUERY_free:
  254|    171|    { \
  255|    171|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    171|    } \
property.c:lh_QUERY_new:
  317|    171|    { \
  318|    171|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    171|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    171|                                lh_##type##_doall_thunk, \
  321|    171|                                lh_##type##_doall_arg_thunk); \
  322|    171|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  42.8k|    { \
  244|  42.8k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  42.8k|        return hfn_conv((const type *)data); \
  246|  42.8k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  42.8k|    { \
  249|  42.8k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  42.8k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  42.8k|    } \
property.c:lh_QUERY_doall_thunk:
  299|     23|    { \
  300|     23|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     23|        doall_conv((type *)node); \
  302|     23|    } \
property.c:lh_QUERY_num_items:
  284|     46|    { \
  285|     46|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  286|     46|    } \
property.c:lh_QUERY_flush:
  259|     46|    { \
  260|     46|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|     46|    } \
property.c:lh_QUERY_retrieve:
  274|  42.8k|    { \
  275|  42.8k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  42.8k|    } \
property.c:lh_QUERY_insert:
  264|     23|    { \
  265|     23|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     23|    } \
property.c:lh_QUERY_error:
  279|     23|    { \
  280|     23|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     23|    } \
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|  1.14k|    { \
  244|  1.14k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.14k|        return hfn_conv((const type *)data); \
  246|  1.14k|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|  1.00k|    { \
  249|  1.00k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.00k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.00k|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|     31|    { \
  300|     31|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     31|        doall_conv((type *)node); \
  302|     31|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|  1.09k|    { \
  275|  1.09k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  1.09k|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|     47|    { \
  265|     47|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     47|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|     47|    { \
  280|     47|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     47|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      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|  63.1k|    { \
  244|  63.1k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  63.1k|        return hfn_conv((const type *)data); \
  246|  63.1k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_cfn_thunk:
  248|  60.7k|    { \
  249|  60.7k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  60.7k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  60.7k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall_thunk:
  299|    803|    { \
  300|    803|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    803|        doall_conv((type *)node); \
  302|    803|    } \
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|  62.3k|    { \
  275|  62.3k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  62.3k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_insert:
  264|    803|    { \
  265|    803|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    803|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_error:
  279|    803|    { \
  280|    803|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    803|    } \

evp_pbe.c:OBJ_bsearch_pbe2:
  129|     84|      { \
  130|     84|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     84|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     84|      } \
evp_pbe.c:pbe2_cmp_BSEARCH_CMP_FN:
  123|    401|      { \
  124|    401|      type1 const *a = a_; \
  125|    401|      type2 const *b = b_; \
  126|    401|      return nm##_cmp(a,b); \
  127|    401|      } \
obj_dat.c:OBJ_bsearch_ln:
  129|     73|      { \
  130|     73|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     73|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     73|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|    770|      { \
  124|    770|      type1 const *a = a_; \
  125|    770|      type2 const *b = b_; \
  126|    770|      return nm##_cmp(a,b); \
  127|    770|      } \
obj_dat.c:OBJ_bsearch_sn:
  129|     78|      { \
  130|     78|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     78|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     78|      } \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  123|    813|      { \
  124|    813|      type1 const *a = a_; \
  125|    813|      type2 const *b = b_; \
  126|    813|      return nm##_cmp(a,b); \
  127|    813|      } \
obj_dat.c:OBJ_bsearch_obj:
  129|   614k|      { \
  130|   614k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|   614k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|   614k|      } \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  123|  5.75M|      { \
  124|  5.75M|      type1 const *a = a_; \
  125|  5.75M|      type2 const *b = b_; \
  126|  5.75M|      return nm##_cmp(a,b); \
  127|  5.75M|      } \
obj_xref.c:OBJ_bsearch_sig:
  129|  2.70k|      { \
  130|  2.70k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  2.70k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  2.70k|      } \
obj_xref.c:sig_cmp_BSEARCH_CMP_FN:
  123|  14.9k|      { \
  124|  14.9k|      type1 const *a = a_; \
  125|  14.9k|      type2 const *b = b_; \
  126|  14.9k|      return nm##_cmp(a,b); \
  127|  14.9k|      } \
v3_lib.c:OBJ_bsearch_ext:
  129|  5.91k|      { \
  130|  5.91k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  5.91k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  5.91k|      } \
v3_lib.c:ext_cmp_BSEARCH_CMP_FN:
  123|  31.4k|      { \
  124|  31.4k|      type1 const *a = a_; \
  125|  31.4k|      type2 const *b = b_; \
  126|  31.4k|      return nm##_cmp(a,b); \
  127|  31.4k|      } \
v3_purp.c:OBJ_bsearch_nid:
  129|  1.34k|      { \
  130|  1.34k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.34k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.34k|      } \
v3_purp.c:nid_cmp_BSEARCH_CMP_FN:
  123|  3.82k|      { \
  124|  3.82k|      type1 const *a = a_; \
  125|  3.82k|      type2 const *b = b_; \
  126|  3.82k|      return nm##_cmp(a,b); \
  127|  3.82k|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|  85.5k|      { \
  130|  85.5k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  85.5k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  85.5k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|   163k|      { \
  124|   163k|      type1 const *a = a_; \
  125|   163k|      type2 const *b = b_; \
  126|   163k|      return nm##_cmp(a,b); \
  127|   163k|      } \

cmp.c:ossl_check_OSSL_CMP_ITAV_sk_type:
   53|    226|    { \
   54|    226|        return (OPENSSL_STACK *)sk; \
   55|    226|    } \
cmp.c:ossl_check_OSSL_CMP_ITAV_freefunc_type:
   65|    226|    { \
   66|    226|        return (OPENSSL_sk_freefunc)fr; \
   67|    226|    }
tasn_prn.c:sk_const_ASN1_VALUE_num:
   80|   125k|    { \
   81|   125k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   125k|    } \
tasn_prn.c:sk_const_ASN1_VALUE_value:
   84|  69.4k|    { \
   85|  69.4k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  69.4k|    } \
cmp_ctx.c:ossl_check_OSSL_CMP_ITAV_sk_type:
   53|  27.7k|    { \
   54|  27.7k|        return (OPENSSL_STACK *)sk; \
   55|  27.7k|    } \
cmp_ctx.c:ossl_check_OSSL_CMP_ITAV_freefunc_type:
   65|  27.7k|    { \
   66|  27.7k|        return (OPENSSL_sk_freefunc)fr; \
   67|  27.7k|    }
cmp_ctx.c:ossl_check_GENERAL_NAME_sk_type:
   53|  13.8k|    { \
   54|  13.8k|        return (OPENSSL_STACK *)sk; \
   55|  13.8k|    } \
cmp_ctx.c:ossl_check_GENERAL_NAME_freefunc_type:
   65|  13.8k|    { \
   66|  13.8k|        return (OPENSSL_sk_freefunc)fr; \
   67|  13.8k|    }
cmp_ctx.c:ossl_check_X509_EXTENSION_sk_type:
   53|  13.8k|    { \
   54|  13.8k|        return (OPENSSL_STACK *)sk; \
   55|  13.8k|    } \
cmp_ctx.c:ossl_check_X509_EXTENSION_freefunc_type:
   65|  13.8k|    { \
   66|  13.8k|        return (OPENSSL_sk_freefunc)fr; \
   67|  13.8k|    }
cmp_ctx.c:ossl_check_POLICYINFO_sk_type:
   53|  13.8k|    { \
   54|  13.8k|        return (OPENSSL_STACK *)sk; \
   55|  13.8k|    } \
cmp_ctx.c:ossl_check_POLICYINFO_freefunc_type:
   65|  13.8k|    { \
   66|  13.8k|        return (OPENSSL_sk_freefunc)fr; \
   67|  13.8k|    }
cmp_ctx.c:ossl_check_ASN1_UTF8STRING_sk_type:
   53|  13.8k|    { \
   54|  13.8k|        return (OPENSSL_STACK *)sk; \
   55|  13.8k|    } \
cmp_ctx.c:ossl_check_ASN1_UTF8STRING_freefunc_type:
   65|  13.8k|    { \
   66|  13.8k|        return (OPENSSL_sk_freefunc)fr; \
   67|  13.8k|    }
cmp_msg.c:sk_OSSL_CMP_REVDETAILS_new_null:
   96|    109|    { \
   97|    109|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    109|    } \
cmp_msg.c:sk_OSSL_CMP_POLLREQ_new_null:
   96|     70|    { \
   97|     70|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|     70|    } \
cmp_msg.c:ossl_check_const_GENERAL_NAME_sk_type:
   49|    886|    { \
   50|    886|        return (const OPENSSL_STACK *)sk; \
   51|    886|    } \
cmp_msg.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|    303|    { \
   50|    303|        return (const OPENSSL_STACK *)sk; \
   51|    303|    } \
cmp_msg.c:ossl_check_X509_EXTENSION_sk_type:
   53|    303|    { \
   54|    303|        return (OPENSSL_STACK *)sk; \
   55|    303|    } \
cmp_msg.c:ossl_check_X509_EXTENSION_freefunc_type:
   65|    303|    { \
   66|    303|        return (OPENSSL_sk_freefunc)fr; \
   67|    303|    }
cmp_msg.c:ossl_check_GENERAL_NAME_sk_type:
   53|    303|    { \
   54|    303|        return (OPENSSL_STACK *)sk; \
   55|    303|    } \
cmp_msg.c:ossl_check_GENERAL_NAME_freefunc_type:
   65|    303|    { \
   66|    303|        return (OPENSSL_sk_freefunc)fr; \
   67|    303|    }
cmp_msg.c:ossl_check_OSSL_CRMF_MSG_sk_type:
   53|    303|    { \
   54|    303|        return (OPENSSL_STACK *)sk; \
   55|    303|    } \
cmp_msg.c:ossl_check_OSSL_CRMF_MSG_type:
   45|    303|    { \
   46|    303|        return ptr; \
   47|    303|    } \
cmp_msg.c:sk_OSSL_CMP_REVDETAILS_push:
  129|    109|    { \
  130|    109|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    109|    } \
cmp_msg.c:sk_OSSL_CMP_POLLREQ_push:
  129|     70|    { \
  130|     70|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|     70|    } \
cmp_protect.c:ossl_check_const_X509_sk_type:
   49|    708|    { \
   50|    708|        return (const OPENSSL_STACK *)sk; \
   51|    708|    } \
cmp_server.c:ossl_check_const_OSSL_CRMF_MSG_sk_type:
   49|    939|    { \
   50|    939|        return (const OPENSSL_STACK *)sk; \
   51|    939|    } \
cmp_server.c:sk_OSSL_CMP_REVDETAILS_num:
   80|     22|    { \
   81|     22|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     22|    } \
cmp_server.c:sk_OSSL_CMP_REVDETAILS_value:
   84|      4|    { \
   85|      4|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      4|    } \
cmp_server.c:ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type:
   49|    186|    { \
   50|    186|        return (const OPENSSL_STACK *)sk; \
   51|    186|    } \
cmp_status.c:ossl_check_ASN1_UTF8STRING_sk_type:
   53|  6.89k|    { \
   54|  6.89k|        return (OPENSSL_STACK *)sk; \
   55|  6.89k|    } \
cmp_status.c:ossl_check_ASN1_UTF8STRING_type:
   45|  6.89k|    { \
   46|  6.89k|        return ptr; \
   47|  6.89k|    } \
cmp_util.c:ossl_check_ASN1_UTF8STRING_sk_type:
   53|  14.2k|    { \
   54|  14.2k|        return (OPENSSL_STACK *)sk; \
   55|  14.2k|    } \
cmp_util.c:ossl_check_ASN1_UTF8STRING_type:
   45|  14.2k|    { \
   46|  14.2k|        return ptr; \
   47|  14.2k|    } \
cmp_vfy.c:ossl_check_const_X509_sk_type:
   49|  55.6k|    { \
   50|  55.6k|        return (const OPENSSL_STACK *)sk; \
   51|  55.6k|    } \
crmf_lib.c:ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type:
   53|     23|    { \
   54|     23|        return (OPENSSL_STACK *)sk; \
   55|     23|    } \
crmf_lib.c:ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type:
   45|     23|    { \
   46|     23|        return ptr; \
   47|     23|    } \
crmf_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|    303|    { \
   50|    303|        return (const OPENSSL_STACK *)sk; \
   51|    303|    } \
crmf_lib.c:ossl_check_X509_EXTENSION_sk_type:
   53|    303|    { \
   54|    303|        return (OPENSSL_STACK *)sk; \
   55|    303|    } \
crmf_lib.c:ossl_check_X509_EXTENSION_freefunc_type:
   65|    303|    { \
   66|    303|        return (OPENSSL_sk_freefunc)fr; \
   67|    303|    }
crmf_lib.c:ossl_check_const_OSSL_CRMF_MSG_sk_type:
   49|    293|    { \
   50|    293|        return (const OPENSSL_STACK *)sk; \
   51|    293|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  145|  69.7k|    { \
  146|  69.7k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  69.7k|        \
  148|  69.7k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  69.7k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  69.7k|        \
  151|  69.7k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  69.7k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   53|  69.7k|    { \
   54|  69.7k|        return (OPENSSL_STACK *)sk; \
   55|  69.7k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   65|  69.7k|    { \
   66|  69.7k|        return (OPENSSL_sk_freefunc)fr; \
   67|  69.7k|    }
core_namemap.c:sk_NAMES_value:
   84|  19.6k|    { \
   85|  19.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  19.6k|    } \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   49|   166k|    { \
   50|   166k|        return (const OPENSSL_STACK *)sk; \
   51|   166k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   53|  20.0k|    { \
   54|  20.0k|        return (OPENSSL_STACK *)sk; \
   55|  20.0k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   45|    506|    { \
   46|    506|        return ptr; \
   47|    506|    } \
core_namemap.c:sk_NAMES_push:
  129|    201|    { \
  130|    201|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    201|    } \
core_namemap.c:sk_NAMES_num:
   80|    201|    { \
   81|    201|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    201|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    201|    { \
   66|    201|        return (OPENSSL_sk_freefunc)fr; \
   67|    201|    }
core_namemap.c:sk_NAMES_new_null:
   96|      4|    { \
   97|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      4|    } \
core_namemap.c:sk_NAMES_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
core_namemap.c:sk_NAMES_freefunc_thunk:
   75|    201|    { \
   76|    201|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    201|        freefunc((t3 *)ptr);\
   78|    201|    } \
ex_data.c:sk_EX_CALLBACK_pop_free:
  145|     36|    { \
  146|     36|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     36|        \
  148|     36|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     36|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     36|        \
  151|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   80|   874k|    { \
   81|   874k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   874k|    } \
ex_data.c:ossl_check_void_sk_type:
   53|   437k|    { \
   54|   437k|        return (OPENSSL_STACK *)sk; \
   55|   437k|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  129|      2|    { \
  130|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   80|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   84|      2|    { \
   85|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  120|      2|    { \
  121|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  122|      2|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_INFOPAIR_pop_free:
  145|      3|    { \
  146|      3|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      3|        \
  148|      3|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      3|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      3|        \
  151|      3|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_freefunc_thunk:
   75|      3|    { \
   76|      3|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      3|        freefunc((t3 *)ptr);\
   78|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   88|      4|    { \
   89|      4|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      4|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      4|        \
   92|      4|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      4|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   96|      4|    { \
   97|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_sort:
  174|      2|    { \
  175|      2|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_find:
  162|      4|    { \
  163|      4|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
  164|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   84|  10.4k|    { \
   85|  10.4k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  10.4k|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  188|      3|    { \
  189|      3|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|      3|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|      3|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  129|      3|    { \
  130|      3|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  182|  1.73k|    { \
  183|  1.73k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|  1.73k|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   80|  1.73k|    { \
   81|  1.73k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.73k|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
  112|  1.73k|    { \
  113|  1.73k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  1.73k|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   80|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
o_names.c:sk_NAME_FUNCS_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
obj_xref.c:sk_nid_triple_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
obj_xref.c:sk_nid_triple_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
property.c:sk_IMPLEMENTATION_pop_free:
  145|    171|    { \
  146|    171|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    171|        \
  148|    171|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    171|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    171|        \
  151|    171|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    171|    } \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   75|    217|    { \
   76|    217|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    217|        freefunc((t3 *)ptr);\
   78|    217|    } \
property.c:sk_IMPLEMENTATION_new_null:
   96|    171|    { \
   97|    171|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    171|    } \
property.c:sk_IMPLEMENTATION_num:
   80|   130k|    { \
   81|   130k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   130k|    } \
property.c:sk_IMPLEMENTATION_value:
   84|   168k|    { \
   85|   168k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   168k|    } \
property.c:sk_IMPLEMENTATION_push:
  129|    217|    { \
  130|    217|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    217|    } \
property.c:sk_ALGORITHM_new_reserve:
  100|  1.63k|    { \
  101|  1.63k|        OPENSSL_STACK *ret = OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
  102|  1.63k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  103|  1.63k|        \
  104|  1.63k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  105|  1.63k|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
  106|  1.63k|    } \
property.c:sk_ALGORITHM_push:
  129|   129k|    { \
  130|   129k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|   129k|    } \
property.c:sk_ALGORITHM_num:
   80|  1.63k|    { \
   81|  1.63k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.63k|    } \
property.c:sk_ALGORITHM_value:
   84|   129k|    { \
   85|   129k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   129k|    } \
property.c:sk_ALGORITHM_free:
  112|  1.63k|    { \
  113|  1.63k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  1.63k|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   88|    116|    { \
   89|    116|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|    116|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|    116|        \
   92|    116|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|    116|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|    116|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   75|    358|    { \
   76|    358|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    358|        freefunc((t3 *)ptr);\
   78|    358|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  129|    358|    { \
  130|    358|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    358|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   80|    116|    { \
   81|    116|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    116|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  174|    116|    { \
  175|    116|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|    116|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   84|    358|    { \
   85|    358|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|    358|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  145|    116|    { \
  146|    116|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    116|        \
  148|    116|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    116|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    116|        \
  151|    116|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    116|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|     51|    { \
   54|     51|        return (OPENSSL_STACK *)sk; \
   55|     51|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   45|     47|    { \
   46|     47|        return ptr; \
   47|     47|    } \
property_string.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   49|    241|    { \
   50|    241|        return (const OPENSSL_STACK *)sk; \
   51|    241|    } \
rsa_backend.c:sk_BIGNUM_const_new_null:
   96|  19.8k|    { \
   97|  19.8k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|  19.8k|    } \
rsa_backend.c:sk_BIGNUM_const_free:
  112|  19.8k|    { \
  113|  19.8k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  19.8k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_pop_free:
  145|  9.12k|    { \
  146|  9.12k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  9.12k|        \
  148|  9.12k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  9.12k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  9.12k|        \
  151|  9.12k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  9.12k|    } \
rsa_lib.c:sk_BIGNUM_const_new_null:
   96|  19.8k|    { \
   97|  19.8k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|  19.8k|    } \
rsa_lib.c:sk_BIGNUM_const_num:
   80|  19.8k|    { \
   81|  19.8k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  19.8k|    } \
rsa_lib.c:sk_BIGNUM_const_free:
  112|  19.8k|    { \
  113|  19.8k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  19.8k|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_num:
   80|  9.12k|    { \
   81|  9.12k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  9.12k|    } \
t_x509.c:ossl_check_X509_sk_type:
   53|  85.1k|    { \
   54|  85.1k|        return (OPENSSL_STACK *)sk; \
   55|  85.1k|    } \
t_x509.c:ossl_check_X509_freefunc_type:
   65|  85.1k|    { \
   66|  85.1k|        return (OPENSSL_sk_freefunc)fr; \
   67|  85.1k|    }
v3_cpols.c:ossl_check_const_POLICYINFO_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \
v3_crld.c:ossl_check_const_DIST_POINT_sk_type:
   49|    392|    { \
   50|    392|        return (const OPENSSL_STACK *)sk; \
   51|    392|    } \
v3_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|   150k|    { \
   50|   150k|        return (const OPENSSL_STACK *)sk; \
   51|   150k|    } \
v3_ncons.c:ossl_check_const_GENERAL_SUBTREE_sk_type:
   49|     56|    { \
   50|     56|        return (const OPENSSL_STACK *)sk; \
   51|     56|    } \
v3_pmaps.c:ossl_check_const_POLICY_MAPPING_sk_type:
   49|     13|    { \
   50|     13|        return (const OPENSSL_STACK *)sk; \
   51|     13|    } \
v3_prn.c:ossl_check_const_CONF_VALUE_sk_type:
   49|  4.75k|    { \
   50|  4.75k|        return (const OPENSSL_STACK *)sk; \
   51|  4.75k|    } \
v3_prn.c:ossl_check_CONF_VALUE_sk_type:
   53|  1.96k|    { \
   54|  1.96k|        return (OPENSSL_STACK *)sk; \
   55|  1.96k|    } \
v3_prn.c:ossl_check_CONF_VALUE_freefunc_type:
   65|  1.96k|    { \
   66|  1.96k|        return (OPENSSL_sk_freefunc)fr; \
   67|  1.96k|    }
v3_prn.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|  8.79k|    { \
   50|  8.79k|        return (const OPENSSL_STACK *)sk; \
   51|  8.79k|    } \
v3_purp.c:ossl_check_const_ASN1_OBJECT_sk_type:
   49|     50|    { \
   50|     50|        return (const OPENSSL_STACK *)sk; \
   51|     50|    } \
v3_purp.c:ossl_check_ASN1_OBJECT_sk_type:
   53|     12|    { \
   54|     12|        return (OPENSSL_STACK *)sk; \
   55|     12|    } \
v3_purp.c:ossl_check_ASN1_OBJECT_freefunc_type:
   65|     12|    { \
   66|     12|        return (OPENSSL_sk_freefunc)fr; \
   67|     12|    }
v3_purp.c:ossl_check_const_DIST_POINT_sk_type:
   49|  1.49k|    { \
   50|  1.49k|        return (const OPENSSL_STACK *)sk; \
   51|  1.49k|    } \
v3_purp.c:ossl_check_const_GENERAL_NAME_sk_type:
   49|      2|    { \
   50|      2|        return (const OPENSSL_STACK *)sk; \
   51|      2|    } \
v3_rolespec.c:ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type:
   49|      7|    { \
   50|      7|        return (const OPENSSL_STACK *)sk; \
   51|      7|    } \
v3_san.c:ossl_check_const_GENERAL_NAME_sk_type:
   49|  1.61k|    { \
   50|  1.61k|        return (const OPENSSL_STACK *)sk; \
   51|  1.61k|    } \
v3_san.c:ossl_check_CONF_VALUE_sk_type:
   53|     35|    { \
   54|     35|        return (OPENSSL_STACK *)sk; \
   55|     35|    } \
v3_san.c:ossl_check_CONF_VALUE_freefunc_type:
   65|     35|    { \
   66|     35|        return (OPENSSL_sk_freefunc)fr; \
   67|     35|    }
v3_sda.c:ossl_check_const_X509_ATTRIBUTE_sk_type:
   49|     11|    { \
   50|     11|        return (const OPENSSL_STACK *)sk; \
   51|     11|    } \
v3_timespec.c:ossl_check_const_OSSL_TIME_PERIOD_sk_type:
   49|     21|    { \
   50|     21|        return (const OPENSSL_STACK *)sk; \
   51|     21|    } \
v3_tlsf.c:ossl_check_const_ASN1_INTEGER_sk_type:
   49|      3|    { \
   50|      3|        return (const OPENSSL_STACK *)sk; \
   51|      3|    } \
v3_usernotice.c:ossl_check_const_USERNOTICE_sk_type:
   49|     62|    { \
   50|     62|        return (const OPENSSL_STACK *)sk; \
   51|     62|    } \
v3_utl.c:ossl_check_CONF_VALUE_type:
   45|  1.66k|    { \
   46|  1.66k|        return ptr; \
   47|  1.66k|    } \
v3_utl.c:ossl_check_CONF_VALUE_sk_type:
   53|  1.70k|    { \
   54|  1.70k|        return (OPENSSL_STACK *)sk; \
   55|  1.70k|    } \
v3_utl.c:ossl_check_const_GENERAL_NAME_sk_type:
   49|    351|    { \
   50|    351|        return (const OPENSSL_STACK *)sk; \
   51|    351|    } \
x509_cmp.c:ossl_check_const_X509_sk_type:
   49|  18.0k|    { \
   50|  18.0k|        return (const OPENSSL_STACK *)sk; \
   51|  18.0k|    } \
x509_cmp.c:ossl_check_X509_sk_type:
   53|  1.85k|    { \
   54|  1.85k|        return (OPENSSL_STACK *)sk; \
   55|  1.85k|    } \
x509_cmp.c:ossl_check_X509_type:
   45|  1.85k|    { \
   46|  1.85k|        return ptr; \
   47|  1.85k|    } \
x509_obj.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|   178k|    { \
   50|   178k|        return (const OPENSSL_STACK *)sk; \
   51|   178k|    } \
x509_v3.c:ossl_check_const_X509_EXTENSION_sk_type:
   49|  15.3k|    { \
   50|  15.3k|        return (const OPENSSL_STACK *)sk; \
   51|  15.3k|    } \
x509name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|  10.0k|    { \
   50|  10.0k|        return (const OPENSSL_STACK *)sk; \
   51|  10.0k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_sk_type:
   53|      8|    { \
   54|      8|        return (OPENSSL_STACK *)sk; \
   55|      8|    } \
x_crl.c:ossl_check_GENERAL_NAMES_freefunc_type:
   65|      8|    { \
   66|      8|        return (OPENSSL_sk_freefunc)fr; \
   67|      8|    }
x_name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   53|  2.89M|    { \
   54|  2.89M|        return (OPENSSL_STACK *)sk; \
   55|  2.89M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_freefunc_type:
   65|  91.4k|    { \
   66|  91.4k|        return (OPENSSL_sk_freefunc)fr; \
   67|  91.4k|    }
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_num:
   80|  2.39M|    { \
   81|  2.39M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  2.39M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_value:
   84|  2.36M|    { \
   85|  2.36M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  2.36M|    } \
x_name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   49|  2.99M|    { \
   50|  2.99M|        return (const OPENSSL_STACK *)sk; \
   51|  2.99M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_type:
   45|   437k|    { \
   46|   437k|        return ptr; \
   47|   437k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_new_null:
   96|  21.0k|    { \
   97|  21.0k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|  21.0k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_push:
  129|  23.2k|    { \
  130|  23.2k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  23.2k|    } \
x_name.c:ossl_check_const_ASN1_VALUE_sk_type:
   49|   119k|    { \
   50|   119k|        return (const OPENSSL_STACK *)sk; \
   51|   119k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_pop_free:
  145|  51.2k|    { \
  146|  51.2k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  51.2k|        \
  148|  51.2k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  51.2k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  51.2k|        \
  151|  51.2k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  51.2k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_freefunc_thunk:
   75|  2.38M|    { \
   76|  2.38M|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  2.38M|        freefunc((t3 *)ptr);\
   78|  2.38M|    } \
x_x509.c:ossl_check_IPAddressFamily_sk_type:
   53|  9.90k|    { \
   54|  9.90k|        return (OPENSSL_STACK *)sk; \
   55|  9.90k|    } \
x_x509.c:ossl_check_IPAddressFamily_freefunc_type:
   65|  9.90k|    { \
   66|  9.90k|        return (OPENSSL_sk_freefunc)fr; \
   67|  9.90k|    }
tasn_dec.c:ossl_check_const_ASN1_VALUE_sk_type:
   49|  3.69k|    { \
   50|  3.69k|        return (const OPENSSL_STACK *)sk; \
   51|  3.69k|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_sk_type:
   53|  3.55M|    { \
   54|  3.55M|        return (OPENSSL_STACK *)sk; \
   55|  3.55M|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_type:
   45|  3.55M|    { \
   46|  3.55M|        return ptr; \
   47|  3.55M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_num:
   80|  1.32M|    { \
   81|  1.32M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.32M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_value:
   84|   952k|    { \
   85|   952k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   952k|    } \
tasn_fre.c:ossl_check_const_ASN1_VALUE_sk_type:
   49|  3.51M|    { \
   50|  3.51M|        return (const OPENSSL_STACK *)sk; \
   51|  3.51M|    } \
tasn_fre.c:ossl_check_ASN1_VALUE_sk_type:
   53|  1.38M|    { \
   54|  1.38M|        return (OPENSSL_STACK *)sk; \
   55|  1.38M|    } \
conf_mod.c:sk_CONF_IMODULE_free:
  112|      4|    { \
  113|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      4|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  182|      2|    { \
  183|      2|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      2|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
conf_mod.c:sk_CONF_MODULE_num:
   80|      4|    { \
   81|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
  112|      6|    { \
  113|      6|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      6|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   80|      2|    { \
   81|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      2|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_new_null:
   96|     28|    { \
   97|     28|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|     28|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_push:
  129|    117|    { \
  130|    117|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    117|    } \
decoder_lib.c:sk_OSSL_DECODER_new_null:
   96|     28|    { \
   97|     28|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|     28|    } \
decoder_lib.c:sk_OSSL_DECODER_push:
  129|  2.12k|    { \
  130|  2.12k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|  2.12k|    } \
decoder_lib.c:sk_OSSL_DECODER_num:
   80|     28|    { \
   81|     28|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     28|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_num:
   80|   113k|    { \
   81|   113k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|   113k|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_value:
   84|   350k|    { \
   85|   350k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|   350k|    } \
decoder_lib.c:sk_OSSL_DECODER_value:
   84|  17.7k|    { \
   85|  17.7k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  17.7k|    } \
decoder_lib.c:sk_OSSL_DECODER_pop_free:
  145|     28|    { \
  146|     28|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     28|        \
  148|     28|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     28|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     28|        \
  151|     28|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     28|    } \
decoder_lib.c:sk_OSSL_DECODER_freefunc_thunk:
   75|  2.12k|    { \
   76|  2.12k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  2.12k|        freefunc((t3 *)ptr);\
   78|  2.12k|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_pop_free:
  145|  62.3k|    { \
  146|  62.3k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  62.3k|        \
  148|  62.3k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  62.3k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  62.3k|        \
  151|  62.3k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  62.3k|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_freefunc_thunk:
   75|   274k|    { \
   76|   274k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|   274k|        freefunc((t3 *)ptr);\
   78|   274k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_new_null:
   96|    803|    { \
   97|    803|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    803|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_push:
  129|     29|    { \
  130|     29|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|     29|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_num:
   80|  49.7k|    { \
   81|  49.7k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  49.7k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_value:
   84|  21.3k|    { \
   85|  21.3k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  21.3k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_pop_free:
  145|  57.6k|    { \
  146|  57.6k|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|  57.6k|        \
  148|  57.6k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|  57.6k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|  57.6k|        \
  151|  57.6k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|  57.6k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_freefunc_thunk:
   75|  89.6k|    { \
   76|  89.6k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|  89.6k|        freefunc((t3 *)ptr);\
   78|  89.6k|    } \
decoder_pkey.c:sk_OSSL_DECODER_INSTANCE_deep_copy:
  188|  56.8k|    { \
  189|  56.8k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|  56.8k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|  56.8k|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|  56.8k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_deep_copy:
  188|  56.8k|    { \
  189|  56.8k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|  56.8k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|  56.8k|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|  56.8k|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   57|      4|    { \
   58|      4|        return (OPENSSL_sk_compfunc)cmp; \
   59|      4|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   53|      2|    { \
   54|      2|        return (OPENSSL_STACK *)sk; \
   55|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   65|      2|    { \
   66|      2|        return (OPENSSL_sk_freefunc)fr; \
   67|      2|    }
v3_aaa.c:ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type:
   49|      5|    { \
   50|      5|        return (const OPENSSL_STACK *)sk; \
   51|      5|    } \
v3_ac_tgt.c:ossl_check_const_OSSL_TARGETS_sk_type:
   49|     49|    { \
   50|     49|        return (const OPENSSL_STACK *)sk; \
   51|     49|    } \
v3_ac_tgt.c:ossl_check_const_OSSL_TARGET_sk_type:
   49|     33|    { \
   50|     33|        return (const OPENSSL_STACK *)sk; \
   51|     33|    } \
v3_addr.c:ossl_check_const_IPAddressFamily_sk_type:
   49|      3|    { \
   50|      3|        return (const OPENSSL_STACK *)sk; \
   51|      3|    } \
v3_attrmap.c:ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type:
   49|      5|    { \
   50|      5|        return (const OPENSSL_STACK *)sk; \
   51|      5|    } \
v3_authattid.c:ossl_check_const_OSSL_ISSUER_SERIAL_sk_type:
   49|      7|    { \
   50|      7|        return (const OPENSSL_STACK *)sk; \
   51|      7|    } \
v3_extku.c:ossl_check_const_ASN1_OBJECT_sk_type:
   49|     27|    { \
   50|     27|        return (const OPENSSL_STACK *)sk; \
   51|     27|    } \
v3_info.c:ossl_check_const_ACCESS_DESCRIPTION_sk_type:
   49|    200|    { \
   50|    200|        return (const OPENSSL_STACK *)sk; \
   51|    200|    } \
v3_info.c:ossl_check_const_CONF_VALUE_sk_type:
   49|     51|    { \
   50|     51|        return (const OPENSSL_STACK *)sk; \
   51|     51|    } \

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

ossl_DER_w_algorithmIdentifier_ECDSA_with_MD:
   29|    160|{
   30|    160|    const unsigned char *precompiled = NULL;
   31|    160|    size_t precompiled_sz = 0;
   32|       |
   33|    160|    switch (mdnid) {
   34|      1|        MD_CASE(sha1);
  ------------------
  |  |   22|      1|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 1, False: 159]
  |  |  ------------------
  |  |   23|      1|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|      1|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|      1|        break;
  ------------------
   35|     12|        MD_CASE(sha224);
  ------------------
  |  |   22|     12|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 12, False: 148]
  |  |  ------------------
  |  |   23|     12|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|     12|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|     12|        break;
  ------------------
   36|     12|        MD_CASE(sha256);
  ------------------
  |  |   22|     12|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 12, False: 148]
  |  |  ------------------
  |  |   23|     12|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|     12|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|     12|        break;
  ------------------
   37|     90|        MD_CASE(sha384);
  ------------------
  |  |   22|     90|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 90, False: 70]
  |  |  ------------------
  |  |   23|     90|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|     90|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|     90|        break;
  ------------------
   38|     45|        MD_CASE(sha512);
  ------------------
  |  |   22|     45|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 45, False: 115]
  |  |  ------------------
  |  |   23|     45|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|     45|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|     45|        break;
  ------------------
   39|      0|        MD_CASE(sha3_224);
  ------------------
  |  |   22|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 0, False: 160]
  |  |  ------------------
  |  |   23|      0|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|      0|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|      0|        break;
  ------------------
   40|      0|        MD_CASE(sha3_256);
  ------------------
  |  |   22|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 0, False: 160]
  |  |  ------------------
  |  |   23|      0|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|      0|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|      0|        break;
  ------------------
   41|      0|        MD_CASE(sha3_384);
  ------------------
  |  |   22|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 0, False: 160]
  |  |  ------------------
  |  |   23|      0|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|      0|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|      0|        break;
  ------------------
   42|      0|        MD_CASE(sha3_512);
  ------------------
  |  |   22|      0|    case NID_##name:                                                    \
  |  |  ------------------
  |  |  |  Branch (22:5): [True: 0, False: 160]
  |  |  ------------------
  |  |   23|      0|        precompiled = ossl_der_oid_id_ecdsa_with_##name;                \
  |  |   24|      0|        precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name);     \
  |  |   25|      0|        break;
  ------------------
   43|      0|    default:
  ------------------
  |  Branch (43:5): [True: 0, False: 160]
  ------------------
   44|      0|        return 0;
   45|    160|    }
   46|       |
   47|    160|    return ossl_DER_w_begin_sequence(pkt, cont)
  ------------------
  |  Branch (47:12): [True: 160, False: 0]
  ------------------
   48|       |        /* No parameters (yet?) */
   49|    160|        && ossl_DER_w_precompiled(pkt, -1, precompiled, precompiled_sz)
  ------------------
  |  Branch (49:12): [True: 160, False: 0]
  ------------------
   50|    160|        && ossl_DER_w_end_sequence(pkt, cont);
  ------------------
  |  Branch (50:12): [True: 160, False: 0]
  ------------------
   51|    160|}

ossl_digest_md_to_nid:
   24|  1.52k|{
   25|  1.52k|    size_t i;
   26|       |
   27|  1.52k|    if (md == NULL)
  ------------------
  |  Branch (27:9): [True: 0, False: 1.52k]
  ------------------
   28|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
   29|       |
   30|  3.20k|    for (i = 0; i < it_len; i++)
  ------------------
  |  Branch (30:17): [True: 3.16k, False: 36]
  ------------------
   31|  3.16k|        if (EVP_MD_is_a(md, it[i].ptr))
  ------------------
  |  Branch (31:13): [True: 1.49k, False: 1.67k]
  ------------------
   32|  1.49k|            return (int)it[i].id;
   33|     36|    return NID_undef;
  ------------------
  |  |   18|     36|#define NID_undef                       0
  ------------------
   34|  1.52k|}
ossl_digest_get_approved_nid:
   41|  1.49k|{
   42|       |    /* TODO: FIPS 180-5 RFC 8692 RFC 8702 allow SHAKE */
   43|  1.49k|    static const OSSL_ITEM name_to_nid[] = {
   44|  1.49k|        { NID_sha1,      OSSL_DIGEST_NAME_SHA1      },
  ------------------
  |  | 2321|  1.49k|#define NID_sha1                64
  ------------------
                      { NID_sha1,      OSSL_DIGEST_NAME_SHA1      },
  ------------------
  |  |   35|  1.49k|# define OSSL_DIGEST_NAME_SHA1           "SHA1"
  ------------------
   45|  1.49k|        { NID_sha224,    OSSL_DIGEST_NAME_SHA2_224  },
  ------------------
  |  | 3279|  1.49k|#define NID_sha224              675
  ------------------
                      { NID_sha224,    OSSL_DIGEST_NAME_SHA2_224  },
  ------------------
  |  |   36|  1.49k|# define OSSL_DIGEST_NAME_SHA2_224       "SHA2-224"
  ------------------
   46|  1.49k|        { NID_sha256,    OSSL_DIGEST_NAME_SHA2_256  },
  ------------------
  |  | 3264|  1.49k|#define NID_sha256              672
  ------------------
                      { NID_sha256,    OSSL_DIGEST_NAME_SHA2_256  },
  ------------------
  |  |   37|  1.49k|# define OSSL_DIGEST_NAME_SHA2_256       "SHA2-256"
  ------------------
   47|  1.49k|        { NID_sha384,    OSSL_DIGEST_NAME_SHA2_384  },
  ------------------
  |  | 3269|  1.49k|#define NID_sha384              673
  ------------------
                      { NID_sha384,    OSSL_DIGEST_NAME_SHA2_384  },
  ------------------
  |  |   39|  1.49k|# define OSSL_DIGEST_NAME_SHA2_384       "SHA2-384"
  ------------------
   48|  1.49k|        { NID_sha512,    OSSL_DIGEST_NAME_SHA2_512  },
  ------------------
  |  | 3274|  1.49k|#define NID_sha512              674
  ------------------
                      { NID_sha512,    OSSL_DIGEST_NAME_SHA2_512  },
  ------------------
  |  |   40|  1.49k|# define OSSL_DIGEST_NAME_SHA2_512       "SHA2-512"
  ------------------
   49|  1.49k|        { NID_sha512_224, OSSL_DIGEST_NAME_SHA2_512_224 },
  ------------------
  |  | 3284|  1.49k|#define NID_sha512_224          1094
  ------------------
                      { NID_sha512_224, OSSL_DIGEST_NAME_SHA2_512_224 },
  ------------------
  |  |   41|  1.49k|# define OSSL_DIGEST_NAME_SHA2_512_224   "SHA2-512/224"
  ------------------
   50|  1.49k|        { NID_sha512_256, OSSL_DIGEST_NAME_SHA2_512_256 },
  ------------------
  |  | 3289|  1.49k|#define NID_sha512_256          1095
  ------------------
                      { NID_sha512_256, OSSL_DIGEST_NAME_SHA2_512_256 },
  ------------------
  |  |   42|  1.49k|# define OSSL_DIGEST_NAME_SHA2_512_256   "SHA2-512/256"
  ------------------
   51|  1.49k|        { NID_sha3_224,  OSSL_DIGEST_NAME_SHA3_224  },
  ------------------
  |  | 3294|  1.49k|#define NID_sha3_224            1096
  ------------------
                      { NID_sha3_224,  OSSL_DIGEST_NAME_SHA3_224  },
  ------------------
  |  |   47|  1.49k|# define OSSL_DIGEST_NAME_SHA3_224       "SHA3-224"
  ------------------
   52|  1.49k|        { NID_sha3_256,  OSSL_DIGEST_NAME_SHA3_256  },
  ------------------
  |  | 3299|  1.49k|#define NID_sha3_256            1097
  ------------------
                      { NID_sha3_256,  OSSL_DIGEST_NAME_SHA3_256  },
  ------------------
  |  |   48|  1.49k|# define OSSL_DIGEST_NAME_SHA3_256       "SHA3-256"
  ------------------
   53|  1.49k|        { NID_sha3_384,  OSSL_DIGEST_NAME_SHA3_384  },
  ------------------
  |  | 3304|  1.49k|#define NID_sha3_384            1098
  ------------------
                      { NID_sha3_384,  OSSL_DIGEST_NAME_SHA3_384  },
  ------------------
  |  |   49|  1.49k|# define OSSL_DIGEST_NAME_SHA3_384       "SHA3-384"
  ------------------
   54|  1.49k|        { NID_sha3_512,  OSSL_DIGEST_NAME_SHA3_512  },
  ------------------
  |  | 3309|  1.49k|#define NID_sha3_512            1099
  ------------------
                      { NID_sha3_512,  OSSL_DIGEST_NAME_SHA3_512  },
  ------------------
  |  |   50|  1.49k|# define OSSL_DIGEST_NAME_SHA3_512       "SHA3-512"
  ------------------
   55|  1.49k|    };
   56|       |
   57|  1.49k|    return ossl_digest_md_to_nid(md, name_to_nid, OSSL_NELEM(name_to_nid));
  ------------------
  |  |   14|  1.49k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   58|  1.49k|}

provider_util.c:ossl_param_is_empty:
   30|     68|{
   31|     68|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 68]
  |  Branch (31:30): [True: 0, False: 68]
  ------------------
   32|     68|}
sha2_prov.c:ossl_param_is_empty:
   30|   231k|{
   31|   231k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 231k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|   231k|}
sha3_prov.c:ossl_param_is_empty:
   30|      6|{
   31|      6|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 3, False: 3]
  |  Branch (31:30): [True: 0, False: 3]
  ------------------
   32|      6|}
hmac_prov.c:ossl_param_is_empty:
   30|    188|{
   31|    188|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 120, False: 68]
  |  Branch (31:30): [True: 0, False: 68]
  ------------------
   32|    188|}
ecdsa_sig.c:ossl_param_is_empty:
   30|    320|{
   31|    320|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 160, False: 160]
  |  Branch (31:30): [True: 0, False: 160]
  ------------------
   32|    320|}
rsa_sig.c:ossl_param_is_empty:
   30|  3.11k|{
   31|  3.11k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 819, False: 2.29k]
  |  Branch (31:30): [True: 0, False: 2.29k]
  ------------------
   32|  3.11k|}

ossl_prov_ctx_new:
   16|      1|{
   17|      1|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   18|      1|}
ossl_prov_ctx_free:
   21|      1|{
   22|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   23|      1|}
ossl_prov_ctx_set0_libctx:
   26|      1|{
   27|      1|    if (ctx != NULL)
  ------------------
  |  Branch (27:9): [True: 1, False: 0]
  ------------------
   28|      1|        ctx->libctx = libctx;
   29|      1|}
ossl_prov_ctx_set0_handle:
   32|      1|{
   33|      1|    if (ctx != NULL)
  ------------------
  |  Branch (33:9): [True: 1, False: 0]
  ------------------
   34|      1|        ctx->handle = handle;
   35|      1|}
ossl_prov_ctx_set0_core_bio_method:
   38|      1|{
   39|      1|    if (ctx != NULL)
  ------------------
  |  Branch (39:9): [True: 1, False: 0]
  ------------------
   40|      1|        ctx->corebiometh = corebiometh;
   41|      1|}
ossl_prov_ctx_set0_core_get_params:
   46|      1|{
   47|      1|    if (ctx != NULL)
  ------------------
  |  Branch (47:9): [True: 1, False: 0]
  ------------------
   48|      1|        ctx->core_get_params = c_get_params;
   49|      1|}
ossl_prov_ctx_get0_libctx:
   52|  83.5k|{
   53|  83.5k|    if (ctx == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 83.5k]
  ------------------
   54|      0|        return NULL;
   55|  83.5k|    return ctx->libctx;
   56|  83.5k|}
ossl_prov_ctx_get0_core_bio_method:
   66|   113k|{
   67|   113k|    if (ctx == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 113k]
  ------------------
   68|      0|        return NULL;
   69|   113k|    return ctx->corebiometh;
   70|   113k|}

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

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

ossl_prov_digest_reset:
  141|     68|{
  142|     68|    EVP_MD_free(pd->alloc_md);
  143|     68|    pd->alloc_md = NULL;
  144|     68|    pd->md = NULL;
  145|     68|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  146|     68|    ENGINE_finish(pd->engine);
  147|     68|#endif
  148|     68|    pd->engine = NULL;
  149|     68|}
ossl_prov_digest_fetch:
  169|     68|{
  170|     68|    EVP_MD_free(pd->alloc_md);
  171|     68|    pd->md = pd->alloc_md = EVP_MD_fetch(libctx, mdname, propquery);
  172|       |
  173|     68|    return pd->md;
  174|     68|}
ossl_prov_digest_load_from_params:
  179|     68|{
  180|     68|    const OSSL_PARAM *p;
  181|     68|    const char *propquery;
  182|       |
  183|     68|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (183:9): [True: 0, False: 68]
  ------------------
  184|      0|        return 1;
  185|       |
  186|     68|    if (!load_common(params, &propquery, &pd->engine))
  ------------------
  |  Branch (186:9): [True: 0, False: 68]
  ------------------
  187|      0|        return 0;
  188|       |
  189|     68|    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
  ------------------
  |  |  122|     68|# define OSSL_ALG_PARAM_DIGEST "digest"
  ------------------
  190|     68|    if (p == NULL)
  ------------------
  |  Branch (190:9): [True: 0, False: 68]
  ------------------
  191|      0|        return 1;
  192|     68|    if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|     68|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (192:9): [True: 0, False: 68]
  ------------------
  193|      0|        return 0;
  194|       |
  195|     68|    ERR_set_mark();
  196|     68|    ossl_prov_digest_fetch(pd, ctx, p->data, propquery);
  197|     68|#ifndef FIPS_MODULE /* Inside the FIPS module, we don't support legacy digests */
  198|     68|    if (pd->md == NULL) {
  ------------------
  |  Branch (198:9): [True: 8, False: 60]
  ------------------
  199|      8|        const EVP_MD *md;
  200|       |
  201|      8|        md = EVP_get_digestbyname(p->data);
  202|       |        /* Do not use global EVP_MDs */
  203|      8|        if (md != NULL && md->origin != EVP_ORIG_GLOBAL)
  ------------------
  |  |  253|      0|#define EVP_ORIG_GLOBAL     1
  ------------------
  |  Branch (203:13): [True: 0, False: 8]
  |  Branch (203:27): [True: 0, False: 0]
  ------------------
  204|      0|            pd->md = md;
  205|      8|    }
  206|     68|#endif
  207|     68|    if (pd->md != NULL)
  ------------------
  |  Branch (207:9): [True: 60, False: 8]
  ------------------
  208|     60|        ERR_pop_to_mark();
  209|      8|    else
  210|      8|        ERR_clear_last_mark();
  211|     68|    return pd->md != NULL;
  212|     68|}
ossl_prov_digest_md:
  221|     60|{
  222|     60|    return pd->md;
  223|     60|}
ossl_prov_digest_engine:
  226|     60|{
  227|     60|    return pd->engine;
  228|     60|}
ossl_prov_cache_exported_algorithms:
  349|      1|{
  350|      1|    int i, j;
  351|       |
  352|      1|    if (out[0].algorithm_names == NULL) {
  ------------------
  |  Branch (352:9): [True: 1, False: 0]
  ------------------
  353|    140|        for (i = j = 0; in[i].alg.algorithm_names != NULL; ++i) {
  ------------------
  |  Branch (353:25): [True: 139, False: 1]
  ------------------
  354|    139|            if (in[i].capable == NULL || in[i].capable())
  ------------------
  |  Branch (354:17): [True: 126, False: 13]
  |  Branch (354:42): [True: 4, False: 9]
  ------------------
  355|    130|                out[j++] = in[i].alg;
  356|    139|        }
  357|      1|        out[j++] = in[i].alg;
  358|      1|    }
  359|      1|}
provider_util.c:load_common:
   53|     68|{
   54|     68|    const OSSL_PARAM *p;
   55|       |
   56|     68|    *propquery = NULL;
   57|     68|    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_PROPERTIES);
  ------------------
  |  |  126|     68|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  ------------------
   58|     68|    if (p != NULL) {
  ------------------
  |  Branch (58:9): [True: 0, False: 68]
  ------------------
   59|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (59:13): [True: 0, False: 0]
  ------------------
   60|      0|            return 0;
   61|      0|        *propquery = p->data;
   62|      0|    }
   63|       |
   64|     68|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   65|     68|    ENGINE_finish(*engine);
   66|     68|#endif
   67|     68|    *engine = NULL;
   68|       |    /* Inside the FIPS module, we don't support legacy ciphers */
   69|     68|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   70|     68|    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_ENGINE);
  ------------------
  |  |  123|     68|# define OSSL_ALG_PARAM_ENGINE "engine"
  ------------------
   71|     68|    if (p != NULL) {
  ------------------
  |  Branch (71:9): [True: 0, False: 68]
  ------------------
   72|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (72:13): [True: 0, False: 0]
  ------------------
   73|      0|            return 0;
   74|       |        /* Get a structural reference */
   75|      0|        *engine = ENGINE_by_id(p->data);
   76|      0|        if (*engine == NULL)
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            return 0;
   78|       |        /* Get a functional reference */
   79|      0|        if (!ENGINE_init(*engine)) {
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|            ENGINE_free(*engine);
   81|      0|            *engine = NULL;
   82|      0|            return 0;
   83|      0|        }
   84|       |        /* Free the structural reference */
   85|      0|        ENGINE_free(*engine);
   86|      0|    }
   87|     68|#endif
   88|     68|    return 1;
   89|     68|}

ossl_rsa_key_op_get_protect:
   26|    822|{
   27|    822|    int protect = 0;
   28|       |
   29|    822|    switch (operation) {
   30|      0|    case EVP_PKEY_OP_SIGN:
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (30:5): [True: 0, False: 822]
  ------------------
   31|      0|    case EVP_PKEY_OP_SIGNMSG:
  ------------------
  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  |  Branch (31:5): [True: 0, False: 822]
  ------------------
   32|      0|        protect = 1;
   33|       |        /* fallthrough */
   34|      0|    case EVP_PKEY_OP_VERIFY:
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (34:5): [True: 0, False: 822]
  ------------------
   35|    822|    case EVP_PKEY_OP_VERIFYMSG:
  ------------------
  |  | 1759|    822|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (35:5): [True: 822, False: 0]
  ------------------
   36|    822|        break;
   37|      0|    case EVP_PKEY_OP_ENCAPSULATE:
  ------------------
  |  | 1756|      0|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  ------------------
  |  Branch (37:5): [True: 0, False: 822]
  ------------------
   38|      0|    case EVP_PKEY_OP_ENCRYPT:
  ------------------
  |  | 1753|      0|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  ------------------
  |  Branch (38:5): [True: 0, False: 822]
  ------------------
   39|      0|        protect = 1;
   40|       |        /* fallthrough */
   41|      0|    case EVP_PKEY_OP_VERIFYRECOVER:
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (41:5): [True: 0, False: 822]
  ------------------
   42|      0|    case EVP_PKEY_OP_DECAPSULATE:
  ------------------
  |  | 1757|      0|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  ------------------
  |  Branch (42:5): [True: 0, False: 822]
  ------------------
   43|      0|    case EVP_PKEY_OP_DECRYPT:
  ------------------
  |  | 1754|      0|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  ------------------
  |  Branch (43:5): [True: 0, False: 822]
  ------------------
   44|      0|        if (RSA_test_flags(rsa,
  ------------------
  |  Branch (44:13): [True: 0, False: 0]
  ------------------
   45|      0|                           RSA_FLAG_TYPE_MASK) == RSA_FLAG_TYPE_RSASSAPSS) {
  ------------------
  |  |  117|      0|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
                                         RSA_FLAG_TYPE_MASK) == RSA_FLAG_TYPE_RSASSAPSS) {
  ------------------
  |  |  119|      0|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
   46|      0|            ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
   47|      0|                           PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE,
  ------------------
  |  |  127|      0|# define PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE  178
  ------------------
   48|      0|                           "operation: %d", operation);
   49|      0|            return 0;
   50|      0|        }
   51|      0|        break;
   52|      0|    default:
  ------------------
  |  Branch (52:5): [True: 0, False: 822]
  ------------------
   53|      0|        ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, 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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|      0|                       "invalid operation: %d", operation);
   55|      0|        return 0;
   56|    822|    }
   57|    822|    *outprotect = protect;
   58|    822|    return 1;
   59|    822|}

ossl_digest_rsa_sign_get_md_nid:
   26|  1.33k|{
   27|  1.33k|    int mdnid;
   28|       |
   29|  1.33k|    static const OSSL_ITEM name_to_nid[] = {
   30|  1.33k|        { NID_md5,       OSSL_DIGEST_NAME_MD5       },
  ------------------
  |  | 1215|  1.33k|#define NID_md5         4
  ------------------
                      { NID_md5,       OSSL_DIGEST_NAME_MD5       },
  ------------------
  |  |   33|  1.33k|# define OSSL_DIGEST_NAME_MD5            "MD5"
  ------------------
   31|  1.33k|        { NID_md5_sha1,  OSSL_DIGEST_NAME_MD5_SHA1  },
  ------------------
  |  | 1220|  1.33k|#define NID_md5_sha1            114
  ------------------
                      { NID_md5_sha1,  OSSL_DIGEST_NAME_MD5_SHA1  },
  ------------------
  |  |   34|  1.33k|# define OSSL_DIGEST_NAME_MD5_SHA1       "MD5-SHA1"
  ------------------
   32|  1.33k|        { NID_md2,       OSSL_DIGEST_NAME_MD2       },
  ------------------
  |  | 1205|  1.33k|#define NID_md2         3
  ------------------
                      { NID_md2,       OSSL_DIGEST_NAME_MD2       },
  ------------------
  |  |   43|  1.33k|# define OSSL_DIGEST_NAME_MD2            "MD2"
  ------------------
   33|  1.33k|        { NID_md4,       OSSL_DIGEST_NAME_MD4       },
  ------------------
  |  | 1210|  1.33k|#define NID_md4         257
  ------------------
                      { NID_md4,       OSSL_DIGEST_NAME_MD4       },
  ------------------
  |  |   44|  1.33k|# define OSSL_DIGEST_NAME_MD4            "MD4"
  ------------------
   34|  1.33k|        { NID_mdc2,      OSSL_DIGEST_NAME_MDC2      },
  ------------------
  |  | 2643|  1.33k|#define NID_mdc2                95
  ------------------
                      { NID_mdc2,      OSSL_DIGEST_NAME_MDC2      },
  ------------------
  |  |   45|  1.33k|# define OSSL_DIGEST_NAME_MDC2           "MDC2"
  ------------------
   35|  1.33k|        { NID_ripemd160, OSSL_DIGEST_NAME_RIPEMD160 },
  ------------------
  |  | 2336|  1.33k|#define NID_ripemd160           117
  ------------------
                      { NID_ripemd160, OSSL_DIGEST_NAME_RIPEMD160 },
  ------------------
  |  |   46|  1.33k|# define OSSL_DIGEST_NAME_RIPEMD160      "RIPEMD160"
  ------------------
   36|  1.33k|        { NID_sm3,       OSSL_DIGEST_NAME_SM3 },
  ------------------
  |  | 1237|  1.33k|#define NID_sm3         1143
  ------------------
                      { NID_sm3,       OSSL_DIGEST_NAME_SM3 },
  ------------------
  |  |   53|  1.33k|# define OSSL_DIGEST_NAME_SM3            "SM3"
  ------------------
   37|  1.33k|    };
   38|       |
   39|  1.33k|    mdnid = ossl_digest_get_approved_nid(md);
   40|  1.33k|    if (mdnid == NID_undef)
  ------------------
  |  |   18|  1.33k|#define NID_undef                       0
  ------------------
  |  Branch (40:9): [True: 36, False: 1.29k]
  ------------------
   41|     36|        mdnid = ossl_digest_md_to_nid(md, name_to_nid, OSSL_NELEM(name_to_nid));
  ------------------
  |  |   14|     36|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   42|  1.33k|    return mdnid;
   43|  1.33k|}

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

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

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

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

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

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

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

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

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

sha3_prov.c:sha3_224_newctx:
  488|     12|static void *name##_newctx(void *provctx)                                      \
  489|     12|{                                                                              \
  490|     12|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
  ------------------
  |  |  104|     12|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (490:27): [True: 12, False: 0]
  ------------------
  491|     12|                                                : NULL;                        \
  492|     12|                                                                               \
  493|     12|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (493:9): [True: 0, False: 12]
  ------------------
  494|     12|        return NULL;                                                           \
  495|     12|    ossl_sha3_init(ctx, pad, bitlen);                                          \
  496|     12|    SHA3_SET_MD(uname, typ)                                                    \
  ------------------
  |  |  481|     12|# define SHA3_SET_MD(uname, typ) ctx->meth = sha3_generic_md;
  ------------------
  497|     12|    return ctx;                                                                \
  498|     12|}
sha3_prov.c:generic_sha3_absorb:
  151|  13.2k|{
  152|  13.2k|    KECCAK1600_CTX *ctx = vctx;
  153|       |
  154|  13.2k|    if (!(ctx->xof_state == XOF_STATE_INIT ||
  ------------------
  |  |   35|  26.5k|#define XOF_STATE_INIT    0
  ------------------
  |  Branch (154:11): [True: 13.2k, False: 0]
  ------------------
  155|  13.2k|          ctx->xof_state == XOF_STATE_ABSORB))
  ------------------
  |  |   36|      0|#define XOF_STATE_ABSORB  1
  ------------------
  |  Branch (155:11): [True: 0, False: 0]
  ------------------
  156|      0|        return 0;
  157|  13.2k|    ctx->xof_state = XOF_STATE_ABSORB;
  ------------------
  |  |   36|  13.2k|#define XOF_STATE_ABSORB  1
  ------------------
  158|  13.2k|    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
  159|  13.2k|}
sha3_prov.c:generic_sha3_final:
  162|  13.2k|{
  163|  13.2k|    return ossl_sha3_final((KECCAK1600_CTX *)vctx, out, outlen);
  164|  13.2k|}
sha3_prov.c:keccak_update:
   75|  13.2k|{
   76|  13.2k|    KECCAK1600_CTX *ctx = vctx;
   77|  13.2k|    const size_t bsz = ctx->block_size;
   78|  13.2k|    size_t num, rem;
   79|       |
   80|  13.2k|    if (len == 0)
  ------------------
  |  Branch (80:9): [True: 0, False: 13.2k]
  ------------------
   81|      0|        return 1;
   82|       |
   83|       |    /* Is there anything in the buffer already ? */
   84|  13.2k|    if ((num = ctx->bufsz) != 0) {
  ------------------
  |  Branch (84:9): [True: 0, False: 13.2k]
  ------------------
   85|       |        /* Calculate how much space is left in the buffer */
   86|      0|        rem = bsz - num;
   87|       |        /* If the new input does not fill the buffer then just add it */
   88|      0|        if (len < rem) {
  ------------------
  |  Branch (88:13): [True: 0, False: 0]
  ------------------
   89|      0|            memcpy(ctx->buf + num, inp, len);
   90|      0|            ctx->bufsz += len;
   91|      0|            return 1;
   92|      0|        }
   93|       |        /* otherwise fill up the buffer and absorb the buffer */
   94|      0|        memcpy(ctx->buf + num, inp, rem);
   95|       |        /* Update the input pointer */
   96|      0|        inp += rem;
   97|      0|        len -= rem;
   98|      0|        ctx->meth.absorb(ctx, ctx->buf, bsz);
   99|      0|        ctx->bufsz = 0;
  100|      0|    }
  101|       |    /* Absorb the input - rem = leftover part of the input < blocksize) */
  102|  13.2k|    rem = ctx->meth.absorb(ctx, inp, len);
  103|       |    /* Copy the leftover bit of the input into the buffer */
  104|  13.2k|    if (rem) {
  ------------------
  |  Branch (104:9): [True: 13.2k, False: 14]
  ------------------
  105|  13.2k|        memcpy(ctx->buf, inp + len - rem, rem);
  106|  13.2k|        ctx->bufsz = rem;
  107|  13.2k|    }
  108|  13.2k|    return 1;
  109|  13.2k|}
sha3_prov.c:keccak_final:
  113|  13.2k|{
  114|  13.2k|    int ret = 1;
  115|  13.2k|    KECCAK1600_CTX *ctx = vctx;
  116|       |
  117|  13.2k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (117:9): [True: 0, False: 13.2k]
  ------------------
  118|      0|        return 0;
  119|  13.2k|    if (ctx->md_size == SIZE_MAX) {
  ------------------
  |  Branch (119:9): [True: 0, False: 13.2k]
  ------------------
  120|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|  13.2k|    if (outlen > 0)
  ------------------
  |  Branch (123:9): [True: 13.2k, False: 0]
  ------------------
  124|  13.2k|        ret = ctx->meth.final(ctx, out, ctx->md_size);
  125|       |
  126|  13.2k|    *outl = ctx->md_size;
  127|  13.2k|    return ret;
  128|  13.2k|}
sha3_prov.c:keccak_freectx:
  559|     96|{
  560|     96|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  561|       |
  562|     96|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  113|     96|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     96|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     96|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  563|     96|}
sha3_prov.c:keccak_dupctx:
  574|     36|{
  575|     36|    KECCAK1600_CTX *in = (KECCAK1600_CTX *)ctx;
  576|     36|    KECCAK1600_CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret))
  ------------------
  |  |  102|     36|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     36|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     36|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (576:27): [True: 36, False: 0]
  ------------------
  577|     36|                                                 : NULL;
  578|       |
  579|     36|    if (ret != NULL)
  ------------------
  |  Branch (579:9): [True: 36, False: 0]
  ------------------
  580|     36|        *ret = *in;
  581|     36|    return ret;
  582|     36|}
sha3_prov.c:keccak_init:
   60|  13.2k|{
   61|  13.2k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (61:9): [True: 0, False: 13.2k]
  ------------------
   62|      0|        return 0;
   63|       |    /* The newctx() handles most of the ctx fixed setup. */
   64|  13.2k|    ossl_sha3_reset((KECCAK1600_CTX *)vctx);
   65|  13.2k|    return 1;
   66|  13.2k|}
sha3_prov.c:sha3_256_newctx:
  488|      7|static void *name##_newctx(void *provctx)                                      \
  489|      7|{                                                                              \
  490|      7|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
  ------------------
  |  |  104|      7|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (490:27): [True: 7, False: 0]
  ------------------
  491|      7|                                                : NULL;                        \
  492|      7|                                                                               \
  493|      7|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (493:9): [True: 0, False: 7]
  ------------------
  494|      7|        return NULL;                                                           \
  495|      7|    ossl_sha3_init(ctx, pad, bitlen);                                          \
  496|      7|    SHA3_SET_MD(uname, typ)                                                    \
  ------------------
  |  |  481|      7|# define SHA3_SET_MD(uname, typ) ctx->meth = sha3_generic_md;
  ------------------
  497|      7|    return ctx;                                                                \
  498|      7|}
sha3_prov.c:sha3_384_newctx:
  488|     20|static void *name##_newctx(void *provctx)                                      \
  489|     20|{                                                                              \
  490|     20|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
  ------------------
  |  |  104|     20|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     20|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     20|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (490:27): [True: 20, False: 0]
  ------------------
  491|     20|                                                : NULL;                        \
  492|     20|                                                                               \
  493|     20|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (493:9): [True: 0, False: 20]
  ------------------
  494|     20|        return NULL;                                                           \
  495|     20|    ossl_sha3_init(ctx, pad, bitlen);                                          \
  496|     20|    SHA3_SET_MD(uname, typ)                                                    \
  ------------------
  |  |  481|     20|# define SHA3_SET_MD(uname, typ) ctx->meth = sha3_generic_md;
  ------------------
  497|     20|    return ctx;                                                                \
  498|     20|}
sha3_prov.c:sha3_512_newctx:
  488|     18|static void *name##_newctx(void *provctx)                                      \
  489|     18|{                                                                              \
  490|     18|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
  ------------------
  |  |  104|     18|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (490:27): [True: 18, False: 0]
  ------------------
  491|     18|                                                : NULL;                        \
  492|     18|                                                                               \
  493|     18|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (493:9): [True: 0, False: 18]
  ------------------
  494|     18|        return NULL;                                                           \
  495|     18|    ossl_sha3_init(ctx, pad, bitlen);                                          \
  496|     18|    SHA3_SET_MD(uname, typ)                                                    \
  ------------------
  |  |  481|     18|# define SHA3_SET_MD(uname, typ) ctx->meth = sha3_generic_md;
  ------------------
  497|     18|    return ctx;                                                                \
  498|     18|}
sha3_prov.c:shake_128_newctx:
  502|      1|static void *name##_newctx(void *provctx)                                      \
  503|      1|{                                                                              \
  504|      1|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (504:27): [True: 1, False: 0]
  ------------------
  505|      1|                                                : NULL;                        \
  506|      1|                                                                               \
  507|      1|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (507:9): [True: 0, False: 1]
  ------------------
  508|      1|        return NULL;                                                           \
  509|      1|    ossl_keccak_init(ctx, pad, bitlen, mdlen);                                 \
  510|      1|    if (mdlen == 0)                                                            \
  ------------------
  |  Branch (510:9): [Folded - Ignored]
  ------------------
  511|      1|        ctx->md_size = SIZE_MAX;                                               \
  512|      1|    SHAKE_SET_MD(uname, typ)                                                   \
  ------------------
  |  |  483|      1|# define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
  ------------------
  513|      1|    return ctx;                                                                \
  514|      1|}
sha3_prov.c:keccak_init_params:
   69|      3|{
   70|      3|    return keccak_init(vctx, NULL)
  ------------------
  |  Branch (70:12): [True: 3, False: 0]
  ------------------
   71|      3|            && shake_set_ctx_params(vctx, params);
  ------------------
  |  Branch (71:16): [True: 3, False: 0]
  ------------------
   72|      3|}
sha3_prov.c:shake_set_ctx_params:
  632|      3|{
  633|      3|    const OSSL_PARAM *p;
  634|      3|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  635|       |
  636|      3|    if (ctx == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 3]
  ------------------
  637|      0|        return 0;
  638|      3|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (638:9): [True: 3, False: 0]
  ------------------
  639|      3|        return 1;
  640|       |
  641|      0|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_XOFLEN);
  ------------------
  |  |  226|      0|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  642|      0|    if (p == NULL)
  ------------------
  |  Branch (642:9): [True: 0, False: 0]
  ------------------
  643|      0|        p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SIZE);
  ------------------
  |  |  223|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  644|       |
  645|      0|    if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->md_size)) {
  ------------------
  |  Branch (645:9): [True: 0, False: 0]
  |  Branch (645:22): [True: 0, False: 0]
  ------------------
  646|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  647|      0|        return 0;
  648|      0|    }
  649|      0|    return 1;
  650|      0|}
sha3_prov.c:shake_get_ctx_params:
  596|      3|{
  597|      3|    OSSL_PARAM *p;
  598|      3|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  599|       |
  600|      3|    if (ctx == NULL)
  ------------------
  |  Branch (600:9): [True: 0, False: 3]
  ------------------
  601|      0|        return 0;
  602|      3|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (602:9): [True: 0, False: 3]
  ------------------
  603|      0|        return 1;
  604|       |
  605|      3|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_XOFLEN);
  ------------------
  |  |  226|      3|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  606|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->md_size)) {
  ------------------
  |  Branch (606:9): [True: 0, False: 3]
  |  Branch (606:22): [True: 0, False: 0]
  ------------------
  607|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  608|      0|        return 0;
  609|      0|    }
  610|       |    /* Size is an alias of xoflen */
  611|      3|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);
  ------------------
  |  |  223|      3|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  612|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->md_size)) {
  ------------------
  |  Branch (612:9): [True: 3, False: 0]
  |  Branch (612:22): [True: 0, False: 3]
  ------------------
  613|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|      0|        return 0;
  615|      0|    }
  616|      3|    return 1;
  617|      3|}
sha3_prov.c:shake_gettable_ctx_params:
  586|      3|{
  587|      3|    static const OSSL_PARAM known_shake_gettable_ctx_params[] = {
  588|      3|        {OSSL_DIGEST_PARAM_XOFLEN, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0},
  ------------------
  |  |  226|      3|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
                      {OSSL_DIGEST_PARAM_XOFLEN, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0},
  ------------------
  |  |  107|      3|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  589|      3|        {OSSL_DIGEST_PARAM_SIZE, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0},
  ------------------
  |  |  223|      3|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
                      {OSSL_DIGEST_PARAM_SIZE, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0},
  ------------------
  |  |  107|      3|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  590|      3|        OSSL_PARAM_END
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
  591|      3|    };
  592|      3|    return known_shake_gettable_ctx_params;
  593|      3|}
sha3_prov.c:shake_256_newctx:
  502|      2|static void *name##_newctx(void *provctx)                                      \
  503|      2|{                                                                              \
  504|      2|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (504:27): [True: 2, False: 0]
  ------------------
  505|      2|                                                : NULL;                        \
  506|      2|                                                                               \
  507|      2|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (507:9): [True: 0, False: 2]
  ------------------
  508|      2|        return NULL;                                                           \
  509|      2|    ossl_keccak_init(ctx, pad, bitlen, mdlen);                                 \
  510|      2|    if (mdlen == 0)                                                            \
  ------------------
  |  Branch (510:9): [Folded - Ignored]
  ------------------
  511|      2|        ctx->md_size = SIZE_MAX;                                               \
  512|      2|    SHAKE_SET_MD(uname, typ)                                                   \
  ------------------
  |  |  483|      2|# define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
  ------------------
  513|      2|    return ctx;                                                                \
  514|      2|}

decode_der2key.c:der2key_newctx:
  162|   103k|{
  163|   103k|    struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|   103k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   103k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   103k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  164|       |
  165|   103k|    if (ctx != NULL) {
  ------------------
  |  Branch (165:9): [True: 103k, False: 0]
  ------------------
  166|   103k|        ctx->provctx = provctx;
  167|   103k|        ctx->desc = desc;
  168|   103k|    }
  169|   103k|    return ctx;
  170|   103k|}
decode_der2key.c:dh_adjust:
  428|    143|{
  429|    143|    ossl_dh_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|    143|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  430|    143|}
decode_der2key.c:der2key_freectx:
  195|   103k|{
  196|   103k|    struct der2key_ctx_st *ctx = vctx;
  197|       |
  198|   103k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|   103k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   103k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   103k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  199|   103k|}
decode_der2key.c:PrivateKeyInfo_der2dh_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:der2key_check_selection:
  203|  55.4k|{
  204|       |    /*
  205|       |     * The selections are kinda sorta "levels", i.e. each selection given
  206|       |     * here is assumed to include those following.
  207|       |     */
  208|  55.4k|    int checks[] = {
  209|  55.4k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  640|  55.4k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  210|  55.4k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  641|  55.4k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  211|  55.4k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  647|  55.4k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|  55.4k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|  55.4k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|  55.4k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  212|  55.4k|    };
  213|  55.4k|    size_t i;
  214|       |
  215|       |    /* The decoder implementations made here support guessing */
  216|  55.4k|    if (selection == 0)
  ------------------
  |  Branch (216:9): [True: 0, False: 55.4k]
  ------------------
  217|      0|        return 1;
  218|       |
  219|   110k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|   110k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (219:17): [True: 110k, False: 0]
  ------------------
  220|   110k|        int check1 = (selection & checks[i]) != 0;
  221|   110k|        int check2 = (desc->selection_mask & checks[i]) != 0;
  222|       |
  223|       |        /*
  224|       |         * If the caller asked for the currently checked bit(s), return
  225|       |         * whether the decoder description says it's supported.
  226|       |         */
  227|   110k|        if (check1)
  ------------------
  |  Branch (227:13): [True: 55.4k, False: 55.4k]
  ------------------
  228|  55.4k|            return check2;
  229|   110k|    }
  230|       |
  231|       |    /* This should be dead code, but just to be safe... */
  232|      0|    return 0;
  233|  55.4k|}
decode_der2key.c:der2key_decode:
  238|  56.9k|{
  239|  56.9k|    struct der2key_ctx_st *ctx = vctx;
  240|  56.9k|    unsigned char *der = NULL;
  241|  56.9k|    const unsigned char *derp;
  242|  56.9k|    long der_len = 0;
  243|  56.9k|    void *key = NULL;
  244|  56.9k|    int ok = 0;
  245|       |
  246|  56.9k|    ctx->selection = selection;
  247|       |    /*
  248|       |     * The caller is allowed to specify 0 as a selection mask, to have the
  249|       |     * structure and key type guessed.  For type-specific structures, this
  250|       |     * is not recommended, as some structures are very similar.
  251|       |     * Note that 0 isn't the same as OSSL_KEYMGMT_SELECT_ALL, as the latter
  252|       |     * signifies a private key structure, where everything else is assumed
  253|       |     * to be present as well.
  254|       |     */
  255|  56.9k|    if (selection == 0)
  ------------------
  |  Branch (255:9): [True: 0, False: 56.9k]
  ------------------
  256|      0|        selection = ctx->desc->selection_mask;
  257|  56.9k|    if ((selection & ctx->desc->selection_mask) == 0) {
  ------------------
  |  Branch (257:9): [True: 0, False: 56.9k]
  ------------------
  258|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  259|      0|        return 0;
  260|      0|    }
  261|       |
  262|  56.9k|    ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
  263|  56.9k|    if (!ok)
  ------------------
  |  Branch (263:9): [True: 7, False: 56.9k]
  ------------------
  264|      7|        goto next;
  265|       |
  266|  56.9k|    ok = 0; /* Assume that we fail */
  267|       |
  268|  56.9k|    ERR_set_mark();
  269|  56.9k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|  56.9k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (269:9): [True: 0, False: 56.9k]
  ------------------
  270|      0|        derp = der;
  271|      0|        if (ctx->desc->d2i_PKCS8 != NULL) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      0|            key = ctx->desc->d2i_PKCS8(&derp, der_len, ctx);
  273|      0|            if (ctx->flag_fatal) {
  ------------------
  |  Branch (273:17): [True: 0, False: 0]
  ------------------
  274|      0|                ERR_clear_last_mark();
  275|      0|                goto end;
  276|      0|            }
  277|      0|        } else if (ctx->desc->d2i_private_key != NULL) {
  ------------------
  |  Branch (277:20): [True: 0, False: 0]
  ------------------
  278|      0|            key = ctx->desc->d2i_private_key(NULL, &derp, der_len);
  279|      0|        }
  280|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (280:13): [True: 0, False: 0]
  |  Branch (280:28): [True: 0, False: 0]
  ------------------
  281|      0|            ERR_clear_last_mark();
  282|      0|            goto next;
  283|      0|        }
  284|      0|    }
  285|  56.9k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|  56.9k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (285:9): [True: 56.9k, False: 0]
  |  Branch (285:24): [True: 56.9k, False: 0]
  ------------------
  286|  56.9k|        derp = der;
  287|  56.9k|        if (ctx->desc->d2i_PUBKEY != NULL)
  ------------------
  |  Branch (287:13): [True: 56.8k, False: 84]
  ------------------
  288|  56.8k|            key = ctx->desc->d2i_PUBKEY(&derp, der_len, ctx);
  289|     84|        else if (ctx->desc->d2i_public_key != NULL)
  ------------------
  |  Branch (289:18): [True: 84, False: 0]
  ------------------
  290|     84|            key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
  291|  56.9k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (291:13): [True: 37.7k, False: 19.2k]
  |  Branch (291:28): [True: 37.7k, False: 0]
  ------------------
  292|  37.7k|            ERR_clear_last_mark();
  293|  37.7k|            goto next;
  294|  37.7k|        }
  295|  56.9k|    }
  296|  19.2k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) {
  ------------------
  |  |  647|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  |  Branch (296:9): [True: 0, False: 19.2k]
  |  Branch (296:24): [True: 0, False: 0]
  ------------------
  297|      0|        derp = der;
  298|      0|        if (ctx->desc->d2i_key_params != NULL)
  ------------------
  |  Branch (298:13): [True: 0, False: 0]
  ------------------
  299|      0|            key = ctx->desc->d2i_key_params(NULL, &derp, der_len);
  300|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  |  Branch (300:28): [True: 0, False: 0]
  ------------------
  301|      0|            ERR_clear_last_mark();
  302|      0|            goto next;
  303|      0|        }
  304|      0|    }
  305|  19.2k|    if (key == NULL)
  ------------------
  |  Branch (305:9): [True: 0, False: 19.2k]
  ------------------
  306|      0|        ERR_clear_last_mark();
  307|  19.2k|    else
  308|  19.2k|        ERR_pop_to_mark();
  309|       |
  310|       |    /*
  311|       |     * Last minute check to see if this was the correct type of key.  This
  312|       |     * should never lead to a fatal error, i.e. the decoding itself was
  313|       |     * correct, it was just an unexpected key type.  This is generally for
  314|       |     * classes of key types that have subtle variants, like RSA-PSS keys as
  315|       |     * opposed to plain RSA keys.
  316|       |     */
  317|  19.2k|    if (key != NULL
  ------------------
  |  Branch (317:9): [True: 19.2k, False: 0]
  ------------------
  318|  19.2k|        && ctx->desc->check_key != NULL
  ------------------
  |  Branch (318:12): [True: 19.0k, False: 220]
  ------------------
  319|  19.2k|        && !ctx->desc->check_key(key, ctx)) {
  ------------------
  |  Branch (319:12): [True: 0, False: 19.0k]
  ------------------
  320|      0|        ctx->desc->free_key(key);
  321|      0|        key = NULL;
  322|      0|    }
  323|       |
  324|  19.2k|    if (key != NULL && ctx->desc->adjust_key != NULL)
  ------------------
  |  Branch (324:9): [True: 19.2k, False: 0]
  |  Branch (324:24): [True: 19.2k, False: 0]
  ------------------
  325|  19.2k|        ctx->desc->adjust_key(key, ctx);
  326|       |
  327|  56.9k| next:
  328|       |    /*
  329|       |     * Indicated that we successfully decoded something, or not at all.
  330|       |     * Ending up "empty handed" is not an error.
  331|       |     */
  332|  56.9k|    ok = 1;
  333|       |
  334|       |    /*
  335|       |     * We free memory here so it's not held up during the callback, because
  336|       |     * we know the process is recursive and the allocated chunks of memory
  337|       |     * add up.
  338|       |     */
  339|  56.9k|    OPENSSL_free(der);
  ------------------
  |  |  115|  56.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  56.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  56.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  340|  56.9k|    der = NULL;
  341|       |
  342|  56.9k|    if (key != NULL) {
  ------------------
  |  Branch (342:9): [True: 19.2k, False: 37.7k]
  ------------------
  343|  19.2k|        OSSL_PARAM params[4];
  344|  19.2k|        int object_type = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  19.2k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
  345|       |
  346|  19.2k|        params[0] =
  347|  19.2k|            OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
  ------------------
  |  |  356|  19.2k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  348|       |
  349|  19.2k|#ifndef OPENSSL_NO_SM2
  350|  19.2k|        if (strcmp(ctx->desc->keytype_name, "EC") == 0
  ------------------
  |  Branch (350:13): [True: 11.3k, False: 7.86k]
  ------------------
  351|  19.2k|            && (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0)
  ------------------
  |  |  962|  11.3k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  |  Branch (351:16): [True: 0, False: 11.3k]
  ------------------
  352|      0|            params[1] =
  353|      0|                OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  352|      0|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  354|      0|                                                 "SM2", 0);
  355|  19.2k|        else
  356|  19.2k|#endif
  357|  19.2k|            params[1] =
  358|  19.2k|                OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  352|  19.2k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  359|  19.2k|                                                 (char *)ctx->desc->keytype_name,
  360|  19.2k|                                                 0);
  361|       |        /* The address of the key becomes the octet string */
  362|  19.2k|        params[2] =
  363|  19.2k|            OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
  ------------------
  |  |  355|  19.2k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  364|  19.2k|                                              &key, sizeof(key));
  365|  19.2k|        params[3] = OSSL_PARAM_construct_end();
  366|       |
  367|  19.2k|        ok = data_cb(params, data_cbarg);
  368|  19.2k|    }
  369|       |
  370|  56.9k| end:
  371|  56.9k|    ctx->desc->free_key(key);
  372|  56.9k|    OPENSSL_free(der);
  ------------------
  |  |  115|  56.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  56.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  56.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  373|       |
  374|  56.9k|    return ok;
  375|  56.9k|}
decode_der2key.c:SubjectPublicKeyInfo_der2dh_newctx:
 1193|  1.46k|    {                                                                   \
 1194|  1.46k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  1.46k|    }                                                                   \
decode_der2key.c:dh_d2i_PUBKEY:
  403|  1.45k|    {                                                       \
  404|  1.45k|        return f(NULL, der, der_len);                       \
  405|  1.45k|    }
decode_der2key.c:SubjectPublicKeyInfo_der2dh_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:type_specific_params_der2dh_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:DH_der2dh_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_newctx:
 1193|  3.02k|    {                                                                   \
 1194|  3.02k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  3.02k|    }                                                                   \
decode_der2key.c:dhx_d2i_PUBKEY:
  403|  3.02k|    {                                                       \
  404|  3.02k|        return f(NULL, der, der_len);                       \
  405|  3.02k|    }
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:type_specific_params_der2dhx_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:DHX_der2dhx_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:dsa_adjust:
  462|     68|{
  463|     68|    ossl_dsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|     68|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  464|     68|}
decode_der2key.c:PrivateKeyInfo_der2dsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_newctx:
 1193|  2.06k|    {                                                                   \
 1194|  2.06k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  2.06k|    }                                                                   \
decode_der2key.c:dsa_d2i_PUBKEY:
  403|  2.06k|    {                                                       \
  404|  2.06k|        return f(NULL, der, der_len);                       \
  405|  2.06k|    }
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_newctx:
 1193|  2.06k|    {                                                                   \
 1194|  2.06k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  2.06k|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:DSA_der2dsa_newctx:
 1193|  2.06k|    {                                                                   \
 1194|  2.06k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  2.06k|    }                                                                   \
decode_der2key.c:DSA_der2dsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:ec_check:
  486|  12.4k|{
  487|       |    /* We're trying to be clever by comparing two truths */
  488|  12.4k|    int ret = 0;
  489|  12.4k|    int sm2 = (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0;
  ------------------
  |  |  962|  12.4k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  490|       |
  491|  12.4k|    if (sm2)
  ------------------
  |  Branch (491:9): [True: 1.02k, False: 11.3k]
  ------------------
  492|  1.02k|        ret = ctx->desc->evp_type == EVP_PKEY_SM2
  ------------------
  |  |   74|  1.02k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  2.05k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (492:15): [True: 1.02k, False: 0]
  ------------------
  493|  1.02k|            || ctx->desc->evp_type == NID_X9_62_id_ecPublicKey;
  ------------------
  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (493:16): [True: 0, False: 0]
  ------------------
  494|  11.3k|    else
  495|  11.3k|        ret = ctx->desc->evp_type != EVP_PKEY_SM2;
  ------------------
  |  |   74|  11.3k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  11.3k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  496|       |
  497|  12.4k|    return ret;
  498|  12.4k|}
decode_der2key.c:ec_adjust:
  501|  12.4k|{
  502|  12.4k|    ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|  12.4k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  503|  12.4k|}
decode_der2key.c:PrivateKeyInfo_der2ec_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_newctx:
 1193|  32.7k|    {                                                                   \
 1194|  32.7k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  32.7k|    }                                                                   \
decode_der2key.c:ec_d2i_PUBKEY:
  403|  32.7k|    {                                                       \
  404|  32.7k|        return f(NULL, der, der_len);                       \
  405|  32.7k|    }
decode_der2key.c:SubjectPublicKeyInfo_der2ec_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:EC_der2ec_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:ecx_key_adjust:
  524|      9|{
  525|      9|    ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|      9|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  526|      9|}
decode_der2key.c:PrivateKeyInfo_der2x25519_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_newctx:
 1193|     29|    {                                                                   \
 1194|     29|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     29|    }                                                                   \
decode_der2key.c:x25519_d2i_PUBKEY:
  403|     28|    {                                                       \
  404|     28|        return f(NULL, der, der_len);                       \
  405|     28|    }
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_newctx:
 1193|      7|    {                                                                   \
 1194|      7|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      7|    }                                                                   \
decode_der2key.c:x448_d2i_PUBKEY:
  403|      6|    {                                                       \
  404|      6|        return f(NULL, der, der_len);                       \
  405|      6|    }
decode_der2key.c:SubjectPublicKeyInfo_der2x448_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_newctx:
 1193|      7|    {                                                                   \
 1194|      7|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      7|    }                                                                   \
decode_der2key.c:ed25519_d2i_PUBKEY:
  403|      6|    {                                                       \
  404|      6|        return f(NULL, der, der_len);                       \
  405|      6|    }
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_newctx:
 1193|      4|    {                                                                   \
 1194|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|      4|    }                                                                   \
decode_der2key.c:ed448_d2i_PUBKEY:
  403|      3|    {                                                       \
  404|      3|        return f(NULL, der, der_len);                       \
  405|      3|    }
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2sm2_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_newctx:
 1193|  32.7k|    {                                                                   \
 1194|  32.7k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  32.7k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_512_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_512_newctx:
 1193|     76|    {                                                                   \
 1194|     76|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     76|    }                                                                   \
decode_der2key.c:ml_kem_d2i_PUBKEY:
  603|    185|{
  604|    185|    ML_KEM_KEY *key;
  605|       |
  606|    185|    key = ossl_ml_kem_d2i_PUBKEY(*der, der_len, ctx->desc->evp_type,
  607|    185|                                 ctx->provctx, ctx->propq);
  608|    185|    if (key != NULL)
  ------------------
  |  Branch (608:9): [True: 0, False: 185]
  ------------------
  609|      0|        *der += der_len;
  610|    185|    return key;
  611|    185|}
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_512_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_768_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_768_newctx:
 1193|     68|    {                                                                   \
 1194|     68|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     68|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_768_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_1024_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_1024_newctx:
 1193|     44|    {                                                                   \
 1194|     44|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     44|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_1024_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128s_newctx:
 1193|    197|    {                                                                   \
 1194|    197|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    197|    }                                                                   \
decode_der2key.c:slh_dsa_d2i_PUBKEY:
  685|  5.29k|{
  686|  5.29k|    int ok = 0;
  687|  5.29k|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|  5.29k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  688|  5.29k|    SLH_DSA_KEY *ret = NULL;
  689|  5.29k|    BARE_PUBKEY *spki = NULL;
  690|  5.29k|    const uint8_t *end = *der;
  691|  5.29k|    size_t len;
  692|       |
  693|  5.29k|    ret = ossl_slh_dsa_key_new(libctx, ctx->propq, ctx->desc->keytype_name);
  694|  5.29k|    if (ret == NULL)
  ------------------
  |  Branch (694:9): [True: 0, False: 5.29k]
  ------------------
  695|      0|        return NULL;
  696|  5.29k|    len = ossl_slh_dsa_key_get_pub_len(ret);
  697|       |
  698|       |    /*-
  699|       |     * The DER ASN.1 encoding of SLH-DSA public keys prepends 18 bytes to the
  700|       |     * encoded public key (since the largest public key size is 64 bytes):
  701|       |     *
  702|       |     * - 2 byte outer sequence tag and length
  703|       |     * -  2 byte algorithm sequence tag and length
  704|       |     * -    2 byte algorithm OID tag and length
  705|       |     * -      9 byte algorithm OID
  706|       |     * -  2 byte bit string tag and length
  707|       |     * -    1 bitstring lead byte
  708|       |     *
  709|       |     * Check that we have the right OID, the bit string has no "bits left" and
  710|       |     * that we consume all the input exactly.
  711|       |     */
  712|  5.29k|    if (der_len != 18 + (long)len) {
  ------------------
  |  Branch (712:9): [True: 4.93k, False: 362]
  ------------------
  713|  4.93k|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|  4.93k|    (ERR_new(),                                                 \
  |  |  404|  4.93k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|  4.93k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|  4.93k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|  4.93k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  4.93k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|  4.93k|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|  4.93k|# define PROV_R_BAD_ENCODING                              141
  ------------------
  714|  4.93k|                       "unexpected %s public key length: %ld != %ld",
  715|  4.93k|                       ctx->desc->keytype_name, der_len,
  716|  4.93k|                       18 + (long)len);
  717|  4.93k|        goto err;
  718|  4.93k|    }
  719|       |
  720|    362|    if ((spki = OPENSSL_zalloc(sizeof(*spki))) == NULL)
  ------------------
  |  |  104|    362|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    362|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    362|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (720:9): [True: 0, False: 362]
  ------------------
  721|      0|        goto err;
  722|       |
  723|       |    /* The spki storage is freed on error */
  724|    362|    if (ASN1_item_d2i_ex((ASN1_VALUE **)&spki, &end, der_len,
  ------------------
  |  Branch (724:9): [True: 360, False: 2]
  ------------------
  725|    362|                         ASN1_ITEM_rptr(BARE_PUBKEY), NULL, NULL) == NULL) {
  ------------------
  |  |  427|    362|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  726|    360|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|    360|    (ERR_new(),                                                 \
  |  |  404|    360|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|    360|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|    360|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|    360|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|    360|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|    360|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|    360|# define PROV_R_BAD_ENCODING                              141
  ------------------
  727|    360|                       "malformed %s public key ASN.1 encoding",
  728|    360|                       ossl_slh_dsa_key_get_name(ret));
  729|    360|        goto err;
  730|    360|    }
  731|       |
  732|       |    /* The spki structure now owns some memory */
  733|      2|    if ((spki->pubkey->flags & 0x7) != 0 || end != *der + der_len) {
  ------------------
  |  Branch (733:9): [True: 1, False: 1]
  |  Branch (733:45): [True: 1, False: 0]
  ------------------
  734|      2|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      2|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      2|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      2|# define PROV_R_BAD_ENCODING                              141
  ------------------
  735|      2|                       "malformed %s public key ASN.1 encoding",
  736|      2|                       ossl_slh_dsa_key_get_name(ret));
  737|      2|        goto err;
  738|      2|    }
  739|      0|    if (OBJ_cmp(OBJ_nid2obj(ctx->desc->evp_type), spki->algor.oid) != 0) {
  ------------------
  |  Branch (739:9): [True: 0, False: 0]
  ------------------
  740|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  741|      0|                       "unexpected algorithm OID for an %s public key",
  742|      0|                       ossl_slh_dsa_key_get_name(ret));
  743|      0|        goto err;
  744|      0|    }
  745|       |
  746|      0|    if (!ossl_slh_dsa_set_pub(ret, spki->pubkey->data, spki->pubkey->length)) {
  ------------------
  |  Branch (746:9): [True: 0, False: 0]
  ------------------
  747|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  748|      0|                       "failed to parse %s public key from the input data",
  749|      0|                       ossl_slh_dsa_key_get_name(ret));
  750|      0|        goto err;
  751|      0|    }
  752|      0|    ok = 1;
  753|  5.29k| err:
  754|  5.29k|    if (spki != NULL) {
  ------------------
  |  Branch (754:9): [True: 2, False: 5.29k]
  ------------------
  755|      2|        ASN1_OBJECT_free(spki->algor.oid);
  756|      2|        ASN1_BIT_STRING_free(spki->pubkey);
  757|      2|        OPENSSL_free(spki);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  758|      2|    }
  759|  5.29k|    if (!ok) {
  ------------------
  |  Branch (759:9): [True: 5.29k, False: 0]
  ------------------
  760|  5.29k|        ossl_slh_dsa_key_free(ret);
  761|  5.29k|        ret = NULL;
  762|  5.29k|    }
  763|  5.29k|    return ret;
  764|      0|}
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128f_newctx:
 1193|    197|    {                                                                   \
 1194|    197|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    197|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192s_newctx:
 1193|  1.23k|    {                                                                   \
 1194|  1.23k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  1.23k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192f_newctx:
 1193|    429|    {                                                                   \
 1194|    429|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    429|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256s_newctx:
 1193|     45|    {                                                                   \
 1194|     45|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     45|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256f_newctx:
 1193|    414|    {                                                                   \
 1194|    414|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    414|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128s_newctx:
 1193|    109|    {                                                                   \
 1194|    109|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    109|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128f_newctx:
 1193|     16|    {                                                                   \
 1194|     16|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     16|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192s_newctx:
 1193|     44|    {                                                                   \
 1194|     44|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     44|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192f_newctx:
 1193|  2.24k|    {                                                                   \
 1194|  2.24k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  2.24k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256s_newctx:
 1193|    364|    {                                                                   \
 1194|    364|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    364|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256s_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256f_newctx:
 1193|     15|    {                                                                   \
 1194|     15|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     15|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256f_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:rsa_check:
  910|  6.62k|{
  911|  6.62k|    int valid;
  912|       |
  913|  6.62k|    switch (RSA_test_flags(key, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|  6.62k|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  914|  2.38k|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|  2.38k|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (914:5): [True: 2.38k, False: 4.23k]
  ------------------
  915|  2.38k|        valid = (ctx->desc->evp_type == EVP_PKEY_RSA);
  ------------------
  |  |   63|  2.38k|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  2.38k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  916|  2.38k|        break;
  917|  4.23k|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|  4.23k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (917:5): [True: 4.23k, False: 2.38k]
  ------------------
  918|  4.23k|        valid = (ctx->desc->evp_type == EVP_PKEY_RSA_PSS);
  ------------------
  |  |   65|  4.23k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  4.23k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  919|  4.23k|        break;
  920|      0|    default:
  ------------------
  |  Branch (920:5): [True: 0, False: 6.62k]
  ------------------
  921|       |        /* Currently unsupported RSA key type */
  922|      0|        valid = 0;
  923|  6.62k|    }
  924|       |
  925|  6.62k|    valid = (valid && ossl_rsa_check_factors(key));
  ------------------
  |  Branch (925:14): [True: 6.62k, False: 0]
  |  Branch (925:23): [True: 6.62k, False: 0]
  ------------------
  926|       |
  927|  6.62k|    return valid;
  928|  6.62k|}
decode_der2key.c:rsa_adjust:
  931|  6.62k|{
  932|  6.62k|    ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|  6.62k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  933|  6.62k|}
decode_der2key.c:PrivateKeyInfo_der2rsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_newctx:
 1193|  4.94k|    {                                                                   \
 1194|  4.94k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  4.94k|    }                                                                   \
decode_der2key.c:rsa_d2i_PUBKEY:
  905|  11.2k|{
  906|  11.2k|    return d2i_RSA_PUBKEY(NULL, der, der_len);
  907|  11.2k|}
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_newctx:
 1193|  4.94k|    {                                                                   \
 1194|  4.94k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  4.94k|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:RSA_der2rsa_newctx:
 1193|  4.94k|    {                                                                   \
 1194|  4.94k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  4.94k|    }                                                                   \
decode_der2key.c:RSA_der2rsa_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_newctx:
 1193|  6.33k|    {                                                                   \
 1194|  6.33k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|  6.33k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_44_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_44_newctx:
 1193|     71|    {                                                                   \
 1194|     71|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     71|    }                                                                   \
decode_der2key.c:ml_dsa_d2i_PUBKEY:
  962|    750|{
  963|    750|    ML_DSA_KEY *key;
  964|       |
  965|    750|    key = ossl_ml_dsa_d2i_PUBKEY(*der, der_len, ctx->desc->evp_type,
  966|    750|                                 ctx->provctx, ctx->propq);
  967|    750|    if (key != NULL)
  ------------------
  |  Branch (967:9): [True: 0, False: 750]
  ------------------
  968|      0|        *der += der_len;
  969|    750|    return key;
  970|    750|}
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_44_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_65_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_65_newctx:
 1193|     93|    {                                                                   \
 1194|     93|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|     93|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_65_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_87_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_87_newctx:
 1193|    589|    {                                                                   \
 1194|    589|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
 1195|    589|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_87_does_selection:
 1198|    803|    {                                                                   \
 1199|    803|        return der2key_check_selection(selection,                       \
 1200|    803|                                       &kind##_##keytype##_desc);       \
 1201|    803|    }                                                                   \

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

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

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

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

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

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

ossl_ml_dsa_d2i_PUBKEY:
  109|    750|{
  110|    750|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    750|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  111|    750|    const ML_COMMON_CODEC *codec;
  112|    750|    const ML_DSA_PARAMS *params;
  113|    750|    ML_DSA_KEY *ret;
  114|       |
  115|    750|    if ((params = ossl_ml_dsa_params_get(evp_type)) == NULL
  ------------------
  |  Branch (115:9): [True: 0, False: 750]
  ------------------
  116|    750|        || (codec = ml_dsa_get_codec(evp_type)) == NULL)
  ------------------
  |  Branch (116:12): [True: 0, False: 750]
  ------------------
  117|      0|        return NULL;
  118|    750|    if (pk_len != ML_COMMON_SPKI_OVERHEAD + (ossl_ssize_t) params->pk_len
  ------------------
  |  |   29|    750|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (118:9): [True: 749, False: 1]
  ------------------
  119|    750|        || memcmp(pk, codec->spkifmt->asn1_prefix, ML_COMMON_SPKI_OVERHEAD) != 0)
  ------------------
  |  |   29|      1|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (119:12): [True: 1, False: 0]
  ------------------
  120|    750|        return NULL;
  121|      0|    pk_len -= ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  122|      0|    pk += ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  123|       |
  124|      0|    if ((ret = ossl_ml_dsa_key_new(libctx, propq, evp_type)) == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 0]
  ------------------
  125|      0|        return NULL;
  126|       |
  127|      0|    if (!ossl_ml_dsa_pk_decode(ret, pk, (size_t) pk_len)) {
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  129|      0|                       "errror parsing %s public key from input SPKI",
  130|      0|                       params->alg);
  131|      0|        ossl_ml_dsa_key_free(ret);
  132|      0|        return NULL;
  133|      0|    }
  134|       |
  135|      0|    return ret;
  136|      0|}
ml_dsa_codecs.c:ml_dsa_get_codec:
   94|    750|{
   95|    750|    switch (evp_type) {
  ------------------
  |  Branch (95:13): [True: 0, False: 750]
  ------------------
   96|     70|    case EVP_PKEY_ML_DSA_44:
  ------------------
  |  |   86|     70|# define EVP_PKEY_ML_DSA_44 NID_ML_DSA_44
  |  |  ------------------
  |  |  |  | 3436|     70|#define NID_ML_DSA_44           1457
  |  |  ------------------
  ------------------
  |  Branch (96:5): [True: 70, False: 680]
  ------------------
   97|     70|        return &codecs[ML_DSA_44_CODEC];
  ------------------
  |  |   79|     70|#define ML_DSA_44_CODEC    0
  ------------------
   98|     92|    case EVP_PKEY_ML_DSA_65:
  ------------------
  |  |   87|     92|# define EVP_PKEY_ML_DSA_65 NID_ML_DSA_65
  |  |  ------------------
  |  |  |  | 3441|     92|#define NID_ML_DSA_65           1458
  |  |  ------------------
  ------------------
  |  Branch (98:5): [True: 92, False: 658]
  ------------------
   99|     92|        return &codecs[ML_DSA_65_CODEC];
  ------------------
  |  |   80|     92|#define ML_DSA_65_CODEC    1
  ------------------
  100|    588|    case EVP_PKEY_ML_DSA_87:
  ------------------
  |  |   88|    588|# define EVP_PKEY_ML_DSA_87 NID_ML_DSA_87
  |  |  ------------------
  |  |  |  | 3446|    588|#define NID_ML_DSA_87           1459
  |  |  ------------------
  ------------------
  |  Branch (100:5): [True: 588, False: 162]
  ------------------
  101|    588|        return &codecs[ML_DSA_87_CODEC];
  ------------------
  |  |   81|    588|#define ML_DSA_87_CODEC    2
  ------------------
  102|    750|    }
  103|      0|    return NULL;
  104|    750|}

ossl_ml_kem_d2i_PUBKEY:
  106|    185|{
  107|    185|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    185|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  108|    185|    const ML_KEM_VINFO *v;
  109|    185|    const ML_COMMON_CODEC *codec;
  110|    185|    const ML_COMMON_SPKI_FMT *vspki;
  111|    185|    ML_KEM_KEY *ret;
  112|       |
  113|    185|    if ((v = ossl_ml_kem_get_vinfo(evp_type)) == NULL
  ------------------
  |  Branch (113:9): [True: 0, False: 185]
  ------------------
  114|    185|        || (codec = ml_kem_get_codec(evp_type)) == NULL)
  ------------------
  |  Branch (114:12): [True: 0, False: 185]
  ------------------
  115|      0|        return NULL;
  116|    185|    vspki = codec->spkifmt;
  117|    185|    if (publen != ML_COMMON_SPKI_OVERHEAD + (ossl_ssize_t) v->pubkey_bytes
  ------------------
  |  |   29|    185|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (117:9): [True: 184, False: 1]
  ------------------
  118|    185|        || memcmp(pubenc, vspki->asn1_prefix, ML_COMMON_SPKI_OVERHEAD) != 0)
  ------------------
  |  |   29|      1|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  |  Branch (118:12): [True: 1, False: 0]
  ------------------
  119|    185|        return NULL;
  120|      0|    publen -= ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  121|      0|    pubenc += ML_COMMON_SPKI_OVERHEAD;
  ------------------
  |  |   29|      0|#  define ML_COMMON_SPKI_OVERHEAD   22
  ------------------
  122|       |
  123|      0|    if ((ret = ossl_ml_kem_key_new(libctx, propq, evp_type)) == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 0]
  ------------------
  124|      0|        return NULL;
  125|       |
  126|      0|    if (!ossl_ml_kem_parse_public_key(pubenc, (size_t) publen, ret)) {
  ------------------
  |  Branch (126:9): [True: 0, False: 0]
  ------------------
  127|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
  ------------------
  |  |   28|      0|# define PROV_R_BAD_ENCODING                              141
  ------------------
  128|      0|                       "errror parsing %s public key from input SPKI",
  129|      0|                       v->algorithm_name);
  130|      0|        ossl_ml_kem_key_free(ret);
  131|      0|        return NULL;
  132|      0|    }
  133|       |
  134|      0|    return ret;
  135|      0|}
ml_kem_codecs.c:ml_kem_get_codec:
   91|    185|{
   92|    185|    switch (evp_type) {
  ------------------
  |  Branch (92:13): [True: 0, False: 185]
  ------------------
   93|     75|    case EVP_PKEY_ML_KEM_512:
  ------------------
  |  |   93|     75|# define EVP_PKEY_ML_KEM_512            NID_ML_KEM_512
  |  |  ------------------
  |  |  |  | 6613|     75|#define NID_ML_KEM_512          1454
  |  |  ------------------
  ------------------
  |  Branch (93:5): [True: 75, False: 110]
  ------------------
   94|     75|        return &codecs[ML_KEM_512_CODEC];
  ------------------
  |  |   76|     75|#define ML_KEM_512_CODEC    0
  ------------------
   95|     67|    case EVP_PKEY_ML_KEM_768:
  ------------------
  |  |  103|     67|# define EVP_PKEY_ML_KEM_768            NID_ML_KEM_768
  |  |  ------------------
  |  |  |  | 6618|     67|#define NID_ML_KEM_768          1455
  |  |  ------------------
  ------------------
  |  Branch (95:5): [True: 67, False: 118]
  ------------------
   96|     67|        return &codecs[ML_KEM_768_CODEC];
  ------------------
  |  |   77|     67|#define ML_KEM_768_CODEC    1
  ------------------
   97|     43|    case EVP_PKEY_ML_KEM_1024:
  ------------------
  |  |  113|     43|# define EVP_PKEY_ML_KEM_1024           NID_ML_KEM_1024
  |  |  ------------------
  |  |  |  | 6623|     43|#define NID_ML_KEM_1024         1456
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 43, False: 142]
  ------------------
   98|     43|        return &codecs[ML_KEM_1024_CODEC];
  ------------------
  |  |   78|     43|#define ML_KEM_1024_CODEC   2
  ------------------
   99|    185|    }
  100|      0|    return NULL;
  101|    185|}

md5_prov.c:md5_newctx:
   55|     62|static void *name##_newctx(void *prov_ctx)                                     \
   56|     62|{                                                                              \
   57|     62|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|     62|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     62|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     62|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 62, False: 0]
  ------------------
   58|     62|    return ctx;                                                                \
   59|     62|}                                                                              \
md5_prov.c:md5_internal_final:
   41|     62|                                 size_t outsz)                                 \
   42|     62|{                                                                              \
   43|     62|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 62, False: 0]
  |  Branch (43:35): [True: 62, False: 0]
  |  Branch (43:56): [True: 62, False: 0]
  ------------------
   44|     62|        *outl = dgstsize;                                                      \
   45|     62|        return 1;                                                              \
   46|     62|    }                                                                          \
   47|     62|    return 0;                                                                  \
   48|     62|}
md5_prov.c:md5_freectx:
   60|    111|static void name##_freectx(void *vctx)                                         \
   61|    111|{                                                                              \
   62|    111|    CTX *ctx = (CTX *)vctx;                                                    \
   63|    111|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|    111|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    111|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    111|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|    111|}                                                                              \
md5_prov.c:md5_dupctx:
   65|     49|static void *name##_dupctx(void *ctx)                                          \
   66|     49|{                                                                              \
   67|     49|    CTX *in = (CTX *)ctx;                                                      \
   68|     49|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|     49|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     49|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     49|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 49, False: 0]
  ------------------
   69|     49|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 49, False: 0]
  ------------------
   70|     49|        *ret = *in;                                                            \
   71|     49|    return ret;                                                                \
   72|     49|}                                                                              \
md5_prov.c:md5_copyctx:
   73|     13|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|     13|{                                                                              \
   75|     13|    CTX *outctx = (CTX *)voutctx;                                              \
   76|     13|    CTX *inctx = (CTX *)vinctx;                                                \
   77|     13|    *outctx = *inctx;                                                          \
   78|     13|}                                                                              \
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_prov.c:md5_internal_init:
   98|     62|                                ossl_unused const OSSL_PARAM params[])         \
   99|     62|{                                                                              \
  100|     62|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 62, False: 0]
  |  Branch (100:38): [True: 62, False: 0]
  ------------------
  101|     62|}                                                                              \
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_newctx:
   55|     40|static void *name##_newctx(void *prov_ctx)                                     \
   56|     40|{                                                                              \
   57|     40|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|     40|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 40, False: 0]
  ------------------
   58|     40|    return ctx;                                                                \
   59|     40|}                                                                              \
ripemd_prov.c:ripemd160_internal_final:
   41|   199k|                                 size_t outsz)                                 \
   42|   199k|{                                                                              \
   43|   199k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 199k, False: 0]
  |  Branch (43:35): [True: 199k, False: 0]
  |  Branch (43:56): [True: 199k, False: 0]
  ------------------
   44|   199k|        *outl = dgstsize;                                                      \
   45|   199k|        return 1;                                                              \
   46|   199k|    }                                                                          \
   47|   199k|    return 0;                                                                  \
   48|   199k|}
ripemd_prov.c:ripemd160_freectx:
   60|     40|static void name##_freectx(void *vctx)                                         \
   61|     40|{                                                                              \
   62|     40|    CTX *ctx = (CTX *)vctx;                                                    \
   63|     40|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|     40|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|     40|}                                                                              \
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|}
ripemd_prov.c:ripemd160_internal_init:
   98|   199k|                                ossl_unused const OSSL_PARAM params[])         \
   99|   199k|{                                                                              \
  100|   199k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 199k, False: 0]
  |  Branch (100:38): [True: 199k, False: 0]
  ------------------
  101|   199k|}                                                                              \
sha2_prov.c:sha1_newctx:
   55|  1.96k|static void *name##_newctx(void *prov_ctx)                                     \
   56|  1.96k|{                                                                              \
   57|  1.96k|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|  1.96k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.96k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.96k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 1.96k, False: 0]
  ------------------
   58|  1.96k|    return ctx;                                                                \
   59|  1.96k|}                                                                              \
sha2_prov.c:sha1_internal_final:
   41|   231k|                                 size_t outsz)                                 \
   42|   231k|{                                                                              \
   43|   231k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 231k, False: 0]
  |  Branch (43:35): [True: 231k, False: 0]
  |  Branch (43:56): [True: 231k, False: 0]
  ------------------
   44|   231k|        *outl = dgstsize;                                                      \
   45|   231k|        return 1;                                                              \
   46|   231k|    }                                                                          \
   47|   231k|    return 0;                                                                  \
   48|   231k|}
sha2_prov.c:sha1_freectx:
   60|  2.50k|static void name##_freectx(void *vctx)                                         \
   61|  2.50k|{                                                                              \
   62|  2.50k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  2.50k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|  2.50k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.50k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.50k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  2.50k|}                                                                              \
sha2_prov.c:sha1_dupctx:
   65|    541|static void *name##_dupctx(void *ctx)                                          \
   66|    541|{                                                                              \
   67|    541|    CTX *in = (CTX *)ctx;                                                      \
   68|    541|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|    541|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    541|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    541|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 541, False: 0]
  ------------------
   69|    541|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 541, False: 0]
  ------------------
   70|    541|        *ret = *in;                                                            \
   71|    541|    return ret;                                                                \
   72|    541|}                                                                              \
sha2_prov.c:sha1_copyctx:
   73|     31|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|     31|{                                                                              \
   75|     31|    CTX *outctx = (CTX *)voutctx;                                              \
   76|     31|    CTX *inctx = (CTX *)vinctx;                                                \
   77|     31|    *outctx = *inctx;                                                          \
   78|     31|}                                                                              \
sha2_prov.c:sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha1_internal_init:
  111|   231k|static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
  112|   231k|{                                                                              \
  113|   231k|    return ossl_prov_is_running()                                              \
  ------------------
  |  Branch (113:12): [True: 231k, False: 0]
  ------------------
  114|   231k|           && init(ctx)                                                        \
  ------------------
  |  Branch (114:15): [True: 231k, False: 0]
  ------------------
  115|   231k|           && set_ctx_params(ctx, params);                                     \
  ------------------
  |  Branch (115:15): [True: 231k, False: 0]
  ------------------
  116|   231k|}                                                                              \
sha2_prov.c:sha224_newctx:
   55|     51|static void *name##_newctx(void *prov_ctx)                                     \
   56|     51|{                                                                              \
   57|     51|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|     51|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     51|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     51|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 51, False: 0]
  ------------------
   58|     51|    return ctx;                                                                \
   59|     51|}                                                                              \
sha2_prov.c:sha224_internal_final:
   41|  52.2k|                                 size_t outsz)                                 \
   42|  52.2k|{                                                                              \
   43|  52.2k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 52.2k, False: 0]
  |  Branch (43:35): [True: 52.2k, False: 0]
  |  Branch (43:56): [True: 52.2k, False: 0]
  ------------------
   44|  52.2k|        *outl = dgstsize;                                                      \
   45|  52.2k|        return 1;                                                              \
   46|  52.2k|    }                                                                          \
   47|  52.2k|    return 0;                                                                  \
   48|  52.2k|}
sha2_prov.c:sha224_freectx:
   60|     88|static void name##_freectx(void *vctx)                                         \
   61|     88|{                                                                              \
   62|     88|    CTX *ctx = (CTX *)vctx;                                                    \
   63|     88|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|     88|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     88|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     88|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|     88|}                                                                              \
sha2_prov.c:sha224_dupctx:
   65|     37|static void *name##_dupctx(void *ctx)                                          \
   66|     37|{                                                                              \
   67|     37|    CTX *in = (CTX *)ctx;                                                      \
   68|     37|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|     37|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     37|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     37|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 37, False: 0]
  ------------------
   69|     37|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 37, False: 0]
  ------------------
   70|     37|        *ret = *in;                                                            \
   71|     37|    return ret;                                                                \
   72|     37|}                                                                              \
sha2_prov.c:sha224_copyctx:
   73|      3|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|      3|{                                                                              \
   75|      3|    CTX *outctx = (CTX *)voutctx;                                              \
   76|      3|    CTX *inctx = (CTX *)vinctx;                                                \
   77|      3|    *outctx = *inctx;                                                          \
   78|      3|}                                                                              \
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:sha224_internal_init:
   98|  52.2k|                                ossl_unused const OSSL_PARAM params[])         \
   99|  52.2k|{                                                                              \
  100|  52.2k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 52.2k, False: 0]
  |  Branch (100:38): [True: 52.2k, False: 0]
  ------------------
  101|  52.2k|}                                                                              \
sha2_prov.c:sha256_newctx:
   55|    208|static void *name##_newctx(void *prov_ctx)                                     \
   56|    208|{                                                                              \
   57|    208|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|    208|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    208|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    208|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 208, False: 0]
  ------------------
   58|    208|    return ctx;                                                                \
   59|    208|}                                                                              \
sha2_prov.c:sha256_internal_final:
   41|  21.9k|                                 size_t outsz)                                 \
   42|  21.9k|{                                                                              \
   43|  21.9k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 21.9k, False: 0]
  |  Branch (43:35): [True: 21.9k, False: 0]
  |  Branch (43:56): [True: 21.9k, False: 0]
  ------------------
   44|  21.9k|        *outl = dgstsize;                                                      \
   45|  21.9k|        return 1;                                                              \
   46|  21.9k|    }                                                                          \
   47|  21.9k|    return 0;                                                                  \
   48|  21.9k|}
sha2_prov.c:sha256_freectx:
   60|    384|static void name##_freectx(void *vctx)                                         \
   61|    384|{                                                                              \
   62|    384|    CTX *ctx = (CTX *)vctx;                                                    \
   63|    384|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|    384|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    384|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    384|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|    384|}                                                                              \
sha2_prov.c:sha256_dupctx:
   65|    176|static void *name##_dupctx(void *ctx)                                          \
   66|    176|{                                                                              \
   67|    176|    CTX *in = (CTX *)ctx;                                                      \
   68|    176|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|    176|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    176|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    176|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 176, False: 0]
  ------------------
   69|    176|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 176, False: 0]
  ------------------
   70|    176|        *ret = *in;                                                            \
   71|    176|    return ret;                                                                \
   72|    176|}                                                                              \
sha2_prov.c:sha256_copyctx:
   73|      3|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|      3|{                                                                              \
   75|      3|    CTX *outctx = (CTX *)voutctx;                                              \
   76|      3|    CTX *inctx = (CTX *)vinctx;                                                \
   77|      3|    *outctx = *inctx;                                                          \
   78|      3|}                                                                              \
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_internal_init:
   98|  21.9k|                                ossl_unused const OSSL_PARAM params[])         \
   99|  21.9k|{                                                                              \
  100|  21.9k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 21.9k, False: 0]
  |  Branch (100:38): [True: 21.9k, False: 0]
  ------------------
  101|  21.9k|}                                                                              \
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_newctx:
   55|    135|static void *name##_newctx(void *prov_ctx)                                     \
   56|    135|{                                                                              \
   57|    135|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|    135|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    135|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    135|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 135, False: 0]
  ------------------
   58|    135|    return ctx;                                                                \
   59|    135|}                                                                              \
sha2_prov.c:sha384_internal_final:
   41|  81.0k|                                 size_t outsz)                                 \
   42|  81.0k|{                                                                              \
   43|  81.0k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 81.0k, False: 0]
  |  Branch (43:35): [True: 81.0k, False: 0]
  |  Branch (43:56): [True: 81.0k, False: 0]
  ------------------
   44|  81.0k|        *outl = dgstsize;                                                      \
   45|  81.0k|        return 1;                                                              \
   46|  81.0k|    }                                                                          \
   47|  81.0k|    return 0;                                                                  \
   48|  81.0k|}
sha2_prov.c:sha384_freectx:
   60|    259|static void name##_freectx(void *vctx)                                         \
   61|    259|{                                                                              \
   62|    259|    CTX *ctx = (CTX *)vctx;                                                    \
   63|    259|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|    259|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    259|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    259|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|    259|}                                                                              \
sha2_prov.c:sha384_dupctx:
   65|    124|static void *name##_dupctx(void *ctx)                                          \
   66|    124|{                                                                              \
   67|    124|    CTX *in = (CTX *)ctx;                                                      \
   68|    124|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|    124|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    124|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    124|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 124, False: 0]
  ------------------
   69|    124|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 124, False: 0]
  ------------------
   70|    124|        *ret = *in;                                                            \
   71|    124|    return ret;                                                                \
   72|    124|}                                                                              \
sha2_prov.c:sha384_copyctx:
   73|      1|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|      1|{                                                                              \
   75|      1|    CTX *outctx = (CTX *)voutctx;                                              \
   76|      1|    CTX *inctx = (CTX *)vinctx;                                                \
   77|      1|    *outctx = *inctx;                                                          \
   78|      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:sha384_internal_init:
   98|  81.0k|                                ossl_unused const OSSL_PARAM params[])         \
   99|  81.0k|{                                                                              \
  100|  81.0k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 81.0k, False: 0]
  |  Branch (100:38): [True: 81.0k, False: 0]
  ------------------
  101|  81.0k|}                                                                              \
sha2_prov.c:sha512_newctx:
   55|     69|static void *name##_newctx(void *prov_ctx)                                     \
   56|     69|{                                                                              \
   57|     69|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|     69|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     69|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     69|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 69, False: 0]
  ------------------
   58|     69|    return ctx;                                                                \
   59|     69|}                                                                              \
sha2_prov.c:sha512_internal_final:
   41|  3.62k|                                 size_t outsz)                                 \
   42|  3.62k|{                                                                              \
   43|  3.62k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 3.62k, False: 0]
  |  Branch (43:35): [True: 3.62k, False: 0]
  |  Branch (43:56): [True: 3.62k, False: 0]
  ------------------
   44|  3.62k|        *outl = dgstsize;                                                      \
   45|  3.62k|        return 1;                                                              \
   46|  3.62k|    }                                                                          \
   47|  3.62k|    return 0;                                                                  \
   48|  3.62k|}
sha2_prov.c:sha512_freectx:
   60|    125|static void name##_freectx(void *vctx)                                         \
   61|    125|{                                                                              \
   62|    125|    CTX *ctx = (CTX *)vctx;                                                    \
   63|    125|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|    125|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    125|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    125|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|    125|}                                                                              \
sha2_prov.c:sha512_dupctx:
   65|     56|static void *name##_dupctx(void *ctx)                                          \
   66|     56|{                                                                              \
   67|     56|    CTX *in = (CTX *)ctx;                                                      \
   68|     56|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|     56|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     56|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     56|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 56, False: 0]
  ------------------
   69|     56|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 56, False: 0]
  ------------------
   70|     56|        *ret = *in;                                                            \
   71|     56|    return ret;                                                                \
   72|     56|}                                                                              \
sha2_prov.c:sha512_copyctx:
   73|      3|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|      3|{                                                                              \
   75|      3|    CTX *outctx = (CTX *)voutctx;                                              \
   76|      3|    CTX *inctx = (CTX *)vinctx;                                                \
   77|      3|    *outctx = *inctx;                                                          \
   78|      3|}                                                                              \
sha2_prov.c:sha512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_internal_init:
   98|  3.62k|                                ossl_unused const OSSL_PARAM params[])         \
   99|  3.62k|{                                                                              \
  100|  3.62k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 3.62k, False: 0]
  |  Branch (100:38): [True: 3.62k, False: 0]
  ------------------
  101|  3.62k|}                                                                              \
sha2_prov.c:sha512_224_newctx:
   55|     19|static void *name##_newctx(void *prov_ctx)                                     \
   56|     19|{                                                                              \
   57|     19|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|     19|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     19|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     19|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 19, False: 0]
  ------------------
   58|     19|    return ctx;                                                                \
   59|     19|}                                                                              \
sha2_prov.c:sha512_224_internal_final:
   41|  43.8k|                                 size_t outsz)                                 \
   42|  43.8k|{                                                                              \
   43|  43.8k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 43.8k, False: 0]
  |  Branch (43:35): [True: 43.8k, False: 0]
  |  Branch (43:56): [True: 43.8k, False: 0]
  ------------------
   44|  43.8k|        *outl = dgstsize;                                                      \
   45|  43.8k|        return 1;                                                              \
   46|  43.8k|    }                                                                          \
   47|  43.8k|    return 0;                                                                  \
   48|  43.8k|}
sha2_prov.c:sha512_224_freectx:
   60|     23|static void name##_freectx(void *vctx)                                         \
   61|     23|{                                                                              \
   62|     23|    CTX *ctx = (CTX *)vctx;                                                    \
   63|     23|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|     23|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     23|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     23|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|     23|}                                                                              \
sha2_prov.c:sha512_224_dupctx:
   65|      4|static void *name##_dupctx(void *ctx)                                          \
   66|      4|{                                                                              \
   67|      4|    CTX *in = (CTX *)ctx;                                                      \
   68|      4|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|      4|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 4, False: 0]
  ------------------
   69|      4|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 4, False: 0]
  ------------------
   70|      4|        *ret = *in;                                                            \
   71|      4|    return ret;                                                                \
   72|      4|}                                                                              \
sha2_prov.c:sha512_224_copyctx:
   73|      4|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|      4|{                                                                              \
   75|      4|    CTX *outctx = (CTX *)voutctx;                                              \
   76|      4|    CTX *inctx = (CTX *)vinctx;                                                \
   77|      4|    *outctx = *inctx;                                                          \
   78|      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_224_internal_init:
   98|  43.8k|                                ossl_unused const OSSL_PARAM params[])         \
   99|  43.8k|{                                                                              \
  100|  43.8k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 43.8k, False: 0]
  |  Branch (100:38): [True: 43.8k, False: 0]
  ------------------
  101|  43.8k|}                                                                              \
sha2_prov.c:sha512_256_newctx:
   55|     14|static void *name##_newctx(void *prov_ctx)                                     \
   56|     14|{                                                                              \
   57|     14|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|     14|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     14|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     14|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 14, False: 0]
  ------------------
   58|     14|    return ctx;                                                                \
   59|     14|}                                                                              \
sha2_prov.c:sha512_256_internal_final:
   41|  16.2k|                                 size_t outsz)                                 \
   42|  16.2k|{                                                                              \
   43|  16.2k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 16.2k, False: 0]
  |  Branch (43:35): [True: 16.2k, False: 0]
  |  Branch (43:56): [True: 16.2k, False: 0]
  ------------------
   44|  16.2k|        *outl = dgstsize;                                                      \
   45|  16.2k|        return 1;                                                              \
   46|  16.2k|    }                                                                          \
   47|  16.2k|    return 0;                                                                  \
   48|  16.2k|}
sha2_prov.c:sha512_256_freectx:
   60|     16|static void name##_freectx(void *vctx)                                         \
   61|     16|{                                                                              \
   62|     16|    CTX *ctx = (CTX *)vctx;                                                    \
   63|     16|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|     16|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|     16|}                                                                              \
sha2_prov.c:sha512_256_dupctx:
   65|      2|static void *name##_dupctx(void *ctx)                                          \
   66|      2|{                                                                              \
   67|      2|    CTX *in = (CTX *)ctx;                                                      \
   68|      2|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 2, False: 0]
  ------------------
   69|      2|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 2, False: 0]
  ------------------
   70|      2|        *ret = *in;                                                            \
   71|      2|    return ret;                                                                \
   72|      2|}                                                                              \
sha2_prov.c:sha512_256_copyctx:
   73|      2|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|      2|{                                                                              \
   75|      2|    CTX *outctx = (CTX *)voutctx;                                              \
   76|      2|    CTX *inctx = (CTX *)vinctx;                                                \
   77|      2|    *outctx = *inctx;                                                          \
   78|      2|}                                                                              \
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|}
sha2_prov.c:sha512_256_internal_init:
   98|  16.2k|                                ossl_unused const OSSL_PARAM params[])         \
   99|  16.2k|{                                                                              \
  100|  16.2k|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 16.2k, False: 0]
  |  Branch (100:38): [True: 16.2k, False: 0]
  ------------------
  101|  16.2k|}                                                                              \
sha3_prov.c:sha3_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sm3_prov.c:sm3_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}

dh_kmgmt.c:dh_load:
  827|    143|{
  828|    143|    DH *dh = NULL;
  829|       |
  830|    143|    if (ossl_prov_is_running() && reference_sz == sizeof(dh)) {
  ------------------
  |  Branch (830:9): [True: 143, False: 0]
  |  Branch (830:35): [True: 143, False: 0]
  ------------------
  831|       |        /* The contents of the reference is the address to our object */
  832|    143|        dh = *(DH **)reference;
  833|       |        /* We grabbed, so we detach it */
  834|    143|        *(DH **)reference = NULL;
  835|    143|        return dh;
  836|    143|    }
  837|      0|    return NULL;
  838|    143|}
dh_kmgmt.c:dh_freedata:
  126|    143|{
  127|    143|    DH_free(keydata);
  128|    143|}
dh_kmgmt.c:dh_get_params:
  316|    143|{
  317|    143|    DH *dh = key;
  318|    143|    OSSL_PARAM *p;
  319|       |
  320|    143|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|    143|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 143, False: 0]
  ------------------
  321|    143|        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
  ------------------
  |  Branch (321:12): [True: 0, False: 143]
  ------------------
  322|      0|        return 0;
  323|    143|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|    143|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 143, False: 0]
  ------------------
  324|    143|        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
  ------------------
  |  Branch (324:12): [True: 0, False: 143]
  ------------------
  325|      0|        return 0;
  326|    143|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|    143|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 143, False: 0]
  ------------------
  327|    143|        && !OSSL_PARAM_set_int(p, DH_size(dh)))
  ------------------
  |  Branch (327:12): [True: 0, False: 143]
  ------------------
  328|      0|        return 0;
  329|    143|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  390|    143|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (329:9): [True: 0, False: 143]
  ------------------
  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|    143|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  488|    143|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|    143|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (337:9): [True: 143, False: 0]
  ------------------
  338|    143|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (338:13): [True: 0, False: 143]
  ------------------
  339|      0|            return 0;
  340|       |
  341|    143|    return ossl_dh_params_todata(dh, NULL, params)
  ------------------
  |  Branch (341:12): [True: 143, False: 0]
  ------------------
  342|    143|        && ossl_dh_key_todata(dh, NULL, params, 1);
  ------------------
  |  Branch (342:12): [True: 143, False: 0]
  ------------------
  343|    143|}

dsa_kmgmt.c:dsa_load:
  707|     68|{
  708|     68|    DSA *dsa = NULL;
  709|       |
  710|     68|    if (ossl_prov_is_running() && reference_sz == sizeof(dsa)) {
  ------------------
  |  Branch (710:9): [True: 68, False: 0]
  |  Branch (710:35): [True: 68, False: 0]
  ------------------
  711|       |        /* The contents of the reference is the address to our object */
  712|     68|        dsa = *(DSA **)reference;
  713|       |        /* We grabbed, so we detach it */
  714|     68|        *(DSA **)reference = NULL;
  715|     68|        return dsa;
  716|     68|    }
  717|      0|    return NULL;
  718|     68|}
dsa_kmgmt.c:dsa_freedata:
  129|     68|{
  130|     68|    DSA_free(keydata);
  131|     68|}
dsa_kmgmt.c:dsa_get_params:
  316|     68|{
  317|     68|    DSA *dsa = key;
  318|     68|    OSSL_PARAM *p;
  319|       |
  320|     68|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|     68|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 68, False: 0]
  ------------------
  321|     68|        && !OSSL_PARAM_set_int(p, DSA_bits(dsa)))
  ------------------
  |  Branch (321:12): [True: 0, False: 68]
  ------------------
  322|      0|        return 0;
  323|     68|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|     68|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 68, False: 0]
  ------------------
  324|     68|        && !OSSL_PARAM_set_int(p, DSA_security_bits(dsa)))
  ------------------
  |  Branch (324:12): [True: 0, False: 68]
  ------------------
  325|      0|        return 0;
  326|     68|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|     68|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 68, False: 0]
  ------------------
  327|     68|        && !OSSL_PARAM_set_int(p, DSA_size(dsa)))
  ------------------
  |  Branch (327:12): [True: 0, False: 68]
  ------------------
  328|      0|        return 0;
  329|     68|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  362|     68|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (329:9): [True: 0, False: 68]
  ------------------
  330|     68|        && !OSSL_PARAM_set_utf8_string(p, DSA_DEFAULT_MD))
  ------------------
  |  |   51|      0|#define DSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (330:12): [True: 0, False: 0]
  ------------------
  331|      0|        return 0;
  332|     68|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL
  ------------------
  |  |  488|     68|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|     68|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (332:9): [True: 68, False: 0]
  ------------------
  333|     68|        && !OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (333:12): [True: 0, False: 68]
  ------------------
  334|      0|        return 0;
  335|     68|    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, params)
  ------------------
  |  Branch (335:12): [True: 68, False: 0]
  ------------------
  336|     68|           && dsa_key_todata(dsa, NULL, params, 1);
  ------------------
  |  Branch (336:15): [True: 68, False: 0]
  ------------------
  337|     68|}
dsa_kmgmt.c:dsa_key_todata:
  103|     68|{
  104|     68|    const BIGNUM *priv = NULL, *pub = NULL;
  105|       |
  106|     68|    if (dsa == NULL)
  ------------------
  |  Branch (106:9): [True: 0, False: 68]
  ------------------
  107|      0|        return 0;
  108|       |
  109|     68|    DSA_get0_key(dsa, &pub, &priv);
  110|     68|    if (include_private
  ------------------
  |  Branch (110:9): [True: 68, False: 0]
  ------------------
  111|     68|        && priv != NULL
  ------------------
  |  Branch (111:12): [True: 0, False: 68]
  ------------------
  112|     68|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  431|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (112:12): [True: 0, False: 0]
  ------------------
  113|      0|        return 0;
  114|     68|    if (pub != NULL
  ------------------
  |  Branch (114:9): [True: 68, False: 0]
  ------------------
  115|     68|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  433|     68|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (115:12): [True: 0, False: 68]
  ------------------
  116|      0|        return 0;
  117|       |
  118|     68|    return 1;
  119|     68|}

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

ecx_kmgmt.c:x25519_get_params:
  337|      6|{
  338|      6|    return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   33|      6|#  define X25519_BITS           253
  ------------------
                  return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   34|      6|#  define X25519_SECURITY_BITS  128
  ------------------
  339|      6|                          X25519_KEYLEN);
  ------------------
  |  |   26|      6|#  define X25519_KEYLEN         32
  ------------------
  340|      6|}
ecx_kmgmt.c:ecx_get_params:
  288|      9|{
  289|      9|    ECX_KEY *ecx = key;
  290|      9|    OSSL_PARAM *p;
  291|       |
  292|      9|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|      9|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (292:9): [True: 9, False: 0]
  ------------------
  293|      9|        && !OSSL_PARAM_set_int(p, bits))
  ------------------
  |  Branch (293:12): [True: 0, False: 9]
  ------------------
  294|      0|        return 0;
  295|      9|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|      9|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (295:9): [True: 9, False: 0]
  ------------------
  296|      9|        && !OSSL_PARAM_set_int(p, secbits))
  ------------------
  |  Branch (296:12): [True: 0, False: 9]
  ------------------
  297|      0|        return 0;
  298|      9|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|      9|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (298:9): [True: 9, False: 0]
  ------------------
  299|      9|        && !OSSL_PARAM_set_int(p, size))
  ------------------
  |  Branch (299:12): [True: 0, False: 9]
  ------------------
  300|      0|        return 0;
  301|      9|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL
  ------------------
  |  |  390|      9|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (301:9): [True: 0, False: 9]
  ------------------
  302|      9|            && (ecx->type == ECX_KEY_TYPE_X25519
  ------------------
  |  Branch (302:17): [True: 0, False: 0]
  ------------------
  303|      0|                || ecx->type == ECX_KEY_TYPE_X448)) {
  ------------------
  |  Branch (303:20): [True: 0, False: 0]
  ------------------
  304|      0|        if (!OSSL_PARAM_set_octet_string(p, ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (304:13): [True: 0, False: 0]
  ------------------
  305|      0|            return 0;
  306|      0|    }
  307|      9|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (307:9): [True: 9, False: 0]
  ------------------
  308|      9|                               OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL
  ------------------
  |  |  488|      9|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|      9|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  309|      9|        && !OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (309:12): [True: 0, False: 9]
  ------------------
  310|      0|            return 0;
  311|       |#ifdef FIPS_MODULE
  312|       |    {
  313|       |        /* X25519 and X448 are not approved */
  314|       |        int approved = 0;
  315|       |
  316|       |        p = OSSL_PARAM_locate(params, OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
  317|       |        if (p != NULL && !OSSL_PARAM_set_int(p, approved))
  318|       |            return 0;
  319|       |    }
  320|       |#endif
  321|       |
  322|      9|    return key_to_params(ecx, NULL, params, 1);
  323|      9|}
ecx_kmgmt.c:key_to_params:
  216|      9|{
  217|      9|    if (key == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 9]
  ------------------
  218|      0|        return 0;
  219|       |
  220|      9|    if (!ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (220:9): [True: 0, False: 9]
  ------------------
  221|      9|                                           OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  433|      9|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  222|      9|                                           key->pubkey, key->keylen))
  223|      0|        return 0;
  224|       |
  225|      9|    if (include_private
  ------------------
  |  Branch (225:9): [True: 9, False: 0]
  ------------------
  226|      9|        && key->privkey != NULL
  ------------------
  |  Branch (226:12): [True: 0, False: 9]
  ------------------
  227|      9|        && !ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (227:12): [True: 0, False: 0]
  ------------------
  228|      0|                                              OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  431|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  229|      0|                                              key->privkey, key->keylen))
  230|      0|        return 0;
  231|       |
  232|      9|    return 1;
  233|      9|}
ecx_kmgmt.c:ecx_load:
  862|      9|{
  863|      9|    ECX_KEY *key = NULL;
  864|       |
  865|      9|    if (ossl_prov_is_running() && reference_sz == sizeof(key)) {
  ------------------
  |  Branch (865:9): [True: 9, False: 0]
  |  Branch (865:35): [True: 9, False: 0]
  ------------------
  866|       |        /* The contents of the reference is the address to our object */
  867|      9|        key = *(ECX_KEY **)reference;
  868|       |        /* We grabbed, so we detach it */
  869|      9|        *(ECX_KEY **)reference = NULL;
  870|      9|        return key;
  871|      9|    }
  872|      0|    return NULL;
  873|      9|}
ecx_kmgmt.c:ed25519_get_params:
  349|      3|{
  350|      3|    return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   39|      3|#  define ED25519_BITS          256
  ------------------
                  return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   41|      3|#  define ED25519_SECURITY_BITS 128
  ------------------
  |  Branch (350:12): [True: 3, False: 0]
  ------------------
  351|      3|                          ED25519_SIGSIZE)
  ------------------
  |  |   42|      3|#  define ED25519_SIGSIZE       64
  ------------------
  352|      3|        && ed_get_params(key, params);
  ------------------
  |  Branch (352:12): [True: 3, False: 0]
  ------------------
  353|      3|}
ecx_kmgmt.c:ed_get_params:
  326|      3|{
  327|      3|    OSSL_PARAM *p;
  328|       |
  329|      3|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (329:9): [True: 0, False: 3]
  ------------------
  330|      3|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  414|      3|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  331|      3|        && !OSSL_PARAM_set_utf8_string(p, ""))
  ------------------
  |  Branch (331:12): [True: 0, False: 0]
  ------------------
  332|      0|        return 0;
  333|      3|    return 1;
  334|      3|}

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

hmac_prov.c:hmac_new:
   77|     68|{
   78|     68|    struct hmac_data_st *macctx;
   79|       |
   80|     68|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (80:9): [True: 0, False: 68]
  ------------------
   81|      0|        return NULL;
   82|       |
   83|     68|    if ((macctx = OPENSSL_zalloc(sizeof(*macctx))) == NULL
  ------------------
  |  |  104|     68|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (83:9): [True: 0, False: 68]
  ------------------
   84|     68|        || (macctx->ctx = HMAC_CTX_new()) == NULL) {
  ------------------
  |  Branch (84:12): [True: 0, False: 68]
  ------------------
   85|      0|        OPENSSL_free(macctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|     68|    macctx->provctx = provctx;
   89|     68|    OSSL_FIPS_IND_INIT(macctx)
   90|       |
   91|     68|    return macctx;
   92|     68|}
hmac_prov.c:hmac_free:
   95|     68|{
   96|     68|    struct hmac_data_st *macctx = vmacctx;
   97|       |
   98|     68|    if (macctx != NULL) {
  ------------------
  |  Branch (98:9): [True: 68, False: 0]
  ------------------
   99|     68|        HMAC_CTX_free(macctx->ctx);
  100|     68|        ossl_prov_digest_reset(&macctx->digest);
  101|     68|        OPENSSL_secure_clear_free(macctx->key, macctx->keylen);
  ------------------
  |  |  129|     68|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|     68|        OPENSSL_free(macctx);
  ------------------
  |  |  115|     68|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     68|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     68|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|     68|    }
  104|     68|}
hmac_prov.c:hmac_init:
  200|     60|{
  201|     60|    struct hmac_data_st *macctx = vmacctx;
  202|       |
  203|     60|    if (!ossl_prov_is_running() || !hmac_set_ctx_params(macctx, params))
  ------------------
  |  Branch (203:9): [True: 0, False: 60]
  |  Branch (203:36): [True: 0, False: 60]
  ------------------
  204|      0|        return 0;
  205|       |
  206|     60|    if (key != NULL)
  ------------------
  |  Branch (206:9): [True: 60, False: 0]
  ------------------
  207|     60|        return hmac_setkey(macctx, key, keylen);
  208|       |
  209|       |    /* Just reinit the HMAC context */
  210|      0|    return HMAC_Init_ex(macctx->ctx, NULL, 0, NULL, NULL);
  211|     60|}
hmac_prov.c:hmac_setkey:
  157|     60|{
  158|     60|    const EVP_MD *digest;
  159|       |
  160|       |#ifdef FIPS_MODULE
  161|       |    /*
  162|       |     * KDF's pass a salt rather than a key,
  163|       |     * which is why it skips the key check unless "HMAC" is fetched directly.
  164|       |     */
  165|       |    if (!macctx->internal) {
  166|       |        OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(macctx->provctx);
  167|       |        int approved = ossl_mac_check_key_size(keylen);
  168|       |
  169|       |        if (!approved) {
  170|       |            if (!OSSL_FIPS_IND_ON_UNAPPROVED(macctx, OSSL_FIPS_IND_SETTABLE0,
  171|       |                                             libctx, "HMAC", "keysize",
  172|       |                                             ossl_fips_config_hmac_key_check)) {
  173|       |                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  174|       |                return 0;
  175|       |            }
  176|       |        }
  177|       |    }
  178|       |#endif
  179|       |
  180|     60|    if (macctx->key != NULL)
  ------------------
  |  Branch (180:9): [True: 0, False: 60]
  ------------------
  181|      0|        OPENSSL_secure_clear_free(macctx->key, macctx->keylen);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|       |    /* Keep a copy of the key in case we need it for TLS HMAC */
  183|     60|    macctx->key = OPENSSL_secure_malloc(keylen > 0 ? keylen : 1);
  ------------------
  |  |  123|    120|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     60|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     60|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (123:30): [True: 60, False: 0]
  |  |  ------------------
  ------------------
  184|     60|    if (macctx->key == NULL)
  ------------------
  |  Branch (184:9): [True: 0, False: 60]
  ------------------
  185|      0|        return 0;
  186|       |
  187|     60|    memcpy(macctx->key, key, keylen);
  188|     60|    macctx->keylen = keylen;
  189|       |
  190|     60|    digest = ossl_prov_digest_md(&macctx->digest);
  191|       |    /* HMAC_Init_ex doesn't tolerate all zero params, so we must be careful */
  192|     60|    if (key != NULL || (macctx->tls_data_size == 0 && digest != NULL))
  ------------------
  |  Branch (192:9): [True: 60, False: 0]
  |  Branch (192:25): [True: 0, False: 0]
  |  Branch (192:55): [True: 0, False: 0]
  ------------------
  193|     60|        return HMAC_Init_ex(macctx->ctx, key, keylen, digest,
  194|     60|                            ossl_prov_digest_engine(&macctx->digest));
  195|      0|    return 1;
  196|     60|}
hmac_prov.c:hmac_update:
  215|     60|{
  216|     60|    struct hmac_data_st *macctx = vmacctx;
  217|       |
  218|     60|    if (macctx->tls_data_size > 0) {
  ------------------
  |  Branch (218:9): [True: 0, False: 60]
  ------------------
  219|       |        /* We're doing a TLS HMAC */
  220|      0|        if (!macctx->tls_header_set) {
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  ------------------
  221|       |            /* We expect the first update call to contain the TLS header */
  222|      0|            if (datalen != sizeof(macctx->tls_header))
  ------------------
  |  Branch (222:17): [True: 0, False: 0]
  ------------------
  223|      0|                return 0;
  224|      0|            memcpy(macctx->tls_header, data, datalen);
  225|      0|            macctx->tls_header_set = 1;
  226|      0|            return 1;
  227|      0|        }
  228|       |        /* macctx->tls_data_size is datalen plus the padding length */
  229|      0|        if (macctx->tls_data_size < datalen)
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            return 0;
  231|       |
  232|      0|        return ssl3_cbc_digest_record(ossl_prov_digest_md(&macctx->digest),
  233|      0|                                      macctx->tls_mac_out,
  234|      0|                                      &macctx->tls_mac_out_size,
  235|      0|                                      macctx->tls_header,
  236|      0|                                      data,
  237|      0|                                      datalen,
  238|      0|                                      macctx->tls_data_size,
  239|      0|                                      macctx->key,
  240|      0|                                      macctx->keylen,
  241|      0|                                      0);
  242|      0|    }
  243|       |
  244|     60|    return HMAC_Update(macctx->ctx, data, datalen);
  245|     60|}
hmac_prov.c:hmac_final:
  249|     60|{
  250|     60|    unsigned int hlen;
  251|     60|    struct hmac_data_st *macctx = vmacctx;
  252|       |
  253|     60|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (253:9): [True: 0, False: 60]
  ------------------
  254|      0|        return 0;
  255|     60|    if (macctx->tls_data_size > 0) {
  ------------------
  |  Branch (255:9): [True: 0, False: 60]
  ------------------
  256|      0|        if (macctx->tls_mac_out_size == 0)
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|            return 0;
  258|      0|        if (outl != NULL)
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  ------------------
  259|      0|            *outl = macctx->tls_mac_out_size;
  260|      0|        memcpy(out, macctx->tls_mac_out, macctx->tls_mac_out_size);
  261|      0|        return 1;
  262|      0|    }
  263|     60|    if (!HMAC_Final(macctx->ctx, out, &hlen))
  ------------------
  |  Branch (263:9): [True: 0, False: 60]
  ------------------
  264|      0|        return 0;
  265|     60|    *outl = hlen;
  266|     60|    return 1;
  267|     60|}
hmac_prov.c:hmac_get_ctx_params:
  282|     60|{
  283|     60|    struct hmac_data_st *macctx = vmacctx;
  284|     60|    OSSL_PARAM *p;
  285|       |
  286|     60|    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
  ------------------
  |  |  347|     60|# define OSSL_MAC_PARAM_SIZE "size"
  ------------------
  |  Branch (286:9): [True: 60, False: 0]
  ------------------
  287|     60|            && !OSSL_PARAM_set_size_t(p, hmac_size(macctx)))
  ------------------
  |  Branch (287:16): [True: 0, False: 60]
  ------------------
  288|      0|        return 0;
  289|       |
  290|     60|    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_BLOCK_SIZE)) != NULL
  ------------------
  |  |  332|     60|# define OSSL_MAC_PARAM_BLOCK_SIZE "block-size"
  ------------------
  |  Branch (290:9): [True: 0, False: 60]
  ------------------
  291|     60|            && !OSSL_PARAM_set_int(p, hmac_block_size(macctx)))
  ------------------
  |  Branch (291:16): [True: 0, False: 0]
  ------------------
  292|      0|        return 0;
  293|       |
  294|       |#ifdef FIPS_MODULE
  295|       |    p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR);
  296|       |    if (p != NULL) {
  297|       |        int approved = 0;
  298|       |
  299|       |        if (!macctx->internal)
  300|       |            approved = OSSL_FIPS_IND_GET(macctx)->approved;
  301|       |        if (!OSSL_PARAM_set_int(p, approved))
  302|       |            return 0;
  303|       |    }
  304|       |#endif
  305|     60|    return 1;
  306|     60|}
hmac_prov.c:hmac_size:
  142|     60|{
  143|     60|    return HMAC_size(macctx->ctx);
  144|     60|}
hmac_prov.c:hmac_settable_ctx_params:
  320|     68|{
  321|     68|    return known_settable_ctx_params;
  322|     68|}
hmac_prov.c:hmac_set_ctx_params:
  328|    188|{
  329|    188|    struct hmac_data_st *macctx = vmacctx;
  330|    188|    OSSL_LIB_CTX *ctx = PROV_LIBCTX_OF(macctx->provctx);
  ------------------
  |  |   31|    188|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  331|    188|    const OSSL_PARAM *p;
  332|       |
  333|    188|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (333:9): [True: 120, False: 68]
  ------------------
  334|    120|        return 1;
  335|       |
  336|     68|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(macctx, OSSL_FIPS_IND_SETTABLE0, params,
  ------------------
  |  |  146|     68|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (336:9): [Folded - Ignored]
  ------------------
  337|     68|                                     OSSL_MAC_PARAM_FIPS_KEY_CHECK))
  338|      0|        return 0;
  339|       |
  340|     68|    if (!ossl_prov_digest_load_from_params(&macctx->digest, params, ctx))
  ------------------
  |  Branch (340:9): [True: 8, False: 60]
  ------------------
  341|      8|        return 0;
  342|       |
  343|     60|    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) {
  ------------------
  |  |  344|     60|# define OSSL_MAC_PARAM_KEY "key"
  ------------------
  |  Branch (343:9): [True: 0, False: 60]
  ------------------
  344|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  ------------------
  345|      0|            return 0;
  346|       |
  347|      0|        if (!hmac_setkey(macctx, p->data, p->data_size))
  ------------------
  |  Branch (347:13): [True: 0, False: 0]
  ------------------
  348|      0|            return 0;
  349|      0|    }
  350|       |
  351|     60|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (351:9): [True: 0, False: 60]
  ------------------
  352|     60|                                     OSSL_MAC_PARAM_TLS_DATA_SIZE)) != NULL) {
  ------------------
  |  |  348|     60|# define OSSL_MAC_PARAM_TLS_DATA_SIZE "tls-data-size"
  ------------------
  353|      0|        if (!OSSL_PARAM_get_size_t(p, &macctx->tls_data_size))
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            return 0;
  355|      0|    }
  356|     60|    return 1;
  357|     60|}

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

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

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

ecdsa_sig.c:ecdsa_newctx:
  143|    160|{
  144|    160|    PROV_ECDSA_CTX *ctx;
  145|       |
  146|    160|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (146:9): [True: 0, False: 160]
  ------------------
  147|      0|        return NULL;
  148|       |
  149|    160|    ctx = OPENSSL_zalloc(sizeof(PROV_ECDSA_CTX));
  ------------------
  |  |  104|    160|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  150|    160|    if (ctx == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 160]
  ------------------
  151|      0|        return NULL;
  152|       |
  153|    160|    OSSL_FIPS_IND_INIT(ctx)
  154|    160|    ctx->flag_allow_md = 1;
  155|       |#ifdef FIPS_MODULE
  156|       |    ctx->verify_message = 1;
  157|       |#endif
  158|    160|    ctx->libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    160|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  159|    160|    if (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == NULL) {
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 160]
  |  Branch (159:26): [True: 0, False: 0]
  ------------------
  160|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  161|      0|        ctx = NULL;
  162|      0|    }
  163|    160|    return ctx;
  164|    160|}
ecdsa_sig.c:ecdsa_signverify_init:
  275|    160|{
  276|    160|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (276:9): [True: 0, False: 160]
  ------------------
  277|    160|            || ctx == NULL)
  ------------------
  |  Branch (277:16): [True: 0, False: 160]
  ------------------
  278|      0|        return 0;
  279|       |
  280|    160|    if (ec == NULL && ctx->ec == NULL) {
  ------------------
  |  Branch (280:9): [True: 0, False: 160]
  |  Branch (280:23): [True: 0, False: 0]
  ------------------
  281|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return 0;
  283|      0|    }
  284|       |
  285|    160|    if (ec != NULL) {
  ------------------
  |  Branch (285:9): [True: 160, False: 0]
  ------------------
  286|    160|        if (!EC_KEY_up_ref(ec))
  ------------------
  |  Branch (286:13): [True: 0, False: 160]
  ------------------
  287|      0|            return 0;
  288|    160|        EC_KEY_free(ctx->ec);
  289|    160|        ctx->ec = ec;
  290|    160|    }
  291|       |
  292|    160|    ctx->operation = operation;
  293|       |
  294|    160|    OSSL_FIPS_IND_SET_APPROVED(ctx)
  295|    160|    if (!set_ctx_params(ctx, params))
  ------------------
  |  Branch (295:9): [True: 0, False: 160]
  ------------------
  296|      0|        return 0;
  297|       |#ifdef FIPS_MODULE
  298|       |    if (!ossl_fips_ind_ec_key_check(OSSL_FIPS_IND_GET(ctx),
  299|       |                                    OSSL_FIPS_IND_SETTABLE0, ctx->libctx,
  300|       |                                    EC_KEY_get0_group(ctx->ec), desc,
  301|       |                                    (operation & (EVP_PKEY_OP_SIGN
  302|       |                                                  | EVP_PKEY_OP_SIGNMSG)) != 0))
  303|       |        return 0;
  304|       |#endif
  305|    160|    return 1;
  306|    160|}
ecdsa_sig.c:ecdsa_verify_set_sig:
  453|    160|{
  454|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  455|    160|    OSSL_PARAM params[2];
  456|       |
  457|    160|    params[0] =
  458|    160|        OSSL_PARAM_construct_octet_string(OSSL_SIGNATURE_PARAM_SIGNATURE,
  ------------------
  |  |  561|    160|# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
  ------------------
  459|    160|                                          (unsigned char *)sig, siglen);
  460|    160|    params[1] = OSSL_PARAM_construct_end();
  461|    160|    return ecdsa_sigalg_set_ctx_params(ctx, params);
  462|    160|}
ecdsa_sig.c:ecdsa_verify_directly:
  442|    160|{
  443|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  444|       |
  445|    160|    if (!ossl_prov_is_running() || (ctx->mdsize != 0 && tbslen != ctx->mdsize))
  ------------------
  |  Branch (445:9): [True: 0, False: 160]
  |  Branch (445:37): [True: 160, False: 0]
  |  Branch (445:57): [True: 0, False: 160]
  ------------------
  446|      0|        return 0;
  447|       |
  448|    160|    return ECDSA_verify(0, tbs, tbslen, sig, siglen, ctx->ec);
  449|    160|}
ecdsa_sig.c:ecdsa_digest_signverify_init:
  509|    160|{
  510|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  511|       |
  512|    160|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (512:9): [True: 0, False: 160]
  ------------------
  513|      0|        return 0;
  514|       |
  515|       |#ifdef FIPS_MODULE
  516|       |    ctx->verify_message = 1;
  517|       |#endif
  518|    160|    if (!ecdsa_signverify_init(vctx, ec, ecdsa_set_ctx_params, params,
  ------------------
  |  Branch (518:9): [True: 0, False: 160]
  ------------------
  519|    160|                               operation, desc))
  520|      0|        return 0;
  521|       |
  522|    160|    if (mdname != NULL
  ------------------
  |  Branch (522:9): [True: 160, False: 0]
  ------------------
  523|       |        /* was ecdsa_setup_md already called in ecdsa_signverify_init()? */
  524|    160|        && (mdname[0] == '\0' || OPENSSL_strcasecmp(ctx->mdname, mdname) != 0)
  ------------------
  |  Branch (524:13): [True: 0, False: 160]
  |  Branch (524:34): [True: 160, False: 0]
  ------------------
  525|    160|        && !ecdsa_setup_md(ctx, mdname, NULL, desc))
  ------------------
  |  Branch (525:12): [True: 0, False: 160]
  ------------------
  526|      0|        return 0;
  527|       |
  528|    160|    ctx->flag_allow_md = 0;
  529|       |
  530|    160|    if (ctx->mdctx == NULL) {
  ------------------
  |  Branch (530:9): [True: 160, False: 0]
  ------------------
  531|    160|        ctx->mdctx = EVP_MD_CTX_new();
  532|    160|        if (ctx->mdctx == NULL)
  ------------------
  |  Branch (532:13): [True: 0, False: 160]
  ------------------
  533|      0|            goto error;
  534|    160|    }
  535|       |
  536|    160|    if (!EVP_DigestInit_ex2(ctx->mdctx, ctx->md, params))
  ------------------
  |  Branch (536:9): [True: 0, False: 160]
  ------------------
  537|      0|        goto error;
  538|    160|    return 1;
  539|      0|error:
  540|      0|    EVP_MD_CTX_free(ctx->mdctx);
  541|      0|    ctx->mdctx = NULL;
  542|      0|    return 0;
  543|    160|}
ecdsa_sig.c:ecdsa_setup_md:
  169|    160|{
  170|    160|    EVP_MD *md = NULL;
  171|    160|    size_t mdname_len;
  172|    160|    int md_nid, md_size;
  173|    160|    WPACKET pkt;
  174|    160|    unsigned char *aid = NULL;
  175|       |
  176|    160|    if (mdname == NULL)
  ------------------
  |  Branch (176:9): [True: 0, False: 160]
  ------------------
  177|      0|        return 1;
  178|       |
  179|    160|    mdname_len = strlen(mdname);
  180|    160|    if (mdname_len >= sizeof(ctx->mdname)) {
  ------------------
  |  Branch (180:9): [True: 0, False: 160]
  ------------------
  181|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  182|      0|                       "%s exceeds name buffer length", mdname);
  183|      0|        return 0;
  184|      0|    }
  185|    160|    if (mdprops == NULL)
  ------------------
  |  Branch (185:9): [True: 160, False: 0]
  ------------------
  186|    160|        mdprops = ctx->propq;
  187|    160|    md = EVP_MD_fetch(ctx->libctx, mdname, mdprops);
  188|    160|    if (md == NULL) {
  ------------------
  |  Branch (188:9): [True: 0, False: 160]
  ------------------
  189|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  190|      0|                       "%s could not be fetched", mdname);
  191|      0|        return 0;
  192|      0|    }
  193|    160|    md_size = EVP_MD_get_size(md);
  194|    160|    if (md_size <= 0) {
  ------------------
  |  Branch (194:9): [True: 0, False: 160]
  ------------------
  195|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  196|      0|                       "%s has invalid md size %d", mdname, md_size);
  197|      0|        goto err;
  198|      0|    }
  199|    160|    md_nid = ossl_digest_get_approved_nid(md);
  200|       |#ifdef FIPS_MODULE
  201|       |    if (md_nid == NID_undef) {
  202|       |        ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  203|       |                       "digest=%s", mdname);
  204|       |        goto err;
  205|       |    }
  206|       |#endif
  207|       |    /* XOF digests don't work */
  208|    160|    if (EVP_MD_xof(md)) {
  ------------------
  |  Branch (208:9): [True: 0, False: 160]
  ------------------
  209|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|        goto err;
  211|      0|    }
  212|       |
  213|       |#ifdef FIPS_MODULE
  214|       |    {
  215|       |        int sha1_allowed
  216|       |            = ((ctx->operation
  217|       |                & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG)) == 0);
  218|       |
  219|       |        if (!ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND_GET(ctx),
  220|       |                                             OSSL_FIPS_IND_SETTABLE1,
  221|       |                                             ctx->libctx,
  222|       |                                             md_nid, sha1_allowed, desc,
  223|       |                                             ossl_fips_config_signature_digest_check))
  224|       |            goto err;
  225|       |    }
  226|       |#endif
  227|       |
  228|    160|    if (!ctx->flag_allow_md) {
  ------------------
  |  Branch (228:9): [True: 0, False: 160]
  ------------------
  229|      0|        if (ctx->mdname[0] != '\0' && !EVP_MD_is_a(md, ctx->mdname)) {
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  |  Branch (229:39): [True: 0, False: 0]
  ------------------
  230|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |   35|      0|# define PROV_R_DIGEST_NOT_ALLOWED                        174
  ------------------
  231|      0|                           "digest %s != %s", mdname, ctx->mdname);
  232|      0|            goto err;
  233|      0|        }
  234|      0|        EVP_MD_free(md);
  235|      0|        return 1;
  236|      0|    }
  237|       |
  238|    160|    EVP_MD_CTX_free(ctx->mdctx);
  239|    160|    EVP_MD_free(ctx->md);
  240|       |
  241|    160|    ctx->aid_len = 0;
  242|    160|#ifndef FIPS_MODULE
  243|    160|    if (md_nid != NID_undef) {
  ------------------
  |  |   18|    160|#define NID_undef                       0
  ------------------
  |  Branch (243:9): [True: 160, False: 0]
  ------------------
  244|       |#else
  245|       |    {
  246|       |#endif
  247|    160|        if (WPACKET_init_der(&pkt, ctx->aid_buf, sizeof(ctx->aid_buf))
  ------------------
  |  Branch (247:13): [True: 160, False: 0]
  ------------------
  248|    160|            && ossl_DER_w_algorithmIdentifier_ECDSA_with_MD(&pkt, -1, ctx->ec,
  ------------------
  |  Branch (248:16): [True: 160, False: 0]
  ------------------
  249|    160|                                                            md_nid)
  250|    160|            && WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (250:16): [True: 160, False: 0]
  ------------------
  251|    160|            WPACKET_get_total_written(&pkt, &ctx->aid_len);
  252|    160|            aid = WPACKET_get_curr(&pkt);
  253|    160|        }
  254|    160|        WPACKET_cleanup(&pkt);
  255|    160|        if (aid != NULL && ctx->aid_len != 0)
  ------------------
  |  Branch (255:13): [True: 160, False: 0]
  |  Branch (255:28): [True: 160, False: 0]
  ------------------
  256|    160|            memmove(ctx->aid_buf, aid, ctx->aid_len);
  257|    160|    }
  258|       |
  259|    160|    ctx->mdctx = NULL;
  260|    160|    ctx->md = md;
  261|    160|    ctx->mdsize = (size_t)md_size;
  262|    160|    OPENSSL_strlcpy(ctx->mdname, mdname, sizeof(ctx->mdname));
  263|       |
  264|    160|    return 1;
  265|      0| err:
  266|      0|    EVP_MD_free(md);
  267|      0|    return 0;
  268|    160|}
ecdsa_sig.c:ecdsa_digest_signverify_update:
  555|    160|{
  556|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  557|       |
  558|    160|    if (ctx == NULL || ctx->mdctx == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 160]
  |  Branch (558:24): [True: 0, False: 160]
  ------------------
  559|      0|        return 0;
  560|       |    /* Sigalg implementations shouldn't do digest_sign */
  561|    160|    if (ctx->flag_sigalg)
  ------------------
  |  Branch (561:9): [True: 0, False: 160]
  ------------------
  562|      0|        return 0;
  563|       |
  564|    160|    return ecdsa_signverify_message_update(vctx, data, datalen);
  565|    160|}
ecdsa_sig.c:ecdsa_digest_verify_init:
  588|    160|{
  589|    160|    return ecdsa_digest_signverify_init(vctx, mdname, ec, params,
  590|    160|                                        EVP_PKEY_OP_VERIFYMSG,
  ------------------
  |  | 1759|    160|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  591|    160|                                        "ECDSA Digest Verify Init");
  592|    160|}
ecdsa_sig.c:ecdsa_digest_verify_final:
  596|    160|{
  597|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  598|    160|    int ok = 0;
  599|       |
  600|    160|    if (!ossl_prov_is_running() || ctx == NULL || ctx->mdctx == NULL)
  ------------------
  |  Branch (600:9): [True: 0, False: 160]
  |  Branch (600:36): [True: 0, False: 160]
  |  Branch (600:51): [True: 0, False: 160]
  ------------------
  601|      0|        return 0;
  602|       |
  603|       |    /* Sigalg implementations shouldn't do digest_verify */
  604|    160|    if (ctx->flag_sigalg)
  ------------------
  |  Branch (604:9): [True: 0, False: 160]
  ------------------
  605|      0|        return 0;
  606|       |
  607|    160|    if (ecdsa_verify_set_sig(ctx, sig, siglen))
  ------------------
  |  Branch (607:9): [True: 160, False: 0]
  ------------------
  608|    160|        ok = ecdsa_verify_message_final(ctx);
  609|       |
  610|    160|    ctx->flag_allow_md = 1;
  611|       |
  612|    160|    return ok;
  613|    160|}
ecdsa_sig.c:ecdsa_freectx:
  616|    320|{
  617|    320|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  618|       |
  619|    320|    EVP_MD_CTX_free(ctx->mdctx);
  620|    320|    EVP_MD_free(ctx->md);
  621|    320|    OPENSSL_free(ctx->propq);
  ------------------
  |  |  115|    320|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    320|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    320|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  622|    320|    OPENSSL_free(ctx->sig);
  ------------------
  |  |  115|    320|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    320|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    320|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  623|    320|    EC_KEY_free(ctx->ec);
  624|    320|    BN_clear_free(ctx->kinv);
  625|    320|    BN_clear_free(ctx->r);
  626|    320|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    320|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    320|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    320|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  627|    320|}
ecdsa_sig.c:ecdsa_dupctx:
  630|    160|{
  631|    160|    PROV_ECDSA_CTX *srcctx = (PROV_ECDSA_CTX *)vctx;
  632|    160|    PROV_ECDSA_CTX *dstctx;
  633|       |
  634|    160|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (634:9): [True: 0, False: 160]
  ------------------
  635|      0|        return NULL;
  636|       |
  637|    160|    dstctx = OPENSSL_zalloc(sizeof(*srcctx));
  ------------------
  |  |  104|    160|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  638|    160|    if (dstctx == NULL)
  ------------------
  |  Branch (638:9): [True: 0, False: 160]
  ------------------
  639|      0|        return NULL;
  640|       |
  641|    160|    *dstctx = *srcctx;
  642|    160|    dstctx->ec = NULL;
  643|    160|    dstctx->propq = NULL;
  644|       |
  645|    160|    if (srcctx->ec != NULL && !EC_KEY_up_ref(srcctx->ec))
  ------------------
  |  Branch (645:9): [True: 160, False: 0]
  |  Branch (645:31): [True: 0, False: 160]
  ------------------
  646|      0|        goto err;
  647|       |    /* Test KATS should not need to be supported */
  648|    160|    if (srcctx->kinv != NULL || srcctx->r != NULL)
  ------------------
  |  Branch (648:9): [True: 0, False: 160]
  |  Branch (648:33): [True: 0, False: 160]
  ------------------
  649|      0|        goto err;
  650|    160|    dstctx->ec = srcctx->ec;
  651|       |
  652|    160|    if (srcctx->md != NULL && !EVP_MD_up_ref(srcctx->md))
  ------------------
  |  Branch (652:9): [True: 160, False: 0]
  |  Branch (652:31): [True: 0, False: 160]
  ------------------
  653|      0|        goto err;
  654|    160|    dstctx->md = srcctx->md;
  655|       |
  656|    160|    if (srcctx->mdctx != NULL) {
  ------------------
  |  Branch (656:9): [True: 160, False: 0]
  ------------------
  657|    160|        dstctx->mdctx = EVP_MD_CTX_new();
  658|    160|        if (dstctx->mdctx == NULL
  ------------------
  |  Branch (658:13): [True: 0, False: 160]
  ------------------
  659|    160|                || !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx))
  ------------------
  |  Branch (659:20): [True: 0, False: 160]
  ------------------
  660|      0|            goto err;
  661|    160|    }
  662|       |
  663|    160|    if (srcctx->propq != NULL) {
  ------------------
  |  Branch (663:9): [True: 0, False: 160]
  ------------------
  664|      0|        dstctx->propq = OPENSSL_strdup(srcctx->propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  665|      0|        if (dstctx->propq == NULL)
  ------------------
  |  Branch (665:13): [True: 0, False: 0]
  ------------------
  666|      0|            goto err;
  667|      0|    }
  668|       |
  669|    160|    return dstctx;
  670|      0| err:
  671|      0|    ecdsa_freectx(dstctx);
  672|      0|    return NULL;
  673|    160|}
ecdsa_sig.c:ecdsa_set_ctx_params:
  770|    160|{
  771|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  772|    160|    const OSSL_PARAM *p;
  773|    160|    size_t mdsize = 0;
  774|    160|    int ret;
  775|       |
  776|    160|    if (ctx == NULL)
  ------------------
  |  Branch (776:9): [True: 0, False: 160]
  ------------------
  777|      0|        return 0;
  778|    160|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (778:9): [True: 160, False: 0]
  ------------------
  779|    160|        return 1;
  780|       |
  781|      0|    if ((ret = ecdsa_common_set_ctx_params(ctx, params)) <= 0)
  ------------------
  |  Branch (781:9): [True: 0, False: 0]
  ------------------
  782|      0|        return ret;
  783|       |
  784|      0|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST);
  ------------------
  |  |  542|      0|# define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  366|      0|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  785|      0|    if (p != NULL) {
  ------------------
  |  Branch (785:9): [True: 0, False: 0]
  ------------------
  786|      0|        char mdname[OSSL_MAX_NAME_SIZE] = "", *pmdname = mdname;
  787|      0|        char mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmdprops = mdprops;
  788|      0|        const OSSL_PARAM *propsp =
  789|      0|            OSSL_PARAM_locate_const(params,
  790|      0|                                    OSSL_SIGNATURE_PARAM_PROPERTIES);
  ------------------
  |  |  559|      0|# define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  432|      0|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  791|       |
  792|      0|        if (!OSSL_PARAM_get_utf8_string(p, &pmdname, sizeof(mdname)))
  ------------------
  |  Branch (792:13): [True: 0, False: 0]
  ------------------
  793|      0|            return 0;
  794|      0|        if (propsp != NULL
  ------------------
  |  Branch (794:13): [True: 0, False: 0]
  ------------------
  795|      0|            && !OSSL_PARAM_get_utf8_string(propsp, &pmdprops, sizeof(mdprops)))
  ------------------
  |  Branch (795:16): [True: 0, False: 0]
  ------------------
  796|      0|            return 0;
  797|      0|        if (!ecdsa_setup_md(ctx, mdname, mdprops, "ECDSA Set Ctx"))
  ------------------
  |  Branch (797:13): [True: 0, False: 0]
  ------------------
  798|      0|            return 0;
  799|      0|    }
  800|       |
  801|      0|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
  ------------------
  |  |  543|      0|# define OSSL_SIGNATURE_PARAM_DIGEST_SIZE OSSL_PKEY_PARAM_DIGEST_SIZE
  |  |  ------------------
  |  |  |  |  367|      0|# define OSSL_PKEY_PARAM_DIGEST_SIZE "digest-size"
  |  |  ------------------
  ------------------
  802|      0|    if (p != NULL) {
  ------------------
  |  Branch (802:9): [True: 0, False: 0]
  ------------------
  803|      0|        if (!OSSL_PARAM_get_size_t(p, &mdsize)
  ------------------
  |  Branch (803:13): [True: 0, False: 0]
  ------------------
  804|      0|            || (!ctx->flag_allow_md && mdsize != ctx->mdsize))
  ------------------
  |  Branch (804:17): [True: 0, False: 0]
  |  Branch (804:40): [True: 0, False: 0]
  ------------------
  805|      0|            return 0;
  806|      0|        ctx->mdsize = mdsize;
  807|      0|    }
  808|      0|    return 1;
  809|      0|}
ecdsa_sig.c:ecdsa_common_set_ctx_params:
  738|    160|{
  739|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  740|    160|    const OSSL_PARAM *p;
  741|       |
  742|    160|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
  ------------------
  |  |  146|    160|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (742:9): [Folded - Ignored]
  ------------------
  743|    160|                                     OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK))
  744|      0|        return 0;
  745|    160|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, params,
  ------------------
  |  |  146|    160|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (745:9): [Folded - Ignored]
  ------------------
  746|    160|                                     OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK))
  747|      0|        return 0;
  748|       |
  749|       |#if !defined(OPENSSL_NO_ACVP_TESTS)
  750|       |    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_KAT);
  751|       |    if (p != NULL && !OSSL_PARAM_get_uint(p, &ctx->kattest))
  752|       |        return 0;
  753|       |#endif
  754|       |
  755|    160|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE);
  ------------------
  |  |  557|    160|# define OSSL_SIGNATURE_PARAM_NONCE_TYPE "nonce-type"
  ------------------
  756|    160|    if (p != NULL
  ------------------
  |  Branch (756:9): [True: 0, False: 160]
  ------------------
  757|    160|        && !OSSL_PARAM_get_uint(p, &ctx->nonce_type))
  ------------------
  |  Branch (757:12): [True: 0, False: 0]
  ------------------
  758|      0|        return 0;
  759|    160|    return 1;
  760|    160|}
ecdsa_sig.c:ecdsa_signverify_message_update:
  374|    160|{
  375|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  376|       |
  377|    160|    if (ctx == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 160]
  ------------------
  378|      0|        return 0;
  379|       |
  380|    160|    return EVP_DigestUpdate(ctx->mdctx, data, datalen);
  381|    160|}
ecdsa_sig.c:ecdsa_verify_message_final:
  465|    160|{
  466|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  467|    160|    unsigned char digest[EVP_MAX_MD_SIZE];
  468|    160|    unsigned int dlen = 0;
  469|       |
  470|    160|    if (!ossl_prov_is_running() || ctx == NULL || ctx->mdctx == NULL)
  ------------------
  |  Branch (470:9): [True: 0, False: 160]
  |  Branch (470:36): [True: 0, False: 160]
  |  Branch (470:51): [True: 0, False: 160]
  ------------------
  471|      0|        return 0;
  472|       |
  473|       |    /*
  474|       |     * The digests used here are all known (see ecdsa_get_md_nid()), so they
  475|       |     * should not exceed the internal buffer size of EVP_MAX_MD_SIZE.
  476|       |     */
  477|    160|    if (!EVP_DigestFinal_ex(ctx->mdctx, digest, &dlen))
  ------------------
  |  Branch (477:9): [True: 0, False: 160]
  ------------------
  478|      0|        return 0;
  479|       |
  480|    160|    return ecdsa_verify_directly(vctx, ctx->sig, ctx->siglen,
  481|    160|                               digest, dlen);
  482|    160|}
ecdsa_sig.c:ecdsa_sigalg_set_ctx_params:
  977|    160|{
  978|    160|    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
  979|    160|    const OSSL_PARAM *p;
  980|    160|    int ret;
  981|       |
  982|    160|    if (ctx == NULL)
  ------------------
  |  Branch (982:9): [True: 0, False: 160]
  ------------------
  983|      0|        return 0;
  984|    160|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (984:9): [True: 0, False: 160]
  ------------------
  985|      0|        return 1;
  986|       |
  987|    160|    if ((ret = ecdsa_common_set_ctx_params(ctx, params)) <= 0)
  ------------------
  |  Branch (987:9): [True: 0, False: 160]
  ------------------
  988|      0|        return ret;
  989|       |
  990|    160|    if (ctx->operation == EVP_PKEY_OP_VERIFYMSG) {
  ------------------
  |  | 1759|    160|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (990:9): [True: 160, False: 0]
  ------------------
  991|    160|        p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_SIGNATURE);
  ------------------
  |  |  561|    160|# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
  ------------------
  992|    160|        if (p != NULL) {
  ------------------
  |  Branch (992:13): [True: 160, False: 0]
  ------------------
  993|    160|            OPENSSL_free(ctx->sig);
  ------------------
  |  |  115|    160|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    160|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    160|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  994|    160|            ctx->sig = NULL;
  995|    160|            ctx->siglen = 0;
  996|    160|            if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->sig,
  ------------------
  |  Branch (996:17): [True: 0, False: 160]
  ------------------
  997|    160|                                             0, &ctx->siglen))
  998|      0|                return 0;
  999|    160|        }
 1000|    160|    }
 1001|    160|    return 1;
 1002|    160|}

rsa_sig.c:rsa_newctx:
  228|    822|{
  229|    822|    PROV_RSA_CTX *prsactx = NULL;
  230|    822|    char *propq_copy = NULL;
  231|       |
  232|    822|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (232:9): [True: 0, False: 822]
  ------------------
  233|      0|        return NULL;
  234|       |
  235|    822|    if ((prsactx = OPENSSL_zalloc(sizeof(PROV_RSA_CTX))) == NULL
  ------------------
  |  |  104|    822|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    822|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    822|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (235:9): [True: 0, False: 822]
  ------------------
  236|    822|        || (propq != NULL
  ------------------
  |  Branch (236:13): [True: 0, False: 822]
  ------------------
  237|    822|            && (propq_copy = OPENSSL_strdup(propq)) == NULL)) {
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (237:16): [True: 0, False: 0]
  ------------------
  238|      0|        OPENSSL_free(prsactx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  239|      0|        return NULL;
  240|      0|    }
  241|       |
  242|    822|    OSSL_FIPS_IND_INIT(prsactx)
  243|    822|    prsactx->libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    822|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  244|    822|    prsactx->flag_allow_md = 1;
  245|       |#ifdef FIPS_MODULE
  246|       |    prsactx->verify_message = 1;
  247|       |#endif
  248|    822|    prsactx->propq = propq_copy;
  249|       |    /* Maximum up to digest length for sign, auto for verify */
  250|    822|    prsactx->saltlen = RSA_PSS_SALTLEN_AUTO_DIGEST_MAX;
  ------------------
  |  |  145|    822|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
  251|    822|    prsactx->min_saltlen = -1;
  252|    822|    return prsactx;
  253|    822|}
rsa_sig.c:rsa_signverify_init:
  507|    822|{
  508|    822|    int protect;
  509|       |
  510|    822|    if (!ossl_prov_is_running() || prsactx == NULL)
  ------------------
  |  Branch (510:9): [True: 0, False: 822]
  |  Branch (510:36): [True: 0, False: 822]
  ------------------
  511|      0|        return 0;
  512|       |
  513|    822|    if (vrsa == NULL && prsactx->rsa == NULL) {
  ------------------
  |  Branch (513:9): [True: 0, False: 822]
  |  Branch (513:25): [True: 0, False: 0]
  ------------------
  514|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  515|      0|        return 0;
  516|      0|    }
  517|       |
  518|    822|    if (vrsa != NULL) {
  ------------------
  |  Branch (518:9): [True: 822, False: 0]
  ------------------
  519|    822|        if (!RSA_up_ref(vrsa))
  ------------------
  |  Branch (519:13): [True: 0, False: 822]
  ------------------
  520|      0|            return 0;
  521|    822|        RSA_free(prsactx->rsa);
  522|    822|        prsactx->rsa = vrsa;
  523|    822|    }
  524|    822|    if (!ossl_rsa_key_op_get_protect(prsactx->rsa, operation, &protect))
  ------------------
  |  Branch (524:9): [True: 0, False: 822]
  ------------------
  525|      0|        return 0;
  526|       |
  527|    822|    prsactx->operation = operation;
  528|    822|    prsactx->flag_allow_update = 1;
  529|    822|    prsactx->flag_allow_final = 1;
  530|    822|    prsactx->flag_allow_oneshot = 1;
  531|       |
  532|       |    /* Maximize up to digest length for sign, auto for verify */
  533|    822|    prsactx->saltlen = RSA_PSS_SALTLEN_AUTO_DIGEST_MAX;
  ------------------
  |  |  145|    822|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
  534|    822|    prsactx->min_saltlen = -1;
  535|       |
  536|    822|    switch (RSA_test_flags(prsactx->rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    822|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  537|    783|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    783|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (537:5): [True: 783, False: 39]
  ------------------
  538|    783|        prsactx->pad_mode = RSA_PKCS1_PADDING;
  ------------------
  |  |  194|    783|# define RSA_PKCS1_PADDING          1
  ------------------
  539|    783|        break;
  540|     39|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|     39|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (540:5): [True: 39, False: 783]
  ------------------
  541|     39|        prsactx->pad_mode = RSA_PKCS1_PSS_PADDING;
  ------------------
  |  |  200|     39|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  542|       |
  543|     39|        {
  544|     39|            const RSA_PSS_PARAMS_30 *pss =
  545|     39|                ossl_rsa_get0_pss_params_30(prsactx->rsa);
  546|       |
  547|     39|            if (!ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (547:17): [True: 25, False: 14]
  ------------------
  548|     25|                int md_nid = ossl_rsa_pss_params_30_hashalg(pss);
  549|     25|                int mgf1md_nid = ossl_rsa_pss_params_30_maskgenhashalg(pss);
  550|     25|                int min_saltlen = ossl_rsa_pss_params_30_saltlen(pss);
  551|     25|                const char *mdname, *mgf1mdname;
  552|     25|                size_t len;
  553|       |
  554|     25|                mdname = ossl_rsa_oaeppss_nid2name(md_nid);
  555|     25|                mgf1mdname = ossl_rsa_oaeppss_nid2name(mgf1md_nid);
  556|       |
  557|     25|                if (mdname == NULL) {
  ------------------
  |  Branch (557:21): [True: 0, False: 25]
  ------------------
  558|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  559|      0|                                   "PSS restrictions lack hash algorithm");
  560|      0|                    return 0;
  561|      0|                }
  562|     25|                if (mgf1mdname == NULL) {
  ------------------
  |  Branch (562:21): [True: 0, False: 25]
  ------------------
  563|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  564|      0|                                   "PSS restrictions lack MGF1 hash algorithm");
  565|      0|                    return 0;
  566|      0|                }
  567|       |
  568|     25|                len = OPENSSL_strlcpy(prsactx->mdname, mdname,
  569|     25|                                      sizeof(prsactx->mdname));
  570|     25|                if (len >= sizeof(prsactx->mdname)) {
  ------------------
  |  Branch (570:21): [True: 0, False: 25]
  ------------------
  571|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  572|      0|                                   "hash algorithm name too long");
  573|      0|                    return 0;
  574|      0|                }
  575|     25|                len = OPENSSL_strlcpy(prsactx->mgf1_mdname, mgf1mdname,
  576|     25|                                      sizeof(prsactx->mgf1_mdname));
  577|     25|                if (len >= sizeof(prsactx->mgf1_mdname)) {
  ------------------
  |  Branch (577:21): [True: 0, False: 25]
  ------------------
  578|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  579|      0|                                   "MGF1 hash algorithm name too long");
  580|      0|                    return 0;
  581|      0|                }
  582|     25|                prsactx->saltlen = min_saltlen;
  583|       |
  584|       |                /* call rsa_setup_mgf1_md before rsa_setup_md to avoid duplication */
  585|     25|                if (!rsa_setup_mgf1_md(prsactx, mgf1mdname, prsactx->propq)
  ------------------
  |  Branch (585:21): [True: 0, False: 25]
  ------------------
  586|     25|                    || !rsa_setup_md(prsactx, mdname, prsactx->propq, desc)
  ------------------
  |  Branch (586:24): [True: 0, False: 25]
  ------------------
  587|     25|                    || !rsa_check_parameters(prsactx, min_saltlen))
  ------------------
  |  Branch (587:24): [True: 3, False: 22]
  ------------------
  588|      3|                    return 0;
  589|     25|            }
  590|     39|        }
  591|       |
  592|     36|        break;
  593|     36|    default:
  ------------------
  |  Branch (593:5): [True: 0, False: 822]
  ------------------
  594|      0|        ERR_raise(ERR_LIB_RSA, PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  595|      0|        return 0;
  596|    822|    }
  597|       |
  598|    819|    OSSL_FIPS_IND_SET_APPROVED(prsactx)
  599|    819|    if (!set_ctx_params(prsactx, params))
  ------------------
  |  Branch (599:9): [True: 0, False: 819]
  ------------------
  600|      0|        return 0;
  601|       |#ifdef FIPS_MODULE
  602|       |    if (!ossl_fips_ind_rsa_key_check(OSSL_FIPS_IND_GET(prsactx),
  603|       |                                     OSSL_FIPS_IND_SETTABLE0, prsactx->libctx,
  604|       |                                     prsactx->rsa, desc, protect))
  605|       |        return 0;
  606|       |#endif
  607|    819|    return 1;
  608|    819|}
rsa_sig.c:rsa_setup_mgf1_md:
  465|    523|{
  466|    523|    size_t len;
  467|    523|    EVP_MD *md = NULL;
  468|    523|    int mdnid;
  469|       |
  470|    523|    if (mdprops == NULL)
  ------------------
  |  Branch (470:9): [True: 523, False: 0]
  ------------------
  471|    523|        mdprops = ctx->propq;
  472|       |
  473|    523|    if ((md = EVP_MD_fetch(ctx->libctx, mdname, mdprops)) == NULL) {
  ------------------
  |  Branch (473:9): [True: 0, False: 523]
  ------------------
  474|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  475|      0|                       "%s could not be fetched", mdname);
  476|      0|        return 0;
  477|      0|    }
  478|       |    /* The default for mgf1 is SHA1 - so allow SHA1 */
  479|    523|    if ((mdnid = ossl_digest_rsa_sign_get_md_nid(md)) <= 0
  ------------------
  |  Branch (479:9): [True: 0, False: 523]
  ------------------
  480|    523|        || !rsa_check_padding(ctx, NULL, mdname, mdnid)) {
  ------------------
  |  Branch (480:12): [True: 0, False: 523]
  ------------------
  481|      0|        if (mdnid <= 0)
  ------------------
  |  Branch (481:13): [True: 0, False: 0]
  ------------------
  482|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |   35|      0|# define PROV_R_DIGEST_NOT_ALLOWED                        174
  ------------------
  483|      0|                           "digest=%s", mdname);
  484|      0|        EVP_MD_free(md);
  485|      0|        return 0;
  486|      0|    }
  487|    523|    len = OPENSSL_strlcpy(ctx->mgf1_mdname, mdname, sizeof(ctx->mgf1_mdname));
  488|    523|    if (len >= sizeof(ctx->mgf1_mdname)) {
  ------------------
  |  Branch (488:9): [True: 0, False: 523]
  ------------------
  489|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  490|      0|                       "%s exceeds name buffer length", mdname);
  491|      0|        EVP_MD_free(md);
  492|      0|        return 0;
  493|      0|    }
  494|       |
  495|    523|    EVP_MD_free(ctx->mgf1_md);
  496|    523|    ctx->mgf1_md = md;
  497|    523|    ctx->mgf1_mdnid = mdnid;
  498|    523|    ctx->mgf1_md_set = 1;
  499|    523|    return 1;
  500|    523|}
rsa_sig.c:rsa_check_padding:
  179|  2.82k|{
  180|  2.82k|    switch (prsactx->pad_mode) {
  181|      0|    case RSA_NO_PADDING:
  ------------------
  |  |  195|      0|# define RSA_NO_PADDING             3
  ------------------
  |  Branch (181:5): [True: 0, False: 2.82k]
  ------------------
  182|      0|        if (mdname != NULL || mdnid != NID_undef) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (182:13): [True: 0, False: 0]
  |  Branch (182:31): [True: 0, False: 0]
  ------------------
  183|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  184|      0|            return 0;
  185|      0|        }
  186|      0|        break;
  187|      0|    case RSA_X931_PADDING:
  ------------------
  |  |  197|      0|# define RSA_X931_PADDING           5
  ------------------
  |  Branch (187:5): [True: 0, False: 2.82k]
  ------------------
  188|      0|        if (RSA_X931_hash_id(mdnid) == -1) {
  ------------------
  |  Branch (188:13): [True: 0, False: 0]
  ------------------
  189|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_X931_DIGEST);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  190|      0|            return 0;
  191|      0|        }
  192|      0|        break;
  193|  2.05k|    case RSA_PKCS1_PSS_PADDING:
  ------------------
  |  |  200|  2.05k|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (193:5): [True: 2.05k, False: 769]
  ------------------
  194|  2.05k|        if (rsa_pss_restricted(prsactx))
  ------------------
  |  |  161|  2.05k|#define rsa_pss_restricted(prsactx) (prsactx->min_saltlen != -1)
  |  |  ------------------
  |  |  |  Branch (161:37): [True: 88, False: 1.96k]
  |  |  ------------------
  ------------------
  195|     88|            if ((mdname != NULL && !EVP_MD_is_a(prsactx->md, mdname))
  ------------------
  |  Branch (195:18): [True: 0, False: 88]
  |  Branch (195:36): [True: 0, False: 0]
  ------------------
  196|     88|                || (mgf1_mdname != NULL
  ------------------
  |  Branch (196:21): [True: 22, False: 66]
  ------------------
  197|     88|                    && !EVP_MD_is_a(prsactx->mgf1_md, mgf1_mdname))) {
  ------------------
  |  Branch (197:24): [True: 0, False: 22]
  ------------------
  198|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|                return 0;
  200|      0|            }
  201|  2.05k|        break;
  202|  2.05k|    default:
  ------------------
  |  Branch (202:5): [True: 769, False: 2.05k]
  ------------------
  203|    769|        break;
  204|  2.82k|    }
  205|       |
  206|  2.82k|    return 1;
  207|  2.82k|}
rsa_sig.c:rsa_setup_md:
  372|    822|{
  373|    822|    EVP_MD *md = NULL;
  374|       |
  375|    822|    if (mdprops == NULL)
  ------------------
  |  Branch (375:9): [True: 822, False: 0]
  ------------------
  376|    822|        mdprops = ctx->propq;
  377|       |
  378|    822|    if (mdname != NULL) {
  ------------------
  |  Branch (378:9): [True: 822, False: 0]
  ------------------
  379|    822|        int md_nid;
  380|    822|        size_t mdname_len = strlen(mdname);
  381|       |
  382|    822|        md = EVP_MD_fetch(ctx->libctx, mdname, mdprops);
  383|       |
  384|    822|        if (md == NULL) {
  ------------------
  |  Branch (384:13): [True: 14, False: 808]
  ------------------
  385|     14|            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|     14|    (ERR_new(),                                                 \
  |  |  404|     14|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|     14|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|     14|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|     14|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|     14|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|     14|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|     14|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  386|     14|                           "%s could not be fetched", mdname);
  387|     14|            goto err;
  388|     14|        }
  389|    808|        md_nid = ossl_digest_rsa_sign_get_md_nid(md);
  390|    808|        if (md_nid == NID_undef) {
  ------------------
  |  |   18|    808|#define NID_undef                       0
  ------------------
  |  Branch (390:13): [True: 0, False: 808]
  ------------------
  391|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |   35|      0|# define PROV_R_DIGEST_NOT_ALLOWED                        174
  ------------------
  392|      0|                           "digest=%s", mdname);
  393|      0|            goto err;
  394|      0|        }
  395|       |        /*
  396|       |         * XOF digests are not allowed except for RSA PSS.
  397|       |         * We don't support XOF digests with RSA PSS (yet), so just fail.
  398|       |         * When we do support them, uncomment the second clause.
  399|       |         */
  400|    808|        if (EVP_MD_xof(md)
  ------------------
  |  Branch (400:13): [True: 0, False: 808]
  ------------------
  401|    808|                /* && ctx->pad_mode != RSA_PKCS1_PSS_PADDING */) {
  402|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  403|      0|            goto err;
  404|      0|        }
  405|       |#ifdef FIPS_MODULE
  406|       |        {
  407|       |            int sha1_allowed
  408|       |                = ((ctx->operation
  409|       |                    & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG)) == 0);
  410|       |
  411|       |            if (!ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND_GET(ctx),
  412|       |                                                 OSSL_FIPS_IND_SETTABLE1,
  413|       |                                                 ctx->libctx,
  414|       |                                                 md_nid, sha1_allowed, desc,
  415|       |                                                 ossl_fips_config_signature_digest_check))
  416|       |                goto err;
  417|       |        }
  418|       |#endif
  419|       |
  420|    808|        if (!rsa_check_padding(ctx, mdname, NULL, md_nid))
  ------------------
  |  Branch (420:13): [True: 0, False: 808]
  ------------------
  421|      0|            goto err;
  422|    808|        if (mdname_len >= sizeof(ctx->mdname)) {
  ------------------
  |  Branch (422:13): [True: 0, False: 808]
  ------------------
  423|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
  ------------------
  |  |   65|      0|# define PROV_R_INVALID_DIGEST                            122
  ------------------
  424|      0|                           "%s exceeds name buffer length", mdname);
  425|      0|            goto err;
  426|      0|        }
  427|       |
  428|    808|        if (!ctx->flag_allow_md) {
  ------------------
  |  Branch (428:13): [True: 0, False: 808]
  ------------------
  429|      0|            if (ctx->mdname[0] != '\0' && !EVP_MD_is_a(md, ctx->mdname)) {
  ------------------
  |  Branch (429:17): [True: 0, False: 0]
  |  Branch (429:43): [True: 0, False: 0]
  ------------------
  430|      0|                ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                              ERR_raise_data(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED,
  ------------------
  |  |   35|      0|# define PROV_R_DIGEST_NOT_ALLOWED                        174
  ------------------
  431|      0|                               "digest %s != %s", mdname, ctx->mdname);
  432|      0|                goto err;
  433|      0|            }
  434|      0|            EVP_MD_free(md);
  435|      0|            return 1;
  436|      0|        }
  437|       |
  438|    808|        if (!ctx->mgf1_md_set) {
  ------------------
  |  Branch (438:13): [True: 783, False: 25]
  ------------------
  439|    783|            if (!EVP_MD_up_ref(md)) {
  ------------------
  |  Branch (439:17): [True: 0, False: 783]
  ------------------
  440|      0|                goto err;
  441|      0|            }
  442|    783|            EVP_MD_free(ctx->mgf1_md);
  443|    783|            ctx->mgf1_md = md;
  444|    783|            ctx->mgf1_mdnid = md_nid;
  445|    783|            OPENSSL_strlcpy(ctx->mgf1_mdname, mdname, sizeof(ctx->mgf1_mdname));
  446|    783|        }
  447|       |
  448|    808|        EVP_MD_CTX_free(ctx->mdctx);
  449|    808|        EVP_MD_free(ctx->md);
  450|       |
  451|    808|        ctx->mdctx = NULL;
  452|    808|        ctx->md = md;
  453|    808|        ctx->mdnid = md_nid;
  454|    808|        OPENSSL_strlcpy(ctx->mdname, mdname, sizeof(ctx->mdname));
  455|    808|    }
  456|       |
  457|    808|    return 1;
  458|     14|err:
  459|     14|    EVP_MD_free(md);
  460|     14|    return 0;
  461|    822|}
rsa_sig.c:rsa_check_parameters:
  210|     25|{
  211|     25|    if (prsactx->pad_mode == RSA_PKCS1_PSS_PADDING) {
  ------------------
  |  |  200|     25|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (211:9): [True: 25, False: 0]
  ------------------
  212|     25|        int max_saltlen;
  213|       |
  214|       |        /* See if minimum salt length exceeds maximum possible */
  215|     25|        max_saltlen = RSA_size(prsactx->rsa) - EVP_MD_get_size(prsactx->md);
  216|     25|        if ((RSA_bits(prsactx->rsa) & 0x7) == 1)
  ------------------
  |  Branch (216:13): [True: 1, False: 24]
  ------------------
  217|      1|            max_saltlen--;
  218|     25|        if (min_saltlen < 0 || min_saltlen > max_saltlen) {
  ------------------
  |  Branch (218:13): [True: 0, False: 25]
  |  Branch (218:32): [True: 3, False: 22]
  ------------------
  219|      3|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      3|            return 0;
  221|      3|        }
  222|     22|        prsactx->min_saltlen = min_saltlen;
  223|     22|    }
  224|     22|    return 1;
  225|     25|}
rsa_sig.c:rsa_get_md_size:
  164|    498|{
  165|    498|    int md_size;
  166|       |
  167|    498|    if (prsactx->md != NULL) {
  ------------------
  |  Branch (167:9): [True: 498, False: 0]
  ------------------
  168|    498|        md_size = EVP_MD_get_size(prsactx->md);
  169|    498|        if (md_size <= 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 498]
  ------------------
  170|      0|            return 0;
  171|    498|        return md_size;
  172|    498|    }
  173|      0|    return 0;
  174|    498|}
rsa_sig.c:setup_tbuf:
  611|    498|{
  612|    498|    if (ctx->tbuf != NULL)
  ------------------
  |  Branch (612:9): [True: 0, False: 498]
  ------------------
  613|      0|        return 1;
  614|    498|    if ((ctx->tbuf = OPENSSL_malloc(RSA_size(ctx->rsa))) == NULL)
  ------------------
  |  |  102|    498|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    498|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    498|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (614:9): [True: 1, False: 497]
  ------------------
  615|      1|        return 0;
  616|    497|    return 1;
  617|    498|}
rsa_sig.c:clean_tbuf:
  620|  1.62k|{
  621|  1.62k|    if (ctx->tbuf != NULL)
  ------------------
  |  Branch (621:9): [True: 497, False: 1.13k]
  ------------------
  622|    497|        OPENSSL_cleanse(ctx->tbuf, RSA_size(ctx->rsa));
  623|  1.62k|}
rsa_sig.c:rsa_verify_set_sig:
 1120|    805|{
 1121|    805|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1122|    805|    OSSL_PARAM params[2];
 1123|       |
 1124|    805|    params[0] =
 1125|    805|        OSSL_PARAM_construct_octet_string(OSSL_SIGNATURE_PARAM_SIGNATURE,
  ------------------
  |  |  561|    805|# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
  ------------------
 1126|    805|                                          (unsigned char *)sig, siglen);
 1127|    805|    params[1] = OSSL_PARAM_construct_end();
 1128|    805|    return rsa_sigalg_set_ctx_params(prsactx, params);
 1129|    805|}
rsa_sig.c:rsa_verify_directly:
 1031|    805|{
 1032|    805|    size_t rslen;
 1033|       |
 1034|    805|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (1034:9): [True: 0, False: 805]
  ------------------
 1035|      0|        return 0;
 1036|    805|    if (prsactx->md != NULL) {
  ------------------
  |  Branch (1036:9): [True: 805, False: 0]
  ------------------
 1037|    805|        switch (prsactx->pad_mode) {
 1038|    307|        case RSA_PKCS1_PADDING:
  ------------------
  |  |  194|    307|# define RSA_PKCS1_PADDING          1
  ------------------
  |  Branch (1038:9): [True: 307, False: 498]
  ------------------
 1039|    307|            if (!RSA_verify(prsactx->mdnid, tbs, tbslen, sig, siglen,
  ------------------
  |  Branch (1039:17): [True: 284, False: 23]
  ------------------
 1040|    307|                            prsactx->rsa)) {
 1041|    284|                ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
  ------------------
  |  |  401|    284|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    284|    (ERR_new(),                                                 \
  |  |  |  |  404|    284|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    284|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    284|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    284|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    284|     ERR_set_error)
  |  |  ------------------
  ------------------
 1042|    284|                return 0;
 1043|    284|            }
 1044|     23|            return 1;
 1045|      0|        case RSA_X931_PADDING:
  ------------------
  |  |  197|      0|# define RSA_X931_PADDING           5
  ------------------
  |  Branch (1045:9): [True: 0, False: 805]
  ------------------
 1046|      0|            if (!setup_tbuf(prsactx))
  ------------------
  |  Branch (1046:17): [True: 0, False: 0]
  ------------------
 1047|      0|                return 0;
 1048|      0|            if (rsa_verify_recover(prsactx, prsactx->tbuf, &rslen, 0,
  ------------------
  |  Branch (1048:17): [True: 0, False: 0]
  ------------------
 1049|      0|                                   sig, siglen) <= 0)
 1050|      0|                return 0;
 1051|      0|            break;
 1052|    498|        case RSA_PKCS1_PSS_PADDING:
  ------------------
  |  |  200|    498|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (1052:9): [True: 498, False: 307]
  ------------------
 1053|    498|            {
 1054|    498|                int ret;
 1055|    498|                int saltlen;
 1056|    498|                size_t mdsize;
 1057|       |
 1058|       |                /*
 1059|       |                 * We need to check this for the RSA_verify_PKCS1_PSS_mgf1()
 1060|       |                 * call
 1061|       |                 */
 1062|    498|                mdsize = rsa_get_md_size(prsactx);
 1063|    498|                if (tbslen != mdsize) {
  ------------------
  |  Branch (1063:21): [True: 0, False: 498]
  ------------------
 1064|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH,
  ------------------
  |  |   66|      0|# define PROV_R_INVALID_DIGEST_LENGTH                     166
  ------------------
 1065|      0|                                   "Should be %d, but got %d",
 1066|      0|                                   mdsize, tbslen);
 1067|      0|                    return 0;
 1068|      0|                }
 1069|       |
 1070|    498|                if (!setup_tbuf(prsactx))
  ------------------
  |  Branch (1070:21): [True: 1, False: 497]
  ------------------
 1071|      1|                    return 0;
 1072|    497|                ret = RSA_public_decrypt(siglen, sig, prsactx->tbuf,
 1073|    497|                                         prsactx->rsa, RSA_NO_PADDING);
  ------------------
  |  |  195|    497|# define RSA_NO_PADDING             3
  ------------------
 1074|    497|                if (ret <= 0) {
  ------------------
  |  Branch (1074:21): [True: 90, False: 407]
  ------------------
 1075|     90|                    ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
  ------------------
  |  |  401|     90|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     90|    (ERR_new(),                                                 \
  |  |  |  |  404|     90|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     90|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     90|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     90|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     90|     ERR_set_error)
  |  |  ------------------
  ------------------
 1076|     90|                    return 0;
 1077|     90|                }
 1078|    407|                saltlen = prsactx->saltlen;
 1079|    407|                ret = ossl_rsa_verify_PKCS1_PSS_mgf1(prsactx->rsa, tbs,
 1080|    407|                                                     prsactx->md, prsactx->mgf1_md,
 1081|    407|                                                     prsactx->tbuf,
 1082|    407|                                                     &saltlen);
 1083|    407|                if (ret <= 0) {
  ------------------
  |  Branch (1083:21): [True: 407, False: 0]
  ------------------
 1084|    407|                    ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
  ------------------
  |  |  401|    407|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    407|    (ERR_new(),                                                 \
  |  |  |  |  404|    407|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    407|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    407|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    407|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    407|     ERR_set_error)
  |  |  ------------------
  ------------------
 1085|    407|                    return 0;
 1086|    407|                }
 1087|       |#ifdef FIPS_MODULE
 1088|       |                if (!rsa_pss_saltlen_check_passed(prsactx, "RSA Verify", saltlen))
 1089|       |                    return 0;
 1090|       |#endif
 1091|      0|                return 1;
 1092|    407|            }
 1093|      0|        default:
  ------------------
  |  Branch (1093:9): [True: 0, False: 805]
  ------------------
 1094|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE,
  ------------------
  |  |   80|      0|# define PROV_R_INVALID_PADDING_MODE                      168
  ------------------
 1095|      0|                           "Only X.931, PKCS#1 v1.5 or PSS padding allowed");
 1096|      0|            return 0;
 1097|    805|        }
 1098|    805|    } else {
 1099|      0|        int ret;
 1100|       |
 1101|      0|        if (!setup_tbuf(prsactx))
  ------------------
  |  Branch (1101:13): [True: 0, False: 0]
  ------------------
 1102|      0|            return 0;
 1103|      0|        ret = RSA_public_decrypt(siglen, sig, prsactx->tbuf, prsactx->rsa,
 1104|      0|                                 prsactx->pad_mode);
 1105|      0|        if (ret <= 0) {
  ------------------
  |  Branch (1105:13): [True: 0, False: 0]
  ------------------
 1106|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1107|      0|            return 0;
 1108|      0|        }
 1109|      0|        rslen = (size_t)ret;
 1110|      0|    }
 1111|       |
 1112|      0|    if ((rslen != tbslen) || memcmp(tbs, prsactx->tbuf, rslen))
  ------------------
  |  Branch (1112:9): [True: 0, False: 0]
  |  Branch (1112:30): [True: 0, False: 0]
  ------------------
 1113|      0|        return 0;
 1114|       |
 1115|      0|    return 1;
 1116|      0|}
rsa_sig.c:rsa_digest_signverify_init:
 1190|    822|{
 1191|    822|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1192|       |
 1193|       |#ifdef FIPS_MODULE
 1194|       |    if (prsactx != NULL)
 1195|       |        prsactx->verify_message = 1;
 1196|       |#endif
 1197|       |
 1198|    822|    if (!rsa_signverify_init(prsactx, vrsa, rsa_set_ctx_params, params,
  ------------------
  |  Branch (1198:9): [True: 3, False: 819]
  ------------------
 1199|    822|                             operation, desc))
 1200|      3|        return 0;
 1201|       |
 1202|    819|    if (mdname != NULL
  ------------------
  |  Branch (1202:9): [True: 819, False: 0]
  ------------------
 1203|       |        /* was rsa_setup_md already called in rsa_signverify_init()? */
 1204|    819|        && (mdname[0] == '\0' || OPENSSL_strcasecmp(prsactx->mdname, mdname) != 0)
  ------------------
  |  Branch (1204:13): [True: 0, False: 819]
  |  Branch (1204:34): [True: 797, False: 22]
  ------------------
 1205|    819|        && !rsa_setup_md(prsactx, mdname, prsactx->propq, desc))
  ------------------
  |  Branch (1205:12): [True: 14, False: 783]
  ------------------
 1206|     14|        return 0;
 1207|       |
 1208|    805|    prsactx->flag_allow_md = 0;
 1209|       |
 1210|    805|    if (prsactx->mdctx == NULL) {
  ------------------
  |  Branch (1210:9): [True: 805, False: 0]
  ------------------
 1211|    805|        prsactx->mdctx = EVP_MD_CTX_new();
 1212|    805|        if (prsactx->mdctx == NULL)
  ------------------
  |  Branch (1212:13): [True: 0, False: 805]
  ------------------
 1213|      0|            goto error;
 1214|    805|    }
 1215|       |
 1216|    805|    if (!EVP_DigestInit_ex2(prsactx->mdctx, prsactx->md, params))
  ------------------
  |  Branch (1216:9): [True: 0, False: 805]
  ------------------
 1217|      0|        goto error;
 1218|       |
 1219|    805|    return 1;
 1220|       |
 1221|      0| error:
 1222|      0|    EVP_MD_CTX_free(prsactx->mdctx);
 1223|      0|    prsactx->mdctx = NULL;
 1224|      0|    return 0;
 1225|    805|}
rsa_sig.c:rsa_digest_verify_init:
 1273|    822|{
 1274|    822|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (1274:9): [True: 0, False: 822]
  ------------------
 1275|      0|        return 0;
 1276|    822|    return rsa_digest_signverify_init(vprsactx, mdname, vrsa,
 1277|    822|                                      params, EVP_PKEY_OP_VERIFYMSG,
  ------------------
  |  | 1759|    822|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
 1278|    822|                                      "RSA Digest Verify Init");
 1279|    822|}
rsa_sig.c:rsa_digest_verify_update:
 1283|    805|{
 1284|    805|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1285|       |
 1286|    805|    if (prsactx == NULL)
  ------------------
  |  Branch (1286:9): [True: 0, False: 805]
  ------------------
 1287|      0|        return 0;
 1288|       |    /* Sigalg implementations shouldn't do digest_sign */
 1289|    805|    if (prsactx->flag_sigalg)
  ------------------
  |  Branch (1289:9): [True: 0, False: 805]
  ------------------
 1290|      0|        return 0;
 1291|       |
 1292|    805|    return rsa_signverify_message_update(prsactx, data, datalen);
 1293|    805|}
rsa_sig.c:rsa_digest_verify_final:
 1297|    805|{
 1298|    805|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1299|    805|    int ok = 0;
 1300|       |
 1301|    805|    if (prsactx == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 805]
  ------------------
 1302|      0|        return 0;
 1303|       |    /* Sigalg implementations shouldn't do digest_verify */
 1304|    805|    if (prsactx->flag_sigalg)
  ------------------
  |  Branch (1304:9): [True: 0, False: 805]
  ------------------
 1305|      0|        return 0;
 1306|       |
 1307|    805|    if (rsa_verify_set_sig(prsactx, sig, siglen)
  ------------------
  |  Branch (1307:9): [True: 805, False: 0]
  ------------------
 1308|    805|        && rsa_verify_message_final(vprsactx))
  ------------------
  |  Branch (1308:12): [True: 23, False: 782]
  ------------------
 1309|     23|        ok = 1;
 1310|       |
 1311|    805|    prsactx->flag_allow_md = 1;
 1312|       |
 1313|    805|    return ok;
 1314|    805|}
rsa_sig.c:rsa_freectx:
 1317|  1.62k|{
 1318|  1.62k|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1319|       |
 1320|  1.62k|    if (prsactx == NULL)
  ------------------
  |  Branch (1320:9): [True: 0, False: 1.62k]
  ------------------
 1321|      0|        return;
 1322|       |
 1323|  1.62k|    EVP_MD_CTX_free(prsactx->mdctx);
 1324|  1.62k|    EVP_MD_free(prsactx->md);
 1325|  1.62k|    EVP_MD_free(prsactx->mgf1_md);
 1326|  1.62k|    OPENSSL_free(prsactx->sig);
  ------------------
  |  |  115|  1.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1327|  1.62k|    OPENSSL_free(prsactx->propq);
  ------------------
  |  |  115|  1.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1328|  1.62k|    free_tbuf(prsactx);
 1329|  1.62k|    RSA_free(prsactx->rsa);
 1330|       |
 1331|  1.62k|    OPENSSL_clear_free(prsactx, sizeof(*prsactx));
  ------------------
  |  |  113|  1.62k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1332|  1.62k|}
rsa_sig.c:free_tbuf:
  626|  1.62k|{
  627|  1.62k|    clean_tbuf(ctx);
  628|  1.62k|    OPENSSL_free(ctx->tbuf);
  ------------------
  |  |  115|  1.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  629|  1.62k|    ctx->tbuf = NULL;
  630|  1.62k|}
rsa_sig.c:rsa_dupctx:
 1335|    805|{
 1336|    805|    PROV_RSA_CTX *srcctx = (PROV_RSA_CTX *)vprsactx;
 1337|    805|    PROV_RSA_CTX *dstctx;
 1338|       |
 1339|    805|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (1339:9): [True: 0, False: 805]
  ------------------
 1340|      0|        return NULL;
 1341|       |
 1342|    805|    dstctx = OPENSSL_zalloc(sizeof(*srcctx));
  ------------------
  |  |  104|    805|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    805|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    805|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1343|    805|    if (dstctx == NULL)
  ------------------
  |  Branch (1343:9): [True: 0, False: 805]
  ------------------
 1344|      0|        return NULL;
 1345|       |
 1346|    805|    *dstctx = *srcctx;
 1347|    805|    dstctx->rsa = NULL;
 1348|    805|    dstctx->md = NULL;
 1349|    805|    dstctx->mgf1_md = NULL;
 1350|    805|    dstctx->mdctx = NULL;
 1351|    805|    dstctx->tbuf = NULL;
 1352|    805|    dstctx->propq = NULL;
 1353|       |
 1354|    805|    if (srcctx->rsa != NULL && !RSA_up_ref(srcctx->rsa))
  ------------------
  |  Branch (1354:9): [True: 805, False: 0]
  |  Branch (1354:32): [True: 0, False: 805]
  ------------------
 1355|      0|        goto err;
 1356|    805|    dstctx->rsa = srcctx->rsa;
 1357|       |
 1358|    805|    if (srcctx->md != NULL && !EVP_MD_up_ref(srcctx->md))
  ------------------
  |  Branch (1358:9): [True: 805, False: 0]
  |  Branch (1358:31): [True: 0, False: 805]
  ------------------
 1359|      0|        goto err;
 1360|    805|    dstctx->md = srcctx->md;
 1361|       |
 1362|    805|    if (srcctx->mgf1_md != NULL && !EVP_MD_up_ref(srcctx->mgf1_md))
  ------------------
  |  Branch (1362:9): [True: 805, False: 0]
  |  Branch (1362:36): [True: 0, False: 805]
  ------------------
 1363|      0|        goto err;
 1364|    805|    dstctx->mgf1_md = srcctx->mgf1_md;
 1365|       |
 1366|    805|    if (srcctx->mdctx != NULL) {
  ------------------
  |  Branch (1366:9): [True: 805, False: 0]
  ------------------
 1367|    805|        dstctx->mdctx = EVP_MD_CTX_new();
 1368|    805|        if (dstctx->mdctx == NULL
  ------------------
  |  Branch (1368:13): [True: 0, False: 805]
  ------------------
 1369|    805|                || !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx))
  ------------------
  |  Branch (1369:20): [True: 0, False: 805]
  ------------------
 1370|      0|            goto err;
 1371|    805|    }
 1372|       |
 1373|    805|    if (srcctx->propq != NULL) {
  ------------------
  |  Branch (1373:9): [True: 0, False: 805]
  ------------------
 1374|      0|        dstctx->propq = OPENSSL_strdup(srcctx->propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1375|      0|        if (dstctx->propq == NULL)
  ------------------
  |  Branch (1375:13): [True: 0, False: 0]
  ------------------
 1376|      0|            goto err;
 1377|      0|    }
 1378|       |
 1379|    805|    return dstctx;
 1380|      0| err:
 1381|      0|    rsa_freectx(dstctx);
 1382|      0|    return NULL;
 1383|    805|}
rsa_sig.c:rsa_set_ctx_params:
 1533|  2.31k|{
 1534|  2.31k|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1535|  2.31k|    const OSSL_PARAM *p;
 1536|  2.31k|    int pad_mode;
 1537|  2.31k|    int saltlen;
 1538|  2.31k|    char mdname[OSSL_MAX_NAME_SIZE] = "", *pmdname = NULL;
 1539|  2.31k|    char mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmdprops = NULL;
 1540|  2.31k|    char mgf1mdname[OSSL_MAX_NAME_SIZE] = "", *pmgf1mdname = NULL;
 1541|  2.31k|    char mgf1mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmgf1mdprops = NULL;
 1542|       |
 1543|  2.31k|    if (prsactx == NULL)
  ------------------
  |  Branch (1543:9): [True: 0, False: 2.31k]
  ------------------
 1544|      0|        return 0;
 1545|  2.31k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (1545:9): [True: 819, False: 1.49k]
  ------------------
 1546|    819|        return 1;
 1547|       |
 1548|  1.49k|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, params,
  ------------------
  |  |  146|  1.49k|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (1548:9): [Folded - Ignored]
  ------------------
 1549|  1.49k|                                     OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK))
 1550|      0|        return 0;
 1551|       |
 1552|  1.49k|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE1, params,
  ------------------
  |  |  146|  1.49k|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (1552:9): [Folded - Ignored]
  ------------------
 1553|  1.49k|                                     OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK))
 1554|      0|        return 0;
 1555|       |
 1556|  1.49k|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE2, params,
  ------------------
  |  |  146|  1.49k|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (1556:9): [Folded - Ignored]
  ------------------
 1557|  1.49k|                                     OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK))
 1558|      0|        return 0;
 1559|       |
 1560|  1.49k|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE3, params,
  ------------------
  |  |  146|  1.49k|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (1560:9): [Folded - Ignored]
  ------------------
 1561|  1.49k|                                     OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK))
 1562|      0|        return 0;
 1563|       |
 1564|  1.49k|    pad_mode = prsactx->pad_mode;
 1565|  1.49k|    saltlen = prsactx->saltlen;
 1566|       |
 1567|  1.49k|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST);
  ------------------
  |  |  542|  1.49k|# define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  366|  1.49k|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  122|  1.49k|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1568|  1.49k|    if (p != NULL) {
  ------------------
  |  Branch (1568:9): [True: 0, False: 1.49k]
  ------------------
 1569|      0|        const OSSL_PARAM *propsp =
 1570|      0|            OSSL_PARAM_locate_const(params,
 1571|      0|                                    OSSL_SIGNATURE_PARAM_PROPERTIES);
  ------------------
  |  |  559|      0|# define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  432|      0|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1572|       |
 1573|      0|        pmdname = mdname;
 1574|      0|        if (!OSSL_PARAM_get_utf8_string(p, &pmdname, sizeof(mdname)))
  ------------------
  |  Branch (1574:13): [True: 0, False: 0]
  ------------------
 1575|      0|            return 0;
 1576|       |
 1577|      0|        if (propsp != NULL) {
  ------------------
  |  Branch (1577:13): [True: 0, False: 0]
  ------------------
 1578|      0|            pmdprops = mdprops;
 1579|      0|            if (!OSSL_PARAM_get_utf8_string(propsp,
  ------------------
  |  Branch (1579:17): [True: 0, False: 0]
  ------------------
 1580|      0|                                            &pmdprops, sizeof(mdprops)))
 1581|      0|                return 0;
 1582|      0|        }
 1583|      0|    }
 1584|       |
 1585|  1.49k|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_PAD_MODE);
  ------------------
  |  |  558|  1.49k|# define OSSL_SIGNATURE_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
  |  |  ------------------
  |  |  |  |  430|  1.49k|# define OSSL_PKEY_PARAM_PAD_MODE "pad-mode"
  |  |  ------------------
  ------------------
 1586|  1.49k|    if (p != NULL) {
  ------------------
  |  Branch (1586:9): [True: 498, False: 996]
  ------------------
 1587|    498|        const char *err_extra_text = NULL;
 1588|       |
 1589|    498|        switch (p->data_type) {
 1590|    498|        case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */
  ------------------
  |  |  106|    498|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (1590:9): [True: 498, False: 0]
  ------------------
 1591|    498|            if (!OSSL_PARAM_get_int(p, &pad_mode))
  ------------------
  |  Branch (1591:17): [True: 0, False: 498]
  ------------------
 1592|      0|                return 0;
 1593|    498|            break;
 1594|    498|        case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1594:9): [True: 0, False: 498]
  ------------------
 1595|      0|            {
 1596|      0|                int i;
 1597|       |
 1598|      0|                if (p->data == NULL)
  ------------------
  |  Branch (1598:21): [True: 0, False: 0]
  ------------------
 1599|      0|                    return 0;
 1600|       |
 1601|      0|                for (i = 0; padding_item[i].id != 0; i++) {
  ------------------
  |  Branch (1601:29): [True: 0, False: 0]
  ------------------
 1602|      0|                    if (strcmp(p->data, padding_item[i].ptr) == 0) {
  ------------------
  |  Branch (1602:25): [True: 0, False: 0]
  ------------------
 1603|      0|                        pad_mode = padding_item[i].id;
 1604|      0|                        break;
 1605|      0|                    }
 1606|      0|                }
 1607|      0|            }
 1608|      0|            break;
 1609|      0|        default:
  ------------------
  |  Branch (1609:9): [True: 0, False: 498]
  ------------------
 1610|      0|            return 0;
 1611|    498|        }
 1612|       |
 1613|    498|        switch (pad_mode) {
 1614|      0|        case RSA_PKCS1_OAEP_PADDING:
  ------------------
  |  |  196|      0|# define RSA_PKCS1_OAEP_PADDING     4
  ------------------
  |  Branch (1614:9): [True: 0, False: 498]
  ------------------
 1615|       |            /*
 1616|       |             * OAEP padding is for asymmetric cipher only so is not compatible
 1617|       |             * with signature use.
 1618|       |             */
 1619|      0|            err_extra_text = "OAEP padding not allowed for signing / verifying";
 1620|      0|            goto bad_pad;
 1621|    498|        case RSA_PKCS1_PSS_PADDING:
  ------------------
  |  |  200|    498|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (1621:9): [True: 498, False: 0]
  ------------------
 1622|    498|            if ((prsactx->operation
  ------------------
  |  Branch (1622:17): [True: 0, False: 498]
  ------------------
 1623|    498|                 & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG
  ------------------
  |  | 1748|    498|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
                               & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG
  ------------------
  |  | 1758|    498|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
 1624|    498|                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG)) == 0) {
  ------------------
  |  | 1749|    498|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
                                  | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG)) == 0) {
  ------------------
  |  | 1759|    498|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
 1625|      0|                err_extra_text =
 1626|      0|                    "PSS padding only allowed for sign and verify operations";
 1627|      0|                goto bad_pad;
 1628|      0|            }
 1629|    498|            break;
 1630|    498|        case RSA_PKCS1_PADDING:
  ------------------
  |  |  194|      0|# define RSA_PKCS1_PADDING          1
  ------------------
  |  Branch (1630:9): [True: 0, False: 498]
  ------------------
 1631|      0|            err_extra_text = "PKCS#1 padding not allowed with RSA-PSS";
 1632|      0|            goto cont;
 1633|      0|        case RSA_NO_PADDING:
  ------------------
  |  |  195|      0|# define RSA_NO_PADDING             3
  ------------------
  |  Branch (1633:9): [True: 0, False: 498]
  ------------------
 1634|      0|            err_extra_text = "No padding not allowed with RSA-PSS";
 1635|      0|            goto cont;
 1636|      0|        case RSA_X931_PADDING:
  ------------------
  |  |  197|      0|# define RSA_X931_PADDING           5
  ------------------
  |  Branch (1636:9): [True: 0, False: 498]
  ------------------
 1637|       |#ifdef FIPS_MODULE
 1638|       |            /* X9.31 only allows sizes of 1024 + 256 * s (bits) */
 1639|       |            if ((RSA_bits(prsactx->rsa) & 0xFF) != 0) {
 1640|       |                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
 1641|       |                return 0;
 1642|       |            }
 1643|       |            /* RSA Signing with X9.31 padding is not allowed in FIPS 140-3 */
 1644|       |            if (!rsa_x931_padding_allowed(prsactx))
 1645|       |                return 0;
 1646|       |#endif
 1647|      0|            err_extra_text = "X.931 padding not allowed with RSA-PSS";
 1648|      0|        cont:
 1649|      0|            if (RSA_test_flags(prsactx->rsa,
  ------------------
  |  Branch (1649:17): [True: 0, False: 0]
  ------------------
 1650|      0|                               RSA_FLAG_TYPE_MASK) == RSA_FLAG_TYPE_RSA)
  ------------------
  |  |  117|      0|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
                                             RSA_FLAG_TYPE_MASK) == RSA_FLAG_TYPE_RSA)
  ------------------
  |  |  118|      0|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
 1651|      0|                break;
 1652|       |            /* FALLTHRU */
 1653|      0|        default:
  ------------------
  |  Branch (1653:9): [True: 0, False: 498]
  ------------------
 1654|      0|        bad_pad:
 1655|      0|            if (err_extra_text == NULL)
  ------------------
  |  Branch (1655:17): [True: 0, False: 0]
  ------------------
 1656|      0|                ERR_raise(ERR_LIB_PROV,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1657|      0|                          PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE);
 1658|      0|            else
 1659|      0|                ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
 1660|      0|                               PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE,
  ------------------
  |  |   54|      0|# define PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE       165
  ------------------
 1661|      0|                               err_extra_text);
 1662|      0|            return 0;
 1663|    498|        }
 1664|    498|    }
 1665|       |
 1666|  1.49k|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_PSS_SALTLEN);
  ------------------
  |  |  560|  1.49k|# define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "saltlen"
  ------------------
 1667|  1.49k|    if (p != NULL) {
  ------------------
  |  Branch (1667:9): [True: 498, False: 996]
  ------------------
 1668|    498|        if (pad_mode != RSA_PKCS1_PSS_PADDING) {
  ------------------
  |  |  200|    498|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (1668:13): [True: 0, False: 498]
  ------------------
 1669|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_NOT_SUPPORTED,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_NOT_SUPPORTED,
  ------------------
  |  |  119|      0|# define PROV_R_NOT_SUPPORTED                             136
  ------------------
 1670|      0|                           "PSS saltlen can only be specified if "
 1671|      0|                           "PSS padding has been specified first");
 1672|      0|            return 0;
 1673|      0|        }
 1674|       |
 1675|    498|        switch (p->data_type) {
 1676|      0|        case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (1676:9): [True: 0, False: 498]
  ------------------
 1677|      0|            if (!OSSL_PARAM_get_int(p, &saltlen))
  ------------------
  |  Branch (1677:17): [True: 0, False: 0]
  ------------------
 1678|      0|                return 0;
 1679|      0|            break;
 1680|    498|        case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|    498|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1680:9): [True: 498, False: 0]
  ------------------
 1681|    498|            if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST) == 0)
  ------------------
  |  |   90|    498|# define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest"
  ------------------
  |  Branch (1681:17): [True: 0, False: 498]
  ------------------
 1682|      0|                saltlen = RSA_PSS_SALTLEN_DIGEST;
  ------------------
  |  |  138|      0|# define RSA_PSS_SALTLEN_DIGEST -1
  ------------------
 1683|    498|            else if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_MAX) == 0)
  ------------------
  |  |   91|    498|# define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX    "max"
  ------------------
  |  Branch (1683:22): [True: 0, False: 498]
  ------------------
 1684|      0|                saltlen = RSA_PSS_SALTLEN_MAX;
  ------------------
  |  |  142|      0|# define RSA_PSS_SALTLEN_MAX    -3
  ------------------
 1685|    498|            else if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO) == 0)
  ------------------
  |  |   92|    498|# define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO   "auto"
  ------------------
  |  Branch (1685:22): [True: 0, False: 498]
  ------------------
 1686|      0|                saltlen = RSA_PSS_SALTLEN_AUTO;
  ------------------
  |  |  140|      0|# define RSA_PSS_SALTLEN_AUTO   -2
  ------------------
 1687|    498|            else if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX) == 0)
  ------------------
  |  |   93|    498|# define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX "auto-digestmax"
  ------------------
  |  Branch (1687:22): [True: 0, False: 498]
  ------------------
 1688|      0|                saltlen = RSA_PSS_SALTLEN_AUTO_DIGEST_MAX;
  ------------------
  |  |  145|      0|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
 1689|    498|            else
 1690|    498|                saltlen = atoi(p->data);
 1691|    498|            break;
 1692|      0|        default:
  ------------------
  |  Branch (1692:9): [True: 0, False: 498]
  ------------------
 1693|      0|            return 0;
 1694|    498|        }
 1695|       |
 1696|       |        /*
 1697|       |         * RSA_PSS_SALTLEN_AUTO_DIGEST_MAX seems curiously named in this check.
 1698|       |         * Contrary to what it's name suggests, it's the currently lowest
 1699|       |         * saltlen number possible.
 1700|       |         */
 1701|    498|        if (saltlen < RSA_PSS_SALTLEN_AUTO_DIGEST_MAX) {
  ------------------
  |  |  145|    498|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
  |  Branch (1701:13): [True: 0, False: 498]
  ------------------
 1702|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1703|      0|            return 0;
 1704|      0|        }
 1705|       |
 1706|    498|        if (rsa_pss_restricted(prsactx)) {
  ------------------
  |  |  161|    498|#define rsa_pss_restricted(prsactx) (prsactx->min_saltlen != -1)
  |  |  ------------------
  |  |  |  Branch (161:37): [True: 22, False: 476]
  |  |  ------------------
  ------------------
 1707|     22|            switch (saltlen) {
 1708|      0|            case RSA_PSS_SALTLEN_AUTO:
  ------------------
  |  |  140|      0|# define RSA_PSS_SALTLEN_AUTO   -2
  ------------------
  |  Branch (1708:13): [True: 0, False: 22]
  ------------------
 1709|      0|            case RSA_PSS_SALTLEN_AUTO_DIGEST_MAX:
  ------------------
  |  |  145|      0|# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX  -4
  ------------------
  |  Branch (1709:13): [True: 0, False: 22]
  ------------------
 1710|      0|                if ((prsactx->operation
  ------------------
  |  Branch (1710:21): [True: 0, False: 0]
  ------------------
 1711|      0|                     & (EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG)) == 0) {
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
                                   & (EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG)) == 0) {
  ------------------
  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
 1712|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH,
  ------------------
  |  |   83|      0|# define PROV_R_INVALID_SALT_LENGTH                       112
  ------------------
 1713|      0|                                   "Cannot use autodetected salt length");
 1714|      0|                    return 0;
 1715|      0|                }
 1716|      0|                break;
 1717|      0|            case RSA_PSS_SALTLEN_DIGEST:
  ------------------
  |  |  138|      0|# define RSA_PSS_SALTLEN_DIGEST -1
  ------------------
  |  Branch (1717:13): [True: 0, False: 22]
  ------------------
 1718|      0|                if (prsactx->min_saltlen > EVP_MD_get_size(prsactx->md)) {
  ------------------
  |  Branch (1718:21): [True: 0, False: 0]
  ------------------
 1719|      0|                    ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
 1720|      0|                                   PROV_R_PSS_SALTLEN_TOO_SMALL,
  ------------------
  |  |  135|      0|# define PROV_R_PSS_SALTLEN_TOO_SMALL                     172
  ------------------
 1721|      0|                                   "Should be more than %d, but would be "
 1722|      0|                                   "set to match digest size (%d)",
 1723|      0|                                   prsactx->min_saltlen,
 1724|      0|                                   EVP_MD_get_size(prsactx->md));
 1725|      0|                    return 0;
 1726|      0|                }
 1727|      0|                break;
 1728|     22|            default:
  ------------------
  |  Branch (1728:13): [True: 22, False: 0]
  ------------------
 1729|     22|                if (saltlen >= 0 && saltlen < prsactx->min_saltlen) {
  ------------------
  |  Branch (1729:21): [True: 22, False: 0]
  |  Branch (1729:37): [True: 0, False: 22]
  ------------------
 1730|      0|                    ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
 1731|      0|                                   PROV_R_PSS_SALTLEN_TOO_SMALL,
  ------------------
  |  |  135|      0|# define PROV_R_PSS_SALTLEN_TOO_SMALL                     172
  ------------------
 1732|      0|                                   "Should be more than %d, "
 1733|      0|                                   "but would be set to %d",
 1734|      0|                                   prsactx->min_saltlen, saltlen);
 1735|      0|                    return 0;
 1736|      0|                }
 1737|     22|            }
 1738|     22|        }
 1739|    498|    }
 1740|       |
 1741|  1.49k|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MGF1_DIGEST);
  ------------------
  |  |  554|  1.49k|# define OSSL_SIGNATURE_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
  |  |  ------------------
  |  |  |  |  417|  1.49k|# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
  |  |  ------------------
  ------------------
 1742|  1.49k|    if (p != NULL) {
  ------------------
  |  Branch (1742:9): [True: 498, False: 996]
  ------------------
 1743|    498|        const OSSL_PARAM *propsp =
 1744|    498|            OSSL_PARAM_locate_const(params,
 1745|    498|                                    OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES);
  ------------------
  |  |  555|    498|# define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES OSSL_PKEY_PARAM_MGF1_PROPERTIES
  |  |  ------------------
  |  |  |  |  418|    498|# define OSSL_PKEY_PARAM_MGF1_PROPERTIES "mgf1-properties"
  |  |  ------------------
  ------------------
 1746|       |
 1747|    498|        pmgf1mdname = mgf1mdname;
 1748|    498|        if (!OSSL_PARAM_get_utf8_string(p, &pmgf1mdname, sizeof(mgf1mdname)))
  ------------------
  |  Branch (1748:13): [True: 0, False: 498]
  ------------------
 1749|      0|            return 0;
 1750|       |
 1751|    498|        if (propsp != NULL) {
  ------------------
  |  Branch (1751:13): [True: 0, False: 498]
  ------------------
 1752|      0|            pmgf1mdprops = mgf1mdprops;
 1753|      0|            if (!OSSL_PARAM_get_utf8_string(propsp,
  ------------------
  |  Branch (1753:17): [True: 0, False: 0]
  ------------------
 1754|      0|                                            &pmgf1mdprops, sizeof(mgf1mdprops)))
 1755|      0|                return 0;
 1756|      0|        }
 1757|       |
 1758|    498|        if (pad_mode != RSA_PKCS1_PSS_PADDING) {
  ------------------
  |  |  200|    498|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (1758:13): [True: 0, False: 498]
  ------------------
 1759|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_MGF1_MD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1760|      0|            return  0;
 1761|      0|        }
 1762|    498|    }
 1763|       |
 1764|  1.49k|    prsactx->saltlen = saltlen;
 1765|  1.49k|    prsactx->pad_mode = pad_mode;
 1766|       |
 1767|  1.49k|    if (prsactx->md == NULL && pmdname == NULL
  ------------------
  |  Branch (1767:9): [True: 0, False: 1.49k]
  |  Branch (1767:32): [True: 0, False: 0]
  ------------------
 1768|  1.49k|        && pad_mode == RSA_PKCS1_PSS_PADDING)
  ------------------
  |  |  200|      0|# define RSA_PKCS1_PSS_PADDING      6
  ------------------
  |  Branch (1768:12): [True: 0, False: 0]
  ------------------
 1769|      0|        pmdname = RSA_DEFAULT_DIGEST_NAME;
  ------------------
  |  |   36|      0|#define RSA_DEFAULT_DIGEST_NAME OSSL_DIGEST_NAME_SHA1
  |  |  ------------------
  |  |  |  |   35|      0|# define OSSL_DIGEST_NAME_SHA1           "SHA1"
  |  |  ------------------
  ------------------
 1770|       |
 1771|  1.49k|    if (pmgf1mdname != NULL
  ------------------
  |  Branch (1771:9): [True: 498, False: 996]
  ------------------
 1772|  1.49k|        && !rsa_setup_mgf1_md(prsactx, pmgf1mdname, pmgf1mdprops))
  ------------------
  |  Branch (1772:12): [True: 0, False: 498]
  ------------------
 1773|      0|        return 0;
 1774|       |
 1775|  1.49k|    if (pmdname != NULL) {
  ------------------
  |  Branch (1775:9): [True: 0, False: 1.49k]
  ------------------
 1776|      0|        if (!rsa_setup_md(prsactx, pmdname, pmdprops, "RSA Sign Set Ctx"))
  ------------------
  |  Branch (1776:13): [True: 0, False: 0]
  ------------------
 1777|      0|            return 0;
 1778|  1.49k|    } else {
 1779|  1.49k|        if (!rsa_check_padding(prsactx, NULL, NULL, prsactx->mdnid))
  ------------------
  |  Branch (1779:13): [True: 0, False: 1.49k]
  ------------------
 1780|      0|            return 0;
 1781|  1.49k|    }
 1782|  1.49k|    return 1;
 1783|  1.49k|}
rsa_sig.c:rsa_settable_ctx_params:
 1813|  1.49k|{
 1814|  1.49k|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1815|       |
 1816|  1.49k|    if (prsactx != NULL && !prsactx->flag_allow_md)
  ------------------
  |  Branch (1816:9): [True: 1.49k, False: 0]
  |  Branch (1816:28): [True: 1.49k, False: 0]
  ------------------
 1817|  1.49k|        return settable_ctx_params_no_digest;
 1818|      0|    return settable_ctx_params;
 1819|  1.49k|}
rsa_sig.c:rsa_signverify_message_update:
  833|    805|{
  834|    805|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
  835|       |
  836|    805|    if (prsactx == NULL || prsactx->mdctx == NULL)
  ------------------
  |  Branch (836:9): [True: 0, False: 805]
  |  Branch (836:28): [True: 0, False: 805]
  ------------------
  837|      0|        return 0;
  838|       |
  839|    805|    if (!prsactx->flag_allow_update) {
  ------------------
  |  Branch (839:9): [True: 0, False: 805]
  ------------------
  840|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UPDATE_CALL_OUT_OF_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  841|      0|        return 0;
  842|      0|    }
  843|    805|    prsactx->flag_allow_oneshot = 0;
  844|       |
  845|    805|    return EVP_DigestUpdate(prsactx->mdctx, data, datalen);
  846|    805|}
rsa_sig.c:rsa_verify_message_final:
 1132|    805|{
 1133|    805|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1134|    805|    unsigned char digest[EVP_MAX_MD_SIZE];
 1135|    805|    unsigned int dlen = 0;
 1136|       |
 1137|    805|    if (!ossl_prov_is_running() || prsactx == NULL)
  ------------------
  |  Branch (1137:9): [True: 0, False: 805]
  |  Branch (1137:36): [True: 0, False: 805]
  ------------------
 1138|      0|        return 0;
 1139|    805|    if (prsactx->mdctx == NULL)
  ------------------
  |  Branch (1139:9): [True: 0, False: 805]
  ------------------
 1140|      0|        return 0;
 1141|    805|    if (!prsactx->flag_allow_final) {
  ------------------
  |  Branch (1141:9): [True: 0, False: 805]
  ------------------
 1142|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FINAL_CALL_OUT_OF_ORDER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1143|      0|        return 0;
 1144|      0|    }
 1145|       |
 1146|       |    /*
 1147|       |     * The digests used here are all known (see rsa_get_md_nid()), so they
 1148|       |     * should not exceed the internal buffer size of EVP_MAX_MD_SIZE.
 1149|       |     */
 1150|    805|    if (!EVP_DigestFinal_ex(prsactx->mdctx, digest, &dlen))
  ------------------
  |  Branch (1150:9): [True: 0, False: 805]
  ------------------
 1151|      0|        return 0;
 1152|       |
 1153|    805|    prsactx->flag_allow_update = 0;
 1154|    805|    prsactx->flag_allow_final = 0;
 1155|    805|    prsactx->flag_allow_oneshot = 0;
 1156|       |
 1157|    805|    return rsa_verify_directly(prsactx, prsactx->sig, prsactx->siglen,
 1158|    805|                               digest, dlen);
 1159|    805|}
rsa_sig.c:rsa_sigalg_set_ctx_params:
 1987|    805|{
 1988|    805|    PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
 1989|    805|    const OSSL_PARAM *p;
 1990|       |
 1991|    805|    if (prsactx == NULL)
  ------------------
  |  Branch (1991:9): [True: 0, False: 805]
  ------------------
 1992|      0|        return 0;
 1993|    805|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (1993:9): [True: 0, False: 805]
  ------------------
 1994|      0|        return 1;
 1995|       |
 1996|    805|    if (prsactx->operation == EVP_PKEY_OP_VERIFYMSG) {
  ------------------
  |  | 1759|    805|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (1996:9): [True: 805, False: 0]
  ------------------
 1997|    805|        p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_SIGNATURE);
  ------------------
  |  |  561|    805|# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
  ------------------
 1998|    805|        if (p != NULL) {
  ------------------
  |  Branch (1998:13): [True: 805, False: 0]
  ------------------
 1999|    805|            OPENSSL_free(prsactx->sig);
  ------------------
  |  |  115|    805|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    805|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    805|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2000|    805|            prsactx->sig = NULL;
 2001|    805|            prsactx->siglen = 0;
 2002|    805|            if (!OSSL_PARAM_get_octet_string(p, (void **)&prsactx->sig,
  ------------------
  |  Branch (2002:17): [True: 0, False: 805]
  ------------------
 2003|    805|                                             0, &prsactx->siglen))
 2004|      0|                return 0;
 2005|    805|        }
 2006|    805|    }
 2007|    805|    return 1;
 2008|    805|}

ossl_prov_is_running:
   20|  1.35M|{
   21|  1.35M|    return 1;
   22|  1.35M|}

