ASN1_OBJECT_free:
  348|    159|{
  349|    159|    if (a == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 159]
  ------------------
  350|      0|        return;
  351|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|    159|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (351:9): [True: 0, False: 159]
  ------------------
  352|      0|#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|      0|        OPENSSL_free((void*)a->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__
  |  |  ------------------
  ------------------
  358|      0|        OPENSSL_free((void*)a->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__
  |  |  ------------------
  ------------------
  359|      0|#endif
  360|      0|        a->sn = a->ln = NULL;
  361|      0|    }
  362|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|    159|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  |  Branch (362:9): [True: 0, False: 159]
  ------------------
  363|      0|        OPENSSL_free((void*)a->data);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  364|      0|        a->data = NULL;
  365|      0|        a->length = 0;
  366|      0|    }
  367|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|    159|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (367:9): [True: 0, False: 159]
  ------------------
  368|      0|        OPENSSL_free(a);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  369|    159|}

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

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

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

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

bio_cleanup:
  947|      1|{
  948|      1|#ifndef OPENSSL_NO_SOCK
  949|      1|    bio_sock_cleanup_int();
  950|      1|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  951|      1|    bio_lookup_lock = NULL;
  952|      1|#endif
  953|      1|    CRYPTO_FREE_REF(&bio_type_count);
  954|      1|}

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|}
BIO_meth_set_write_ex:
  101|      1|{
  102|      1|    biom->bwrite_old = NULL;
  103|      1|    biom->bwrite = bwrite;
  104|      1|    return 1;
  105|      1|}
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_snprintf:
  932|  1.38k|{
  933|  1.38k|    va_list args;
  934|  1.38k|    int ret;
  935|       |
  936|  1.38k|    va_start(args, format);
  937|       |
  938|  1.38k|    ret = BIO_vsnprintf(buf, n, format, args);
  939|       |
  940|  1.38k|    va_end(args);
  941|  1.38k|    return ret;
  942|  1.38k|}
BIO_vsnprintf:
  945|  1.39k|{
  946|  1.39k|    size_t retlen;
  947|  1.39k|    int truncated;
  948|       |
  949|  1.39k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (949:9): [True: 0, False: 1.39k]
  ------------------
  950|      0|        return -1;
  951|       |
  952|  1.39k|    if (truncated)
  ------------------
  |  Branch (952:9): [True: 0, False: 1.39k]
  ------------------
  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|  1.39k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (960:12): [True: 1.39k, False: 0]
  ------------------
  961|  1.39k|}
bio_print.c:_dopr:
   91|  1.39k|{
   92|  1.39k|    char ch;
   93|  1.39k|    int64_t value;
   94|  1.39k|#ifndef OPENSSL_SYS_UEFI
   95|  1.39k|    LDOUBLE fvalue;
  ------------------
  |  |   28|  1.39k|# define LDOUBLE double
  ------------------
   96|  1.39k|#endif
   97|  1.39k|    char *strvalue;
   98|  1.39k|    int min;
   99|  1.39k|    int max;
  100|  1.39k|    int state;
  101|  1.39k|    int flags;
  102|  1.39k|    int cflags;
  103|  1.39k|    size_t currlen;
  104|       |
  105|  1.39k|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  1.39k|#define DP_S_DEFAULT    0
  ------------------
  106|  1.39k|    flags = currlen = cflags = min = 0;
  107|  1.39k|    max = -1;
  108|  1.39k|    ch = *format++;
  109|       |
  110|  13.0k|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  13.0k|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 11.6k, False: 1.39k]
  ------------------
  111|  11.6k|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 1.39k, False: 10.2k]
  |  Branch (111:28): [True: 10.2k, False: 0]
  |  Branch (111:46): [True: 0, False: 10.2k]
  ------------------
  112|  1.39k|            state = DP_S_DONE;
  ------------------
  |  |   52|  1.39k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  11.6k|        switch (state) {
  115|  3.20k|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  3.20k|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 3.20k, False: 8.43k]
  ------------------
  116|  3.20k|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 1.40k, False: 1.80k]
  ------------------
  117|  1.40k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  1.40k|#define DP_S_FLAGS      1
  ------------------
  118|  1.80k|            else
  119|  1.80k|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 1.80k]
  ------------------
  120|      0|                    return 0;
  121|  3.20k|            ch = *format++;
  122|  3.20k|            break;
  123|  1.40k|        case DP_S_FLAGS:
  ------------------
  |  |   46|  1.40k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 1.40k, False: 10.2k]
  ------------------
  124|  1.40k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 1.40k]
  ------------------
  126|      0|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|      0|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|      0|                ch = *format++;
  128|      0|                break;
  129|      0|            case '+':
  ------------------
  |  Branch (129:13): [True: 0, False: 1.40k]
  ------------------
  130|      0|                flags |= DP_F_PLUS;
  ------------------
  |  |   58|      0|#define DP_F_PLUS       (1 << 1)
  ------------------
  131|      0|                ch = *format++;
  132|      0|                break;
  133|      0|            case ' ':
  ------------------
  |  Branch (133:13): [True: 0, False: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|      0|            case '0':
  ------------------
  |  Branch (141:13): [True: 0, False: 1.40k]
  ------------------
  142|      0|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|      0|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|      0|                ch = *format++;
  144|      0|                break;
  145|  1.40k|            default:
  ------------------
  |  Branch (145:13): [True: 1.40k, False: 0]
  ------------------
  146|  1.40k|                state = DP_S_MIN;
  ------------------
  |  |   47|  1.40k|#define DP_S_MIN        2
  ------------------
  147|  1.40k|                break;
  148|  1.40k|            }
  149|  1.40k|            break;
  150|  1.40k|        case DP_S_MIN:
  ------------------
  |  |   47|  1.40k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 1.40k, False: 10.2k]
  ------------------
  151|  1.40k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 1.40k]
  ------------------
  152|      0|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  153|      0|                ch = *format++;
  154|  1.40k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 1.40k]
  ------------------
  155|      0|                min = va_arg(args, int);
  156|      0|                ch = *format++;
  157|      0|                state = DP_S_DOT;
  ------------------
  |  |   48|      0|#define DP_S_DOT        3
  ------------------
  158|      0|            } else
  159|  1.40k|                state = DP_S_DOT;
  ------------------
  |  |   48|  1.40k|#define DP_S_DOT        3
  ------------------
  160|  1.40k|            break;
  161|  1.40k|        case DP_S_DOT:
  ------------------
  |  |   48|  1.40k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 1.40k, False: 10.2k]
  ------------------
  162|  1.40k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 1.40k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|  1.40k|                state = DP_S_MOD;
  ------------------
  |  |   50|  1.40k|#define DP_S_MOD        5
  ------------------
  167|  1.40k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 11.6k]
  ------------------
  169|      0|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                if (max < 0)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    max = 0;
  172|      0|                max = 10 * max + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  173|      0|                ch = *format++;
  174|      0|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 0, False: 0]
  ------------------
  175|      0|                max = va_arg(args, int);
  176|      0|                ch = *format++;
  177|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  178|      0|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|      0|            break;
  181|  1.40k|        case DP_S_MOD:
  ------------------
  |  |   50|  1.40k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 1.40k, False: 10.2k]
  ------------------
  182|  1.40k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 1.40k]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  1.38k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 1.38k, False: 26]
  ------------------
  188|  1.38k|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 0, False: 1.38k]
  ------------------
  189|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  190|      0|                    format++;
  191|      0|                } else
  192|  1.38k|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  1.38k|#define DP_C_LONG       2
  ------------------
  193|  1.38k|                ch = *format++;
  194|  1.38k|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 1.40k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 1.40k]
  ------------------
  197|      0|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  198|      0|                ch = *format++;
  199|      0|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|     26|            default:
  ------------------
  |  Branch (208:13): [True: 26, False: 1.38k]
  ------------------
  209|     26|                break;
  210|  1.40k|            }
  211|  1.40k|            state = DP_S_CONV;
  ------------------
  |  |   51|  1.40k|#define DP_S_CONV       6
  ------------------
  212|  1.40k|            break;
  213|  1.40k|        case DP_S_CONV:
  ------------------
  |  |   51|  1.40k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 1.40k, False: 10.2k]
  ------------------
  214|  1.40k|            switch (ch) {
  215|      2|            case 'd':
  ------------------
  |  Branch (215:13): [True: 2, False: 1.40k]
  ------------------
  216|      2|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 1.40k]
  ------------------
  217|      2|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 2]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|      0|                case DP_C_LONG:
  ------------------
  |  |   72|      0|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 0, False: 2]
  ------------------
  222|      0|                    value = va_arg(args, long int);
  223|      0|                    break;
  224|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 0, False: 2]
  ------------------
  225|      0|                    value = va_arg(args, int64_t);
  226|      0|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 2]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|      2|                default:
  ------------------
  |  Branch (230:17): [True: 2, False: 0]
  ------------------
  231|      2|                    value = va_arg(args, int);
  232|      2|                    break;
  233|      2|                }
  234|      2|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 2]
  ------------------
  235|      2|                            max, flags))
  236|      0|                    return 0;
  237|      2|                break;
  238|      2|            case 'X':
  ------------------
  |  Branch (238:13): [True: 0, False: 1.40k]
  ------------------
  239|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|      0|            case 'x':
  ------------------
  |  Branch (241:13): [True: 0, False: 1.40k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 1.40k]
  ------------------
  243|  1.38k|            case 'u':
  ------------------
  |  Branch (243:13): [True: 1.38k, False: 26]
  ------------------
  244|  1.38k|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  1.38k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  1.38k|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 1.38k]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|  1.38k|                case DP_C_LONG:
  ------------------
  |  |   72|  1.38k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 1.38k, False: 0]
  ------------------
  250|  1.38k|                    value = va_arg(args, unsigned long int);
  251|  1.38k|                    break;
  252|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 0, False: 1.38k]
  ------------------
  253|      0|                    value = va_arg(args, uint64_t);
  254|      0|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 1.38k]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|      0|                default:
  ------------------
  |  Branch (258:17): [True: 0, False: 1.38k]
  ------------------
  259|      0|                    value = va_arg(args, unsigned int);
  260|      0|                    break;
  261|  1.38k|                }
  262|  1.38k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 1.38k]
  ------------------
  263|  1.38k|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 1.38k]
  |  Branch (263:46): [True: 1.38k, False: 0]
  ------------------
  264|  1.38k|                            min, max, flags))
  265|      0|                    return 0;
  266|  1.38k|                break;
  267|  1.38k|#ifndef OPENSSL_SYS_UEFI
  268|  1.38k|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  293|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (293:21): [True: 0, False: 0]
  ------------------
  294|      0|                    fvalue = va_arg(args, LDOUBLE);
  295|      0|                else
  296|      0|                    fvalue = va_arg(args, double);
  297|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (297:21): [True: 0, False: 0]
  ------------------
  298|      0|                           flags, G_FORMAT))
  ------------------
  |  |   80|      0|#define G_FORMAT        2
  ------------------
  299|      0|                    return 0;
  300|      0|                break;
  301|       |#else
  302|       |            case 'f':
  303|       |            case 'E':
  304|       |            case 'e':
  305|       |            case 'G':
  306|       |            case 'g':
  307|       |                /* not implemented for UEFI */
  308|       |                ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
  309|       |                return 0;
  310|       |#endif
  311|      0|            case 'c':
  ------------------
  |  Branch (311:13): [True: 0, False: 1.40k]
  ------------------
  312|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 0]
  ------------------
  313|      0|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|      0|                break;
  316|     24|            case 's':
  ------------------
  |  Branch (316:13): [True: 24, False: 1.38k]
  ------------------
  317|     24|                strvalue = va_arg(args, char *);
  318|     24|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 24, False: 0]
  ------------------
  319|     24|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 24]
  ------------------
  320|      0|                        max = INT_MAX;
  321|     24|                    else
  322|     24|                        max = *maxlen;
  323|     24|                }
  324|     24|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 24]
  ------------------
  325|     24|                            flags, min, max))
  326|      0|                    return 0;
  327|     24|                break;
  328|     24|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  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: 1.40k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 1.40k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  1.40k|            }
  353|  1.40k|            ch = *format++;
  354|  1.40k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  1.40k|#define DP_S_DEFAULT    0
  ------------------
  355|  1.40k|            flags = cflags = min = 0;
  356|  1.40k|            max = -1;
  357|  1.40k|            break;
  358|  1.39k|        case DP_S_DONE:
  ------------------
  |  |   52|  1.39k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 1.39k, False: 10.2k]
  ------------------
  359|  1.39k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 11.6k]
  ------------------
  361|      0|            break;
  362|  11.6k|        }
  363|  11.6k|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  1.39k|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 1.39k, False: 0]
  ------------------
  369|  1.39k|        *truncated = (currlen > *maxlen - 1);
  370|  1.39k|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 1.39k]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  1.39k|    }
  373|  1.39k|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 1.39k]
  ------------------
  374|      0|        return 0;
  375|  1.39k|    *retlen = currlen - 1;
  376|  1.39k|    return 1;
  377|  1.39k|}
bio_print.c:doapr_outch:
  840|  5.97k|{
  841|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  842|  5.97k|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|  5.97k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 5.97k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  5.97k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (842:9): [True: 0, False: 5.97k]
  ------------------
  843|      0|        return 0;
  844|       |
  845|       |    /* |currlen| must always be <= |*maxlen| */
  846|  5.97k|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|  5.97k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  5.97k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (846:9): [True: 0, False: 5.97k]
  ------------------
  847|      0|        return 0;
  848|       |
  849|  5.97k|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (849:9): [True: 0, False: 5.97k]
  |  Branch (849:19): [True: 0, False: 0]
  ------------------
  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|  5.97k|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (873:9): [True: 5.97k, False: 0]
  ------------------
  874|  5.97k|        if (*sbuffer)
  ------------------
  |  Branch (874:13): [True: 5.97k, False: 0]
  ------------------
  875|  5.97k|            (*sbuffer)[(*currlen)++] = (char)c;
  876|      0|        else
  877|      0|            (*buffer)[(*currlen)++] = (char)c;
  878|  5.97k|    }
  879|       |
  880|  5.97k|    return 1;
  881|  5.97k|}
bio_print.c:fmtint:
  436|  1.38k|{
  437|  1.38k|    int signvalue = 0;
  438|  1.38k|    const char *prefix = "";
  439|  1.38k|    uint64_t uvalue;
  440|  1.38k|    char convert[DECIMAL_SIZE(value) + 3];
  441|  1.38k|    int place = 0;
  442|  1.38k|    int spadlen = 0;
  443|  1.38k|    int zpadlen = 0;
  444|  1.38k|    int caps = 0;
  445|       |
  446|  1.38k|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 1.38k, False: 0]
  ------------------
  447|  1.38k|        max = 0;
  448|  1.38k|    uvalue = value;
  449|  1.38k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  1.38k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 2, False: 1.38k]
  ------------------
  450|      2|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 0, False: 2]
  ------------------
  451|      0|            signvalue = '-';
  452|      0|            uvalue = 0 - (uint64_t)value;
  453|      2|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|      2|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 0, False: 2]
  ------------------
  454|      0|            signvalue = '+';
  455|      2|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|      2|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 2]
  ------------------
  456|      0|            signvalue = ' ';
  457|      2|    }
  458|  1.38k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  1.38k|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  1.38k|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 0, False: 1.38k]
  ------------------
  465|      0|        caps = 1;
  466|  2.51k|    do {
  467|  2.51k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 0, False: 2.51k]
  ------------------
  468|  2.51k|            [uvalue % (unsigned)base];
  469|  2.51k|        uvalue = (uvalue / (unsigned)base);
  470|  2.51k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 1.13k, False: 1.38k]
  |  Branch (470:24): [True: 1.13k, False: 0]
  ------------------
  471|  1.38k|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 1.38k]
  ------------------
  472|      0|        place--;
  473|  1.38k|    convert[place] = 0;
  474|       |
  475|  1.38k|    zpadlen = max - place;
  476|  1.38k|    spadlen =
  477|  1.38k|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  1.38k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 1.38k]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 0, False: 1.38k]
  ------------------
  478|  1.38k|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 1.38k, False: 0]
  ------------------
  479|  1.38k|        zpadlen = 0;
  480|  1.38k|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 1.38k, False: 0]
  ------------------
  481|  1.38k|        spadlen = 0;
  482|  1.38k|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  1.38k|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 0, False: 1.38k]
  ------------------
  483|      0|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|      0|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  484|      0|        spadlen = 0;
  485|      0|    }
  486|  1.38k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  1.38k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 1.38k]
  ------------------
  487|      0|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  1.38k|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 0, False: 1.38k]
  ------------------
  491|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 0]
  ------------------
  492|      0|            return 0;
  493|      0|        --spadlen;
  494|      0|    }
  495|       |
  496|       |    /* sign */
  497|  1.38k|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 0, False: 1.38k]
  ------------------
  498|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  1.38k|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 0, False: 1.38k]
  ------------------
  510|      0|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 0, False: 0]
  ------------------
  511|      0|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 0]
  ------------------
  512|      0|                return 0;
  513|      0|            --zpadlen;
  514|      0|        }
  515|      0|    }
  516|       |    /* digits */
  517|  3.90k|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 2.51k, False: 1.38k]
  ------------------
  518|  2.51k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 2.51k]
  ------------------
  519|      0|            return 0;
  520|  2.51k|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  1.38k|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 0, False: 1.38k]
  ------------------
  524|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            return 0;
  526|      0|        ++spadlen;
  527|      0|    }
  528|  1.38k|    return 1;
  529|  1.38k|}
bio_print.c:fmtstr:
  384|     24|{
  385|     24|    int padlen;
  386|     24|    size_t strln;
  387|     24|    int cnt = 0;
  388|       |
  389|     24|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 24]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|     24|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 24]
  ------------------
  393|       |
  394|     24|    padlen = min - strln;
  395|     24|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 24]
  |  Branch (395:20): [True: 24, False: 0]
  ------------------
  396|     24|        padlen = 0;
  397|     24|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 24, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|     24|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 24, False: 0]
  ------------------
  403|     24|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|     24|    }
  407|     24|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|     24|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 24]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|     24|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 24]
  |  Branch (410:29): [True: 0, False: 0]
  |  Branch (410:40): [True: 0, False: 0]
  ------------------
  411|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 0]
  ------------------
  412|      0|            return 0;
  413|      0|        --padlen;
  414|      0|        ++cnt;
  415|      0|    }
  416|    281|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 257, False: 24]
  |  Branch (416:26): [True: 0, False: 257]
  |  Branch (416:37): [True: 257, False: 0]
  ------------------
  417|    257|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 257]
  ------------------
  418|      0|            return 0;
  419|    257|        --strln;
  420|    257|        ++cnt;
  421|    257|    }
  422|     24|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 24]
  |  Branch (422:29): [True: 0, False: 0]
  |  Branch (422:40): [True: 0, False: 0]
  ------------------
  423|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            return 0;
  425|      0|        ++padlen;
  426|      0|        ++cnt;
  427|      0|    }
  428|     24|    return 1;
  429|     24|}

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

ossl_bio_core_globals_free:
   26|      1|{
   27|      1|    OPENSSL_free(vbcg);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   28|      1|}
ossl_bio_core_globals_new:
   31|      1|{
   32|      1|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   33|      1|}

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

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

BN_free:
  227|  1.06k|{
  228|  1.06k|    if (a == NULL)
  ------------------
  |  Branch (228:9): [True: 1.06k, False: 0]
  ------------------
  229|  1.06k|        return;
  230|      0|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|      0|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        bn_free_d(a, 0);
  232|      0|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|      0|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (232:9): [True: 0, False: 0]
  ------------------
  233|      0|        OPENSSL_free(a);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  234|      0|}

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

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

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

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

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

ossl_comp_brotli_cleanup:
  353|      1|{
  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|      1|}

COMP_zlib:
  311|      1|{
  312|      1|    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|      1|    return meth;
  320|      1|}
ossl_comp_zlib_cleanup:
  336|      1|{
  337|       |#ifdef ZLIB_SHARED
  338|       |    DSO_free(zlib_dso);
  339|       |    zlib_dso = NULL;
  340|       |#endif
  341|      1|}

ossl_comp_zstd_cleanup:
  428|      1|{
  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|      1|}

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

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

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

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

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

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

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

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

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

ossl_lib_ctx_write_lock:
   60|      1|{
   61|      1|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|      1|    return CRYPTO_THREAD_write_lock(ctx->lock);
   64|      1|}
ossl_lib_ctx_read_lock:
   67|    261|{
   68|    261|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 261]
  ------------------
   69|      0|        return 0;
   70|    261|    return CRYPTO_THREAD_read_lock(ctx->lock);
   71|    261|}
ossl_lib_ctx_unlock:
   74|    262|{
   75|    262|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 262]
  ------------------
   76|      0|        return 0;
   77|    262|    return CRYPTO_THREAD_unlock(ctx->lock);
   78|    262|}
ossl_lib_ctx_default_deinit:
  412|      1|{
  413|      1|    if (!default_context_inited)
  ------------------
  |  Branch (413:9): [True: 0, False: 1]
  ------------------
  414|      0|        return;
  415|      1|    context_deinit(&default_context_int);
  416|      1|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  417|      1|    default_context_inited = 0;
  418|      1|}
OSSL_LIB_CTX_get0_global_default:
  512|      1|{
  513|      1|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (513:9): [True: 0, False: 1]
  ------------------
  514|      0|        return NULL;
  515|       |
  516|      1|    return &default_context_int;
  517|      1|}
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|  8.55k|{
  544|  8.55k|#ifndef FIPS_MODULE
  545|  8.55k|    if (ctx == NULL)
  ------------------
  |  Branch (545:9): [True: 2.91k, False: 5.64k]
  ------------------
  546|  2.91k|        return get_default_context();
  547|  5.64k|#endif
  548|  5.64k|    return ctx;
  549|  8.55k|}
ossl_lib_ctx_is_default:
  552|     33|{
  553|     33|#ifndef FIPS_MODULE
  554|     33|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (554:9): [True: 13, False: 20]
  |  Branch (554:24): [True: 20, False: 0]
  ------------------
  555|     33|        return 1;
  556|      0|#endif
  557|      0|    return 0;
  558|     33|}
ossl_lib_ctx_is_global_default:
  561|      2|{
  562|      2|#ifndef FIPS_MODULE
  563|      2|    if (ossl_lib_ctx_get_concrete(ctx) == &default_context_int)
  ------------------
  |  Branch (563:9): [True: 2, False: 0]
  ------------------
  564|      2|        return 1;
  565|      0|#endif
  566|      0|    return 0;
  567|      2|}
ossl_lib_ctx_get_data:
  570|  7.06k|{
  571|  7.06k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  572|  7.06k|    if (ctx == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 7.06k]
  ------------------
  573|      0|        return NULL;
  574|       |
  575|  7.06k|    switch (index) {
  576|     22|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|     22|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (576:5): [True: 22, False: 7.04k]
  ------------------
  577|     22|        return ctx->property_string_data;
  578|  2.39k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|  2.39k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (578:5): [True: 2.39k, False: 4.67k]
  ------------------
  579|  2.39k|        return ctx->evp_method_store;
  580|     20|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|     20|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (580:5): [True: 20, False: 7.04k]
  ------------------
  581|     20|        return ctx->provider_store;
  582|  3.48k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|  3.48k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (582:5): [True: 3.48k, False: 3.57k]
  ------------------
  583|  3.48k|        return ctx->namemap;
  584|    262|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|    262|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (584:5): [True: 262, False: 6.80k]
  ------------------
  585|    262|        return ctx->property_defns;
  586|     18|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|     18|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (586:5): [True: 18, False: 7.04k]
  ------------------
  587|     18|        return ctx->global_properties;
  588|    861|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|    861|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (588:5): [True: 861, False: 6.20k]
  ------------------
  589|    861|        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: 7.06k]
  ------------------
  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: 7.06k]
  ------------------
  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: 7.06k]
  ------------------
  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: 7.06k]
  ------------------
  598|      0|        return ctx->child_provider;
  599|      0|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|      0|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (599:5): [True: 0, False: 7.06k]
  ------------------
  600|      0|        return ctx->decoder_store;
  601|      1|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|      1|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (601:5): [True: 1, False: 7.06k]
  ------------------
  602|      1|        return ctx->decoder_cache;
  603|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (603:5): [True: 0, False: 7.06k]
  ------------------
  604|      0|        return ctx->encoder_store;
  605|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (605:5): [True: 0, False: 7.06k]
  ------------------
  606|      0|        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: 7.06k]
  ------------------
  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: 7.06k]
  ------------------
  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: 7.06k]
  ------------------
  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: 7.06k]
  ------------------
  626|      0|        return (void *)&ctx->comp_methods;
  627|       |
  628|      0|    default:
  ------------------
  |  Branch (628:5): [True: 0, False: 7.06k]
  ------------------
  629|      0|        return NULL;
  630|  7.06k|    }
  631|  7.06k|}
ossl_lib_ctx_get_ex_data_global:
  639|    950|{
  640|    950|    ctx = ossl_lib_ctx_get_concrete(ctx);
  641|    950|    if (ctx == NULL)
  ------------------
  |  Branch (641:9): [True: 0, False: 950]
  ------------------
  642|      0|        return NULL;
  643|    950|    return &ctx->global;
  644|    950|}
ossl_lib_ctx_get_descriptor:
  647|      2|{
  648|       |#ifdef FIPS_MODULE
  649|       |    return "FIPS internal library context";
  650|       |#else
  651|      2|    if (ossl_lib_ctx_is_global_default(libctx))
  ------------------
  |  Branch (651:9): [True: 2, False: 0]
  ------------------
  652|      2|        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|      1|{
  669|      1|    libctx = ossl_lib_ctx_get_concrete(libctx);
  670|      1|    if (libctx == NULL)
  ------------------
  |  Branch (670:9): [True: 0, False: 1]
  ------------------
  671|      0|        return 0;
  672|      1|    return libctx->conf_diagnostics;
  673|      1|}
context.c:context_deinit:
  370|      1|{
  371|      1|    if (ctx == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 1]
  ------------------
  372|      0|        return 1;
  373|       |
  374|      1|    ossl_ctx_thread_stop(ctx);
  375|       |
  376|      1|    context_deinit_objs(ctx);
  377|       |
  378|      1|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  379|       |
  380|      1|    CRYPTO_THREAD_lock_free(ctx->lock);
  381|      1|    ctx->lock = NULL;
  382|      1|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  383|      1|    return 1;
  384|      1|}
context.c:context_deinit_objs:
  235|      1|{
  236|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  237|      1|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (237:9): [True: 1, False: 0]
  ------------------
  238|      1|        ossl_method_store_free(ctx->evp_method_store);
  239|      1|        ctx->evp_method_store = NULL;
  240|      1|    }
  241|       |
  242|       |    /* P2. */
  243|      1|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (243:9): [True: 0, False: 1]
  ------------------
  244|      0|        ossl_rand_ctx_free(ctx->drbg);
  245|      0|        ctx->drbg = NULL;
  246|      0|    }
  247|       |
  248|      1|#ifndef FIPS_MODULE
  249|       |    /* P2. */
  250|      1|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (250:9): [True: 1, False: 0]
  ------------------
  251|      1|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  252|      1|        ctx->provider_conf = NULL;
  253|      1|    }
  254|       |
  255|       |    /*
  256|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  257|       |     * provider store
  258|       |     */
  259|      1|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (259:9): [True: 1, False: 0]
  ------------------
  260|      1|        ossl_method_store_free(ctx->decoder_store);
  261|      1|        ctx->decoder_store = NULL;
  262|      1|    }
  263|      1|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (263:9): [True: 1, False: 0]
  ------------------
  264|      1|        ossl_decoder_cache_free(ctx->decoder_cache);
  265|      1|        ctx->decoder_cache = NULL;
  266|      1|    }
  267|       |
  268|       |
  269|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  270|      1|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (270:9): [True: 1, False: 0]
  ------------------
  271|      1|        ossl_method_store_free(ctx->encoder_store);
  272|      1|        ctx->encoder_store = NULL;
  273|      1|    }
  274|       |
  275|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  276|      1|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (276:9): [True: 1, False: 0]
  ------------------
  277|      1|        ossl_method_store_free(ctx->store_loader_store);
  278|      1|        ctx->store_loader_store = NULL;
  279|      1|    }
  280|      1|#endif
  281|       |
  282|       |    /* P1. Needs to be freed before the child provider data is freed */
  283|      1|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (283:9): [True: 1, False: 0]
  ------------------
  284|      1|        ossl_provider_store_free(ctx->provider_store);
  285|      1|        ctx->provider_store = NULL;
  286|      1|    }
  287|       |
  288|       |    /* Default priority. */
  289|      1|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (289:9): [True: 1, False: 0]
  ------------------
  290|      1|        ossl_property_string_data_free(ctx->property_string_data);
  291|      1|        ctx->property_string_data = NULL;
  292|      1|    }
  293|       |
  294|      1|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (294:9): [True: 1, False: 0]
  ------------------
  295|      1|        ossl_stored_namemap_free(ctx->namemap);
  296|      1|        ctx->namemap = NULL;
  297|      1|    }
  298|       |
  299|      1|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (299:9): [True: 1, False: 0]
  ------------------
  300|      1|        ossl_property_defns_free(ctx->property_defns);
  301|      1|        ctx->property_defns = NULL;
  302|      1|    }
  303|       |
  304|      1|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (304:9): [True: 1, False: 0]
  ------------------
  305|      1|        ossl_ctx_global_properties_free(ctx->global_properties);
  306|      1|        ctx->global_properties = NULL;
  307|      1|    }
  308|       |
  309|      1|#ifndef FIPS_MODULE
  310|      1|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (310:9): [True: 1, False: 0]
  ------------------
  311|      1|        ossl_bio_core_globals_free(ctx->bio_core);
  312|      1|        ctx->bio_core = NULL;
  313|      1|    }
  314|      1|#endif
  315|       |
  316|      1|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (316:9): [True: 1, False: 0]
  ------------------
  317|      1|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  318|      1|        ctx->drbg_nonce = NULL;
  319|      1|    }
  320|       |
  321|      1|#ifndef FIPS_MODULE
  322|      1|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (322:9): [True: 1, False: 0]
  ------------------
  323|      1|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  324|      1|        ctx->indicator_cb = NULL;
  325|      1|    }
  326|       |
  327|      1|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (327:9): [True: 1, False: 0]
  ------------------
  328|      1|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  329|      1|        ctx->self_test_cb = NULL;
  330|      1|    }
  331|      1|#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|      1|#ifndef OPENSSL_NO_THREAD_POOL
  346|      1|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (346:9): [True: 1, False: 0]
  ------------------
  347|      1|        ossl_threads_ctx_free(ctx->threads);
  348|      1|        ctx->threads = NULL;
  349|      1|    }
  350|      1|#endif
  351|       |
  352|       |    /* Low priority. */
  353|      1|#ifndef FIPS_MODULE
  354|      1|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (354:9): [True: 1, False: 0]
  ------------------
  355|      1|        ossl_child_prov_ctx_free(ctx->child_provider);
  356|      1|        ctx->child_provider = NULL;
  357|      1|    }
  358|      1|#endif
  359|       |
  360|      1|#ifndef FIPS_MODULE
  361|      1|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (361:9): [True: 1, False: 0]
  ------------------
  362|      1|        ossl_free_compression_methods_int(ctx->comp_methods);
  363|      1|        ctx->comp_methods = NULL;
  364|      1|    }
  365|      1|#endif
  366|       |
  367|      1|}
context.c:context_init:
   92|      1|{
   93|      1|    int exdata_done = 0;
   94|       |
   95|      1|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (95:9): [True: 0, False: 1]
  ------------------
   96|      0|        return 0;
   97|       |
   98|      1|    ctx->lock = CRYPTO_THREAD_lock_new();
   99|      1|    if (ctx->lock == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 1]
  ------------------
  100|      0|        goto err;
  101|       |
  102|       |    /* Initialize ex_data. */
  103|      1|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        goto err;
  105|      1|    exdata_done = 1;
  106|       |
  107|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  108|      1|    ctx->evp_method_store = ossl_method_store_new(ctx);
  109|      1|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 1]
  ------------------
  110|      0|        goto err;
  111|      1|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  291|      1|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  112|       |
  113|      1|#ifndef FIPS_MODULE
  114|       |    /* P2. Must be freed before the provider store is freed */
  115|      1|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  116|      1|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 1]
  ------------------
  117|      0|        goto err;
  118|      1|#endif
  119|       |
  120|       |    /* P2. */
  121|      1|    ctx->drbg = ossl_rand_ctx_new(ctx);
  122|      1|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 1]
  ------------------
  123|      0|        goto err;
  124|       |
  125|      1|#ifndef FIPS_MODULE
  126|       |    /*
  127|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  128|       |     * provider store
  129|       |     */
  130|      1|    ctx->decoder_store = ossl_method_store_new(ctx);
  131|      1|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 1]
  ------------------
  132|      0|        goto err;
  133|      1|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  134|      1|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 1]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  138|      1|    ctx->encoder_store = ossl_method_store_new(ctx);
  139|      1|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  143|      1|    ctx->store_loader_store = ossl_method_store_new(ctx);
  144|      1|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 1]
  ------------------
  145|      0|        goto err;
  146|      1|#endif
  147|       |
  148|       |    /* P1. Needs to be freed before the child provider data is freed */
  149|      1|    ctx->provider_store = ossl_provider_store_new(ctx);
  150|      1|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 1]
  ------------------
  151|      0|        goto err;
  152|       |
  153|       |    /* Default priority. */
  154|      1|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  155|      1|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  ------------------
  156|      0|        goto err;
  157|       |
  158|      1|    ctx->namemap = ossl_stored_namemap_new(ctx);
  159|      1|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 1]
  ------------------
  160|      0|        goto err;
  161|       |
  162|      1|    ctx->property_defns = ossl_property_defns_new(ctx);
  163|      1|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        goto err;
  165|       |
  166|      1|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  167|      1|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 1]
  ------------------
  168|      0|        goto err;
  169|       |
  170|      1|#ifndef FIPS_MODULE
  171|      1|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  172|      1|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (172:9): [True: 0, False: 1]
  ------------------
  173|      0|        goto err;
  174|      1|#endif
  175|       |
  176|      1|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  177|      1|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        goto err;
  179|       |
  180|      1|#ifndef FIPS_MODULE
  181|      1|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  182|      1|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 1]
  ------------------
  183|      0|        goto err;
  184|      1|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  185|      1|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 1]
  ------------------
  186|      0|        goto err;
  187|      1|#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|      1|#ifndef OPENSSL_NO_THREAD_POOL
  200|      1|    ctx->threads = ossl_threads_ctx_new(ctx);
  201|      1|    if (ctx->threads == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 1]
  ------------------
  202|      0|        goto err;
  203|      1|#endif
  204|       |
  205|       |    /* Low priority. */
  206|      1|#ifndef FIPS_MODULE
  207|      1|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  208|      1|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 1]
  ------------------
  209|      0|        goto err;
  210|      1|#endif
  211|       |
  212|       |    /* Everything depends on properties, so we also pre-initialise that */
  213|      1|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (213:9): [True: 0, False: 1]
  ------------------
  214|      0|        goto err;
  215|       |
  216|      1|#ifndef FIPS_MODULE
  217|      1|    ctx->comp_methods = ossl_load_builtin_compressions();
  218|      1|#endif
  219|       |
  220|      1|    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|      1|}
context.c:default_context_do_init:
  395|      1|{
  396|      1|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (396:9): [True: 0, False: 1]
  ------------------
  397|      0|        goto err;
  398|       |
  399|      1|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (399:9): [True: 0, False: 1]
  ------------------
  400|      0|        goto deinit_thread;
  401|       |
  402|      1|    default_context_inited = 1;
  403|      1|    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|  2.93k|{
  430|  2.93k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  431|       |
  432|  2.93k|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (432:9): [True: 2.93k, False: 0]
  |  Branch (432:35): [True: 2.93k, False: 0]
  ------------------
  433|  2.93k|        current_defctx = &default_context_int;
  434|  2.93k|    return current_defctx;
  435|  2.93k|}
context.c:get_thread_default_context:
  421|  2.93k|{
  422|  2.93k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  2.93k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2.93k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 0, False: 2.93k]
  ------------------
  423|      0|        return NULL;
  424|       |
  425|  2.93k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  426|  2.93k|}

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

ossl_method_construct:
  137|     20|{
  138|     20|    void *method = NULL;
  139|     20|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (139:31): [True: 20, False: 0]
  ------------------
  140|     20|    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|     20|    cbdata.store = NULL;
  154|     20|    cbdata.force_store = force_store;
  155|     20|    cbdata.mcm = mcm;
  156|     20|    cbdata.mcm_data = mcm_data;
  157|     20|    ossl_algorithm_do_all(libctx, operation_id, provider,
  158|     20|                          ossl_method_construct_precondition,
  159|     20|                          ossl_method_construct_reserve_store,
  160|     20|                          ossl_method_construct_this,
  161|     20|                          ossl_method_construct_unreserve_store,
  162|     20|                          ossl_method_construct_postcondition,
  163|     20|                          &cbdata);
  164|       |
  165|       |    /* If there is a temporary store, try there first */
  166|     20|    if (cbdata.store != NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 20]
  ------------------
  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|     20|    if (method == NULL)
  ------------------
  |  Branch (171:9): [True: 20, False: 0]
  ------------------
  172|     20|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  173|       |
  174|     20|    return method;
  175|     20|}
core_fetch.c:ossl_method_construct_precondition:
   63|     20|{
   64|     20|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|     20|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     20|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (64:9): [True: 0, False: 20]
  ------------------
   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|     20|    *result = 0;
   71|       |
   72|       |    /* No flag bits for temporary stores */
   73|     20|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (73:9): [True: 20, False: 0]
  ------------------
   74|     20|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (74:12): [True: 0, False: 20]
  ------------------
   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|     20|    *result = !*result;
   83|       |
   84|     20|    return 1;
   85|     20|}
core_fetch.c:is_temporary_method_store:
   29|     45|{
   30|     45|    struct construct_data_st *data = cbdata;
   31|       |
   32|     45|    return no_store && !data->force_store;
  ------------------
  |  Branch (32:12): [True: 0, False: 45]
  |  Branch (32:24): [True: 0, False: 0]
  ------------------
   33|     45|}
core_fetch.c:ossl_method_construct_reserve_store:
   36|     20|{
   37|     20|    struct construct_data_st *data = cbdata;
   38|       |
   39|     20|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 20]
  |  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|     20|    return data->mcm->lock_store(data->store, data->mcm_data);
   51|     20|}
core_fetch.c:ossl_method_construct_this:
  106|    261|{
  107|    261|    struct construct_data_st *data = cbdata;
  108|    261|    void *method = NULL;
  109|       |
  110|    261|    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
  ------------------
  |  Branch (110:9): [True: 0, False: 261]
  ------------------
  111|    261|        == NULL)
  112|      0|        return;
  113|       |
  114|    261|    OSSL_TRACE2(QUERY,
  ------------------
  |  |  293|    261|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    261|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  115|    261|                "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n",
  116|    261|                (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|    261|    data->mcm->put(no_store ? data->store : NULL, method, provider, algo->algorithm_names,
  ------------------
  |  Branch (127:20): [True: 0, False: 261]
  ------------------
  128|    261|                   algo->property_definition, data->mcm_data);
  129|       |
  130|       |    /* refcnt-- because we're dropping the reference */
  131|    261|    data->mcm->destruct(method, data->mcm_data);
  132|    261|}
core_fetch.c:ossl_method_construct_unreserve_store:
   54|     20|{
   55|     20|    struct construct_data_st *data = cbdata;
   56|       |
   57|     20|    return data->mcm->unlock_store(data->store, data->mcm_data);
   58|     20|}
core_fetch.c:ossl_method_construct_postcondition:
   90|      5|{
   91|      5|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|      5|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      5|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (91:9): [True: 0, False: 5]
  ------------------
   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|      5|    *result = 1;
   97|       |
   98|       |    /* No flag bits for temporary stores */
   99|      5|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (99:12): [True: 0, False: 5]
  ------------------
  100|      5|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (100:12): [True: 5, False: 0]
  ------------------
  101|      5|}

ossl_stored_namemap_new:
   56|      1|{
   57|      1|    OSSL_NAMEMAP *namemap = ossl_namemap_new(libctx);
   58|       |
   59|      1|    if (namemap != NULL)
  ------------------
  |  Branch (59:9): [True: 1, False: 0]
  ------------------
   60|      1|        namemap->stored = 1;
   61|       |
   62|      1|    return namemap;
   63|      1|}
ossl_stored_namemap_free:
   66|      1|{
   67|      1|    OSSL_NAMEMAP *namemap = vnamemap;
   68|       |
   69|      1|    if (namemap != NULL) {
  ------------------
  |  Branch (69:9): [True: 1, False: 0]
  ------------------
   70|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   71|      1|        namemap->stored = 0;
   72|      1|        ossl_namemap_free(namemap);
   73|      1|    }
   74|      1|}
ossl_namemap_empty:
   82|  3.48k|{
   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|  3.48k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|  3.48k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (97:12): [True: 0, False: 3.48k]
  |  Branch (97:31): [True: 1, False: 3.48k]
  ------------------
   98|  3.48k|#endif
   99|  3.48k|}
ossl_namemap_doall_names:
  109|    646|{
  110|    646|    int i;
  111|    646|    NAMES *names;
  112|       |
  113|    646|    if (namemap == NULL || number <= 0)
  ------------------
  |  Branch (113:9): [True: 0, False: 646]
  |  Branch (113:28): [True: 0, False: 646]
  ------------------
  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|    646|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (121:9): [True: 0, False: 646]
  ------------------
  122|      0|        return 0;
  123|       |
  124|    646|    names = sk_NAMES_value(namemap->numnames, number - 1);
  125|    646|    if (names != NULL)
  ------------------
  |  Branch (125:9): [True: 646, False: 0]
  ------------------
  126|    646|        names = sk_OPENSSL_STRING_dup(names);
  ------------------
  |  |  251|    646|#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
  ------------------
  127|       |
  128|    646|    CRYPTO_THREAD_unlock(namemap->lock);
  129|       |
  130|    646|    if (names == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 646]
  ------------------
  131|      0|        return 0;
  132|       |
  133|  2.86k|    for (i = 0; i < sk_OPENSSL_STRING_num(names); i++)
  ------------------
  |  |  229|  2.86k|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (133:17): [True: 2.21k, False: 646]
  ------------------
  134|  2.21k|        fn(sk_OPENSSL_STRING_value(names, i), data);
  ------------------
  |  |  230|  2.21k|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  135|       |
  136|    646|    sk_OPENSSL_STRING_free(names);
  ------------------
  |  |  235|    646|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  137|    646|    return i > 0;
  138|    646|}
ossl_namemap_name2num:
  141|  4.18k|{
  142|  4.18k|    int number = 0;
  143|  4.18k|    HT_VALUE *val;
  144|  4.18k|    NAMENUM_KEY key;
  145|       |
  146|  4.18k|#ifndef FIPS_MODULE
  147|  4.18k|    if (namemap == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 4.18k]
  ------------------
  148|      0|        namemap = ossl_namemap_stored(NULL);
  149|  4.18k|#endif
  150|       |
  151|  4.18k|    if (namemap == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 4.18k]
  ------------------
  152|      0|        return 0;
  153|       |
  154|  4.18k|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|  4.18k|#define HT_INIT_KEY(key) do { \
  |  |  108|  4.18k|memset((key), 0, sizeof(*(key))); \
  |  |  109|  4.18k|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|  4.18k|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|  4.18k|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|  4.18k|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|  4.18k|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|  4.18k|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|  4.18k|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  156|       |
  157|  4.18k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|  4.18k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  158|       |
  159|  4.18k|    if (val != NULL)
  ------------------
  |  Branch (159:9): [True: 3.26k, False: 923]
  ------------------
  160|       |        /* We store a (small) int directly instead of a pointer to it. */
  161|  3.26k|        number = (int)(intptr_t)val->value;
  162|       |
  163|  4.18k|    return number;
  164|  4.18k|}
ossl_namemap_name2num_n:
  168|    267|{
  169|    267|    int number = 0;
  170|    267|    HT_VALUE *val;
  171|    267|    NAMENUM_KEY key;
  172|       |
  173|    267|#ifndef FIPS_MODULE
  174|    267|    if (namemap == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 267]
  ------------------
  175|      0|        namemap = ossl_namemap_stored(NULL);
  176|    267|#endif
  177|       |
  178|    267|    if (namemap == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 267]
  ------------------
  179|      0|        return 0;
  180|       |
  181|    267|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    267|#define HT_INIT_KEY(key) do { \
  |  |  108|    267|memset((key), 0, sizeof(*(key))); \
  |  |  109|    267|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    267|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    267|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  182|    267|    HT_SET_KEY_STRING_CASE_N(&key, name, name, name_len);
  ------------------
  |  |  155|    267|#define HT_SET_KEY_STRING_CASE_N(key, member, value, len) do { \
  |  |  156|    267|    if (len < sizeof((key)->keyfields.member)) \
  |  |  ------------------
  |  |  |  Branch (156:9): [True: 267, False: 0]
  |  |  ------------------
  |  |  157|    267|        ossl_ht_strcase((key)->keyfields.member, value, len); \
  |  |  158|    267|    else \
  |  |  159|    267|        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  160|    267|} while(0)
  |  |  ------------------
  |  |  |  Branch (160:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  183|       |
  184|    267|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|    267|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  185|       |
  186|    267|    if (val != NULL)
  ------------------
  |  Branch (186:9): [True: 265, False: 2]
  ------------------
  187|       |        /* We store a (small) int directly instead of a pointer to it. */
  188|    265|        number = (int)(intptr_t)val->value;
  189|       |
  190|    267|    return number;
  191|    267|}
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|    261|{
  310|    261|    char *tmp, *p, *q, *endp;
  311|       |
  312|       |    /* Check that we have a namemap */
  313|    261|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|    261|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    261|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (313:9): [True: 0, False: 261]
  ------------------
  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|    261|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  119|    261|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (318:9): [True: 0, False: 261]
  ------------------
  319|      0|        return 0;
  320|       |
  321|    261|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (321:9): [True: 0, False: 261]
  ------------------
  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|    870|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (329:19): [True: 609, False: 261]
  ------------------
  330|    609|        int this_number;
  331|    609|        size_t l;
  332|       |
  333|    609|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (333:13): [True: 261, False: 348]
  ------------------
  334|    261|            l = strlen(p);       /* offset to \0 */
  335|    261|            q = p + l;
  336|    348|        } else {
  337|    348|            l = q - p;           /* offset to the next separator */
  338|    348|            *q++ = '\0';
  339|    348|        }
  340|       |
  341|    609|        if (*p == '\0') {
  ------------------
  |  Branch (341:13): [True: 0, False: 609]
  ------------------
  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|    609|        this_number = ossl_namemap_name2num(namemap, p);
  348|       |
  349|    609|        if (number == 0) {
  ------------------
  |  Branch (349:13): [True: 430, False: 179]
  ------------------
  350|    430|            number = this_number;
  351|    430|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (351:20): [True: 154, False: 25]
  |  Branch (351:40): [True: 0, False: 154]
  ------------------
  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|    609|    }
  359|    261|    endp = p;
  360|       |
  361|       |    /* Now that we have checked, register all names */
  362|    870|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (362:19): [True: 609, False: 261]
  ------------------
  363|    609|        int this_number;
  364|       |
  365|    609|        q = p + strlen(p) + 1;
  366|       |
  367|    609|        this_number = namemap_add_name(namemap, number, p);
  368|    609|        if (number == 0) {
  ------------------
  |  Branch (368:13): [True: 135, False: 474]
  ------------------
  369|    135|            number = this_number;
  370|    474|        } else if (this_number != number) {
  ------------------
  |  Branch (370:20): [True: 0, False: 474]
  ------------------
  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|    609|    }
  378|       |
  379|    261| end:
  380|    261|    CRYPTO_THREAD_unlock(namemap->lock);
  381|    261|    OPENSSL_free(tmp);
  ------------------
  |  |  115|    261|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  382|    261|    return number;
  383|    261|}
ossl_namemap_stored:
  481|  3.48k|{
  482|  3.48k|#ifndef FIPS_MODULE
  483|  3.48k|    int nms;
  484|  3.48k|#endif
  485|  3.48k|    OSSL_NAMEMAP *namemap =
  486|  3.48k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  102|  3.48k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  487|       |
  488|  3.48k|    if (namemap == NULL)
  ------------------
  |  Branch (488:9): [True: 0, False: 3.48k]
  ------------------
  489|      0|        return NULL;
  490|       |
  491|  3.48k|#ifndef FIPS_MODULE
  492|  3.48k|    nms = ossl_namemap_empty(namemap);
  493|  3.48k|    if (nms < 0) {
  ------------------
  |  Branch (493:9): [True: 0, False: 3.48k]
  ------------------
  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|  3.48k|    if (nms == 1) {
  ------------------
  |  Branch (500:9): [True: 1, False: 3.48k]
  ------------------
  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|  3.48k|#endif
  517|       |
  518|  3.48k|    return namemap;
  519|  3.48k|}
ossl_namemap_new:
  522|      1|{
  523|      1|    OSSL_NAMEMAP *namemap;
  524|      1|    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1 };
  ------------------
  |  |   16|      1|#define NAMEMAP_HT_BUCKETS 2048
  ------------------
  525|       |
  526|      1|    htconf.ctx = libctx;
  527|       |
  528|      1|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) == NULL)
  ------------------
  |  |  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 (528:9): [True: 0, False: 1]
  ------------------
  529|      0|        goto err;
  530|       |
  531|      1|    if ((namemap->lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (531:9): [True: 0, False: 1]
  ------------------
  532|      0|        goto err;
  533|       |
  534|      1|    if ((namemap->namenum_ht = ossl_ht_new(&htconf)) == NULL)
  ------------------
  |  Branch (534:9): [True: 0, False: 1]
  ------------------
  535|      0|        goto err;
  536|       |
  537|      1|    if ((namemap->numnames = sk_NAMES_new_null()) == NULL)
  ------------------
  |  Branch (537:9): [True: 0, False: 1]
  ------------------
  538|      0|        goto err;
  539|       |
  540|      1|    return namemap;
  541|       |
  542|      0| err:
  543|      0|    ossl_namemap_free(namemap);
  544|      0|    return NULL;
  545|      1|}
ossl_namemap_free:
  548|      1|{
  549|      1|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (549:9): [True: 0, False: 1]
  |  Branch (549:28): [True: 0, False: 1]
  ------------------
  550|      0|        return;
  551|       |
  552|      1|    sk_NAMES_pop_free(namemap->numnames, names_free);
  553|       |
  554|      1|    ossl_ht_free(namemap->namenum_ht);
  555|       |
  556|      1|    CRYPTO_THREAD_lock_free(namemap->lock);
  557|      1|    OPENSSL_free(namemap);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  558|      1|}
core_namemap.c:namemap_add_name:
  258|  1.25k|{
  259|  1.25k|    int ret;
  260|  1.25k|    HT_VALUE val = { 0 };
  261|  1.25k|    NAMENUM_KEY key;
  262|       |
  263|       |    /* If it already exists, we don't add it */
  264|  1.25k|    if ((ret = ossl_namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (264:9): [True: 669, False: 588]
  ------------------
  265|    669|        return ret;
  266|       |
  267|    588|    if ((number = numname_insert(namemap, number, name)) == 0)
  ------------------
  |  Branch (267:9): [True: 0, False: 588]
  ------------------
  268|      0|        return 0;
  269|       |
  270|       |    /* Using tsan_store alone here is safe since we're under lock */
  271|    588|    tsan_store(&namemap->max_number, number);
  ------------------
  |  |   62|    588|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  272|       |
  273|    588|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    588|#define HT_INIT_KEY(key) do { \
  |  |  108|    588|memset((key), 0, sizeof(*(key))); \
  |  |  109|    588|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    588|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    588|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|    588|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|    588|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|    588|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|    588|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|    588|    val.value = (void *)(intptr_t)number;
  276|    588|    ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
  ------------------
  |  |  173|    588|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  277|    588|    if (!ossl_assert(ret != 0)) /* cannot happen as we are under write lock */
  ------------------
  |  |   52|    588|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    588|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (277:9): [True: 0, False: 588]
  ------------------
  278|      0|        return 0;
  279|    588|    if (ret < 1) {
  ------------------
  |  Branch (279:9): [True: 0, False: 588]
  ------------------
  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|    588|    return number;
  285|    588|}
core_namemap.c:numname_insert:
  217|    588|{
  218|    588|    NAMES *names;
  219|    588|    char *tmpname;
  220|       |
  221|    588|    if (number > 0) {
  ------------------
  |  Branch (221:9): [True: 335, False: 253]
  ------------------
  222|    335|        names = sk_NAMES_value(namemap->numnames, number - 1);
  223|    335|        if (!ossl_assert(names != NULL)) {
  ------------------
  |  |   52|    335|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    335|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (223:13): [True: 0, False: 335]
  ------------------
  224|       |            /* cannot happen */
  225|      0|            return 0;
  226|      0|        }
  227|    335|    } else {
  228|       |        /* a completely new entry */
  229|    253|        names = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  232|    253|#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
  ------------------
  230|    253|        if (names == NULL)
  ------------------
  |  Branch (230:13): [True: 0, False: 253]
  ------------------
  231|      0|            return 0;
  232|    253|    }
  233|       |
  234|    588|    if ((tmpname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|    588|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    588|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    588|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (234:9): [True: 0, False: 588]
  ------------------
  235|      0|        goto err;
  236|       |
  237|    588|    if (!sk_OPENSSL_STRING_push(names, tmpname))
  ------------------
  |  |  239|    588|#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: 588]
  ------------------
  238|      0|        goto err;
  239|    588|    tmpname = NULL;
  240|       |
  241|    588|    if (number <= 0) {
  ------------------
  |  Branch (241:9): [True: 253, False: 335]
  ------------------
  242|    253|        if (!sk_NAMES_push(namemap->numnames, names))
  ------------------
  |  Branch (242:13): [True: 0, False: 253]
  ------------------
  243|      0|            goto err;
  244|    253|        number = sk_NAMES_num(namemap->numnames);
  245|    253|    }
  246|    588|    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|    588|}
core_namemap.c:name_string_free:
   44|    588|{
   45|    588|    OPENSSL_free(name);
  ------------------
  |  |  115|    588|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    588|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    588|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|    588|}
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|    253|{
   50|    253|    sk_OPENSSL_STRING_pop_free(n, name_string_free);
  ------------------
  |  |  243|    253|#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|    253|}

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

OPENSSL_cpuid_setup:
   96|      1|{
   97|      1|    static int trigger = 0;
   98|      1|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   99|      1|    IA32CAP vec;
  100|      1|    const variant_char *env;
  101|      1|    int index = 2;
  102|       |
  103|      1|    if (trigger)
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        return;
  105|       |
  106|      1|    trigger = 1;
  107|      1|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   47|      1|#   define ossl_getenv getenv
  ------------------
  |  Branch (107:9): [True: 0, False: 1]
  ------------------
  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|      1|    } else {
  162|      1|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  163|      1|    }
  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|      1|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  171|      1|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  172|      1|}

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

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

ossl_ctype_check:
  253|    168|{
  254|    168|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|    168|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|    168|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|    168|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 168, False: 0]
  |  Branch (257:22): [True: 168, False: 0]
  |  Branch (257:33): [True: 70, False: 98]
  ------------------
  258|    168|}
ossl_isdigit:
  270|  1.41k|{
  271|  1.41k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  1.41k|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|  1.41k|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  1.41k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 1.41k, False: 0]
  |  |  |  Branch (265:43): [True: 0, False: 1.41k]
  |  |  ------------------
  ------------------
  274|  1.41k|}
ossl_tolower:
  297|  60.2k|{
  298|  60.2k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  60.2k|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  60.2k|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  60.2k|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 44.8k, False: 15.3k]
  |  |  |  Branch (266:43): [True: 34.7k, False: 10.1k]
  |  |  ------------------
  ------------------
  301|  60.2k|}

ossl_DER_w_precompiled:
   54|    380|{
   55|    380|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (55:12): [True: 380, False: 0]
  ------------------
   56|    380|        && WPACKET_memcpy(pkt, precompiled, precompiled_n)
  ------------------
  |  Branch (56:12): [True: 380, False: 0]
  ------------------
   57|    380|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (57:12): [True: 380, False: 0]
  ------------------
   58|    380|}
ossl_DER_w_begin_sequence:
  172|    380|{
  173|    380|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (173:12): [True: 380, False: 0]
  ------------------
  174|    380|        && WPACKET_start_sub_packet(pkt);
  ------------------
  |  Branch (174:12): [True: 380, False: 0]
  ------------------
  175|    380|}
ossl_DER_w_end_sequence:
  178|    380|{
  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|    380|    size_t size1, size2;
  191|       |
  192|    380|    return WPACKET_get_total_written(pkt, &size1)
  ------------------
  |  Branch (192:12): [True: 380, False: 0]
  ------------------
  193|    380|        && WPACKET_close(pkt)
  ------------------
  |  Branch (193:12): [True: 380, False: 0]
  ------------------
  194|    380|        && WPACKET_get_total_written(pkt, &size2)
  ------------------
  |  Branch (194:12): [True: 380, False: 0]
  ------------------
  195|    380|        && (size1 == size2
  ------------------
  |  Branch (195:12): [True: 380, False: 0]
  |  Branch (195:13): [True: 0, False: 380]
  ------------------
  196|    380|            ? WPACKET_set_flags(pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH)
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  197|    380|            : WPACKET_put_bytes_u8(pkt, DER_F_CONSTRUCTED | DER_P_SEQUENCE))
  ------------------
  |  |  878|    380|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  198|    380|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (198:12): [True: 380, False: 0]
  ------------------
  199|    380|}
der_writer.c:int_start_context:
   17|    760|{
   18|    760|    if (tag < 0)
  ------------------
  |  Branch (18:9): [True: 760, False: 0]
  ------------------
   19|    760|        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|    760|{
   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|    760|    size_t size1, size2;
   36|       |
   37|    760|    if (tag < 0)
  ------------------
  |  Branch (37:9): [True: 760, False: 0]
  ------------------
   38|    760|        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|}

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

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

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

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

ossl_decoder_cache_new:
  703|      1|{
  704|      1|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  705|       |
  706|      1|    if (cache == NULL)
  ------------------
  |  Branch (706:9): [True: 0, False: 1]
  ------------------
  707|      0|        return NULL;
  708|       |
  709|      1|    cache->lock = CRYPTO_THREAD_lock_new();
  710|      1|    if (cache->lock == NULL) {
  ------------------
  |  Branch (710:9): [True: 0, False: 1]
  ------------------
  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|      1|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  715|      1|                                                  decoder_cache_entry_cmp);
  716|      1|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (716:9): [True: 0, False: 1]
  ------------------
  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|      1|    return cache;
  723|      1|}
ossl_decoder_cache_free:
  726|      1|{
  727|      1|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  728|       |
  729|      1|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  730|      1|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  731|      1|    CRYPTO_THREAD_lock_free(cache->lock);
  732|      1|    OPENSSL_free(cache);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  733|      1|}
ossl_decoder_cache_flush:
  740|      1|{
  741|      1|    DECODER_CACHE *cache
  742|      1|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  120|      1|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  743|       |
  744|      1|    if (cache == NULL)
  ------------------
  |  Branch (744:9): [True: 1, False: 0]
  ------------------
  745|      1|        return 0;
  746|       |
  747|       |
  748|      0|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (748:9): [True: 0, False: 0]
  ------------------
  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|      0|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  754|      0|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  755|       |
  756|      0|    CRYPTO_THREAD_unlock(cache->lock);
  757|      0|    return 1;
  758|      0|}

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

ENGINE_finish:
  107|  49.2k|{
  108|  49.2k|    int to_return = 1;
  109|       |
  110|  49.2k|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 49.2k, False: 0]
  ------------------
  111|  49.2k|        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|      1|{
  177|      1|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  179|      0|                                        engine_cleanup_cb_free);
  180|      0|        cleanup_stack = NULL;
  181|      0|    }
  182|      1|    CRYPTO_THREAD_lock_free(global_engine_lock);
  183|      1|    global_engine_lock = NULL;
  184|      1|}
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|      1|{
  120|      1|    if (cleanup_stack)
  ------------------
  |  Branch (120:9): [True: 0, False: 1]
  ------------------
  121|      0|        return 1;
  122|      1|    if (!create)
  ------------------
  |  Branch (122:9): [True: 1, False: 0]
  ------------------
  123|      1|        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|      1|}

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

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

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

ENGINE_get_digest_engine:
   67|  39.6k|{
   68|  39.6k|    return ossl_engine_table_select(&digest_table, nid,
   69|  39.6k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  39.6k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  39.6k|#   define OPENSSL_LINE __LINE__
  ------------------
   70|  39.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|}

OSSL_ERR_STATE_free:
  202|      1|{
  203|      1|    int i;
  204|       |
  205|      1|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 1]
  ------------------
  206|      0|        return;
  207|     17|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     17|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 16, False: 1]
  ------------------
  208|     16|        err_clear(state, i, 1);
  209|     16|    }
  210|      1|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      1|}
err_cleanup:
  233|      1|{
  234|      1|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 1, False: 0]
  ------------------
  235|      1|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      1|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      1|    err_string_lock = NULL;
  238|      1|#ifndef OPENSSL_NO_ERR
  239|      1|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      1|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      1|    int_error_hash = NULL;
  241|      1|#endif
  242|      1|}
ossl_err_load_ERR_strings:
  272|     35|{
  273|     35|#ifndef OPENSSL_NO_ERR
  274|     35|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     35|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 35, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 35]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     35|    err_load_strings(ERR_str_libraries);
  278|     35|    err_load_strings(ERR_str_reasons);
  279|     35|#endif
  280|     35|    return 1;
  281|     35|}
ERR_load_strings_const:
  297|     34|{
  298|     34|#ifndef OPENSSL_NO_ERR
  299|     34|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 34]
  ------------------
  300|      0|        return 0;
  301|     34|    err_load_strings(str);
  302|     34|#endif
  303|       |
  304|     34|    return 1;
  305|     34|}
ERR_peek_last_error:
  410|      2|{
  411|      2|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|      2|}
ERR_reason_error_string:
  613|     34|{
  614|     34|#ifndef OPENSSL_NO_ERR
  615|     34|    ERR_STRING_DATA d, *p = NULL;
  616|     34|    unsigned long l, r;
  617|       |
  618|     34|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     34|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 34, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 34]
  ------------------
  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|     34|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     34|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     34|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     34|    l = ERR_GET_LIB(e);
  631|     34|    r = ERR_GET_REASON(e);
  632|     34|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     34|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     34|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     34|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     34|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     34|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     34|    p = int_err_get_item(&d);
  634|     34|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 34, False: 0]
  ------------------
  635|     34|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     34|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     34|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     34|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     34|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     34|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     34|        p = int_err_get_item(&d);
  637|     34|    }
  638|     34|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 34, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     34|}
ossl_err_get_state_int:
  673|  9.48k|{
  674|  9.48k|    ERR_STATE *state;
  675|  9.48k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  9.48k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  9.48k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  9.48k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 9.48k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  9.48k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  9.48k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 9.48k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 9.48k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  9.48k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  9.48k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 9.48k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  9.48k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 1, False: 9.48k]
  ------------------
  688|      1|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 1]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      1|        state = OSSL_ERR_STATE_new();
  692|      1|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 1]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      1|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 1]
  ------------------
  698|      1|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 1]
  ------------------
  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|      1|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      1|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      1|    }
  707|       |
  708|  9.48k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  9.48k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  9.48k|    return state;
  710|  9.48k|}
err_shelve_state:
  725|      1|{
  726|      1|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      1|# 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|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 1]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      1|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 1]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      1|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      1|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 1]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      1|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      1|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      1|    return 1;
  752|      1|}
err_unshelve_state:
  759|      1|{
  760|      1|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 1, False: 0]
  ------------------
  761|      1|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      1|}
ERR_get_next_error_library:
  765|      1|{
  766|      1|    int ret;
  767|       |
  768|      1|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 0, False: 1]
  ------------------
  769|      0|        return 0;
  770|       |
  771|      1|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (771:9): [True: 0, False: 1]
  ------------------
  772|      0|        return 0;
  773|      1|    ret = int_err_library_number++;
  774|      1|    CRYPTO_THREAD_unlock(err_string_lock);
  775|      1|    return ret;
  776|      1|}
err.c:do_err_strings_init:
  214|      1|{
  215|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 1]
  ------------------
  216|      0|        return 0;
  217|      1|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      1|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 1]
  ------------------
  219|      0|        return 0;
  220|      1|#ifndef OPENSSL_NO_ERR
  221|      1|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      1|#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|      1|                                            err_string_data_cmp);
  223|      1|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 1]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      1|#endif
  229|      1|    return 1;
  230|      1|}
err.c:err_string_data_hash:
  172|  4.37k|{
  173|  4.37k|    unsigned long ret, l;
  174|       |
  175|  4.37k|    l = a->error;
  176|  4.37k|    ret = l ^ ERR_GET_LIB(l);
  177|  4.37k|    return (ret ^ ret % 19 * 13);
  178|  4.37k|}
err.c:err_string_data_cmp:
  182|  2.94k|{
  183|  2.94k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 2.78k, False: 158]
  ------------------
  184|  2.78k|        return 0;
  185|    158|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 84, False: 74]
  ------------------
  186|  2.94k|}
err.c:err_load_strings:
  260|    104|{
  261|    104|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 104]
  ------------------
  262|      0|        return 0;
  263|  4.41k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 4.31k, False: 104]
  ------------------
  264|  4.31k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  4.41k|#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|    104|                                       (ERR_STRING_DATA *)str);
  266|    104|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    104|    return 1;
  268|    104|}
err.c:get_error_values:
  448|      2|{
  449|      2|    int i = 0;
  450|      2|    ERR_STATE *es;
  451|      2|    unsigned long ret;
  452|       |
  453|      2|    es = ossl_err_get_state_int();
  454|      2|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 2]
  ------------------
  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|      2|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 2, False: 0]
  ------------------
  462|      2|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|      2|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 2]
  ------------------
  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|      2|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      2|#  define ERR_NUM_ERRORS  16
  ------------------
  468|      2|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|      2|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 2]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|      2|        break;
  474|      2|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|      2|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 0, False: 2]
  ------------------
  478|      0|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|      2|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 2, False: 0]
  ------------------
  482|      2|        i = es->top;
  483|      0|    else
  484|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|      2|    ret = es->err_buffer[i];
  487|      2|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 2]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|      2|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 2]
  ------------------
  493|      0|        *file = es->err_file[i];
  494|      0|        if (*file == NULL)
  ------------------
  |  Branch (494:13): [True: 0, False: 0]
  ------------------
  495|      0|            *file = "";
  496|      0|    }
  497|      2|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 2]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|      2|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 2]
  ------------------
  500|      0|        *func = es->err_func[i];
  501|      0|        if (*func == NULL)
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            *func = "";
  503|      0|    }
  504|      2|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 2]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|      2|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 2, False: 0]
  ------------------
  507|      2|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 2]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|      2|    } else {
  511|      0|        *data = es->err_data[i];
  512|      0|        if (*data == NULL) {
  ------------------
  |  Branch (512:13): [True: 0, False: 0]
  ------------------
  513|      0|            *data = "";
  514|      0|            if (flags != NULL)
  ------------------
  |  Branch (514:17): [True: 0, False: 0]
  ------------------
  515|      0|                *flags = 0;
  516|      0|        }
  517|      0|    }
  518|      2|    return ret;
  519|      2|}
err.c:int_err_get_item:
  189|     68|{
  190|     68|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|     68|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 68]
  ------------------
  193|      0|        return NULL;
  194|     68|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|     68|#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|     68|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|     68|    return p;
  198|     68|}
err.c:err_do_init:
  667|      1|{
  668|      1|    set_err_thread_local = 1;
  669|      1|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      1|}
err.c:err_delete_thread_state:
  645|      1|{
  646|      1|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      1|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 1]
  ------------------
  648|      0|        return;
  649|       |
  650|      1|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      1|    OSSL_ERR_STATE_free(state);
  652|      1|}

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

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

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

ERR_set_mark:
   16|  1.97k|{
   17|  1.97k|    ERR_STATE *es;
   18|       |
   19|  1.97k|    es = ossl_err_get_state_int();
   20|  1.97k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 1.97k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|  1.97k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 7, False: 1.96k]
  ------------------
   24|      7|        return 0;
   25|  1.96k|    es->err_marks[es->top]++;
   26|  1.96k|    return 1;
   27|  1.97k|}
ERR_pop_to_mark:
   43|  1.94k|{
   44|  1.94k|    ERR_STATE *es;
   45|       |
   46|  1.94k|    es = ossl_err_get_state_int();
   47|  1.94k|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 1.94k]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  3.73k|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 3.73k, False: 2]
  ------------------
   51|  3.73k|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 1.79k, False: 1.93k]
  ------------------
   52|  1.79k|        err_clear(es, es->top, 0);
   53|  1.79k|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|     32|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 1.76k, False: 32]
  ------------------
   54|  1.79k|    }
   55|       |
   56|  1.94k|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 2, False: 1.93k]
  ------------------
   57|      2|        return 0;
   58|  1.93k|    es->err_marks[es->top]--;
   59|  1.93k|    return 1;
   60|  1.94k|}
ERR_clear_last_mark:
   82|     36|{
   83|     36|    ERR_STATE *es;
   84|     36|    int top;
   85|       |
   86|     36|    es = ossl_err_get_state_int();
   87|     36|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 36]
  ------------------
   88|      0|        return 0;
   89|       |
   90|     36|    top = es->top;
   91|     36|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 31, False: 5]
  ------------------
   92|     36|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:15): [True: 0, False: 31]
  ------------------
   93|      0|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (93:15): [True: 0, False: 0]
  ------------------
   94|      0|    }
   95|       |
   96|     36|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 5, False: 31]
  ------------------
   97|      5|        return 0;
   98|     31|    es->err_marks[top]--;
   99|     31|    return 1;
  100|     36|}

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

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

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_md_ctx_clear_digest:
   45|  1.35k|{
   46|  1.35k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (46:9): [True: 1.20k, False: 142]
  ------------------
   47|  1.20k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (47:13): [True: 1.20k, False: 0]
  |  Branch (47:36): [True: 1.20k, False: 0]
  ------------------
   48|  1.20k|            ctx->digest->freectx(ctx->algctx);
   49|  1.20k|        ctx->algctx = NULL;
   50|  1.20k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  222|  1.20k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
   51|  1.20k|    }
   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|  1.35k|    cleanup_old_md_data(ctx, force);
   60|  1.35k|    if (force)
  ------------------
  |  Branch (60:9): [True: 0, False: 1.35k]
  ------------------
   61|      0|        ctx->digest = NULL;
   62|       |
   63|  1.35k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   64|  1.35k|    ENGINE_finish(ctx->engine);
   65|  1.35k|    ctx->engine = NULL;
   66|  1.35k|#endif
   67|       |
   68|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   69|  1.35k|    if (!keep_fetched) {
  ------------------
  |  Branch (69:9): [True: 1.35k, False: 0]
  ------------------
   70|  1.35k|        EVP_MD_free(ctx->fetched_digest);
   71|  1.35k|        ctx->fetched_digest = NULL;
   72|  1.35k|        ctx->reqdigest = NULL;
   73|  1.35k|    }
   74|  1.35k|}
EVP_MD_CTX_reset:
   99|  1.35k|{
  100|  1.35k|    return evp_md_ctx_reset_ex(ctx, 0);
  101|  1.35k|}
EVP_MD_CTX_new:
  130|  1.35k|{
  131|  1.35k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  104|  1.35k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.35k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.35k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  1.35k|}
EVP_MD_CTX_free:
  135|  1.73k|{
  136|  1.73k|    if (ctx == NULL)
  ------------------
  |  Branch (136:9): [True: 380, False: 1.35k]
  ------------------
  137|    380|        return;
  138|       |
  139|  1.35k|    EVP_MD_CTX_reset(ctx);
  140|  1.35k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.35k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.35k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.35k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  141|  1.35k|}
evp_md_ctx_free_algctx:
  144|  2.61k|{
  145|  2.61k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (145:9): [True: 1.26k, False: 1.35k]
  ------------------
  146|  1.26k|        if (!ossl_assert(ctx->digest != NULL)) {
  ------------------
  |  |   52|  1.26k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.26k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (146:13): [True: 0, False: 1.26k]
  ------------------
  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|  1.26k|        if (ctx->digest->freectx != NULL)
  ------------------
  |  Branch (150:13): [True: 1.26k, False: 0]
  ------------------
  151|  1.26k|            ctx->digest->freectx(ctx->algctx);
  152|  1.26k|        ctx->algctx = NULL;
  153|  1.26k|    }
  154|  2.61k|    return 1;
  155|  2.61k|}
EVP_DigestInit_ex2:
  370|  39.6k|{
  371|  39.6k|    return evp_md_init_internal(ctx, type, params, NULL);
  372|  39.6k|}
EVP_DigestUpdate:
  386|  42.3k|{
  387|  42.3k|    if (count == 0)
  ------------------
  |  Branch (387:9): [True: 190, False: 42.1k]
  ------------------
  388|    190|        return 1;
  389|       |
  390|  42.1k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  42.1k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (390:9): [True: 0, False: 42.1k]
  ------------------
  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|  42.1k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (395:9): [True: 0, False: 42.1k]
  ------------------
  396|  42.1k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|  42.1k|    (((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|  42.1k|            && 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|  42.1k|    if (ctx->digest == NULL
  ------------------
  |  Branch (416:9): [True: 0, False: 42.1k]
  ------------------
  417|  42.1k|            || ctx->digest->prov == NULL
  ------------------
  |  Branch (417:16): [True: 0, False: 42.1k]
  ------------------
  418|  42.1k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  244|  42.1k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (418:16): [True: 0, False: 42.1k]
  ------------------
  419|      0|        goto legacy;
  420|       |
  421|  42.1k|    if (ctx->digest->dupdate == NULL) {
  ------------------
  |  Branch (421:9): [True: 0, False: 42.1k]
  ------------------
  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|  42.1k|    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|  42.1k|}
EVP_DigestSqueeze:
  556|   151k|{
  557|   151k|    if (ctx->digest == NULL) {
  ------------------
  |  Branch (557:9): [True: 0, False: 151k]
  ------------------
  558|      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)
  |  |  ------------------
  ------------------
  559|      0|        return 0;
  560|      0|    }
  561|       |
  562|   151k|    if (ctx->digest->prov == NULL) {
  ------------------
  |  Branch (562:9): [True: 0, False: 151k]
  ------------------
  563|      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)
  |  |  ------------------
  ------------------
  564|      0|        return 0;
  565|      0|    }
  566|       |
  567|   151k|    if (ctx->digest->dsqueeze == NULL) {
  ------------------
  |  Branch (567:9): [True: 0, False: 151k]
  ------------------
  568|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  569|      0|        return 0;
  570|      0|    }
  571|       |
  572|   151k|    return ctx->digest->dsqueeze(ctx->algctx, md, &size, size);
  573|   151k|}
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|    948|{
 1165|    948|    EVP_MD *md =
 1166|    948|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  310|    948|# define OSSL_OP_DIGEST                              1
  ------------------
 1167|    948|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1168|       |
 1169|    948|    return md;
 1170|    948|}
EVP_MD_up_ref:
 1173|  3.45k|{
 1174|  3.45k|    int ref = 0;
 1175|       |
 1176|  3.45k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  3.45k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1176:9): [True: 3.45k, False: 0]
  ------------------
 1177|  3.45k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1178|  3.45k|    return 1;
 1179|  3.45k|}
EVP_MD_free:
 1182|  4.83k|{
 1183|  4.83k|    int i;
 1184|       |
 1185|  4.83k|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  3.48k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1185:9): [True: 1.35k, False: 3.48k]
  |  Branch (1185:23): [True: 0, False: 3.48k]
  ------------------
 1186|  1.35k|        return;
 1187|       |
 1188|  3.48k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1189|  3.48k|    if (i > 0)
  ------------------
  |  Branch (1189:9): [True: 3.45k, False: 27]
  ------------------
 1190|  3.45k|        return;
 1191|     27|    evp_md_free_int(md);
 1192|     27|}
digest.c:cleanup_old_md_data:
   30|  40.9k|{
   31|  40.9k|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (31:9): [True: 39.6k, False: 1.35k]
  ------------------
   32|  39.6k|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (32:13): [True: 0, False: 39.6k]
  ------------------
   33|  39.6k|                && !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|  39.6k|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (35:13): [True: 0, False: 39.6k]
  |  Branch (35:37): [True: 0, False: 0]
  ------------------
   36|  39.6k|                && (!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|  39.6k|    }
   42|  40.9k|}
digest.c:evp_md_ctx_reset_ex:
   77|  1.35k|{
   78|  1.35k|    if (ctx == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 1.35k]
  ------------------
   79|      0|        return 1;
   80|       |
   81|       |    /*
   82|       |     * pctx should be freed by the user of EVP_MD_CTX
   83|       |     * if EVP_MD_CTX_FLAG_KEEP_PKEY_CTX is set
   84|       |     */
   85|  1.35k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|  1.35k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  |  Branch (85:9): [True: 1.35k, False: 0]
  ------------------
   86|  1.35k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|  1.35k|        ctx->pctx = NULL;
   88|  1.35k|    }
   89|       |
   90|  1.35k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   91|  1.35k|    if (!keep_fetched)
  ------------------
  |  Branch (91:9): [True: 1.35k, False: 0]
  ------------------
   92|  1.35k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   93|       |
   94|  1.35k|    return 1;
   95|  1.35k|}
digest.c:evp_md_init_internal:
  159|  39.6k|{
  160|  39.6k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  161|  39.6k|    ENGINE *tmpimpl = NULL;
  162|  39.6k|#endif
  163|       |
  164|  39.6k|#if !defined(FIPS_MODULE)
  165|  39.6k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 39.6k]
  ------------------
  166|  39.6k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|  39.6k|    (((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|  39.6k|            && 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|  39.6k|#endif
  182|       |
  183|  39.6k|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED
  ------------------
  |  |  222|  39.6k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  184|  39.6k|                                | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|  39.6k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  185|       |
  186|  39.6k|    if (type != NULL) {
  ------------------
  |  Branch (186:9): [True: 39.6k, False: 0]
  ------------------
  187|  39.6k|        ctx->reqdigest = type;
  188|  39.6k|    } 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|  39.6k|#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|  39.6k|    if (ctx->engine != NULL
  ------------------
  |  Branch (204:9): [True: 0, False: 39.6k]
  ------------------
  205|  39.6k|            && ctx->digest != NULL
  ------------------
  |  Branch (205:16): [True: 0, False: 0]
  ------------------
  206|  39.6k|            && 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|  39.6k|    ENGINE_finish(ctx->engine);
  215|  39.6k|    ctx->engine = NULL;
  216|       |
  217|  39.6k|    if (impl == NULL)
  ------------------
  |  Branch (217:9): [True: 39.6k, False: 0]
  ------------------
  218|  39.6k|        tmpimpl = ENGINE_get_digest_engine(type->type);
  219|  39.6k|#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|  39.6k|    if (impl != NULL
  ------------------
  |  Branch (225:9): [True: 0, False: 39.6k]
  ------------------
  226|  39.6k|#if !defined(OPENSSL_NO_ENGINE)
  227|  39.6k|            || ctx->engine != NULL
  ------------------
  |  Branch (227:16): [True: 0, False: 39.6k]
  ------------------
  228|  39.6k|# if !defined(FIPS_MODULE)
  229|  39.6k|            || tmpimpl != NULL
  ------------------
  |  Branch (229:16): [True: 0, False: 39.6k]
  ------------------
  230|  39.6k|# endif
  231|  39.6k|#endif
  232|  39.6k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  244|  39.6k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (232:16): [True: 0, False: 39.6k]
  ------------------
  233|  39.6k|            || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|  39.6k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (233:17): [True: 39.6k, False: 0]
  |  Branch (233:33): [True: 0, False: 39.6k]
  ------------------
  234|  39.6k|            || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (234:17): [True: 0, False: 39.6k]
  |  Branch (234:33): [True: 0, False: 0]
  ------------------
  235|  39.6k|                             && 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|  39.6k|    cleanup_old_md_data(ctx, 1);
  247|       |
  248|       |    /* Start of non-legacy code below */
  249|  39.6k|    if (ctx->digest == type) {
  ------------------
  |  Branch (249:9): [True: 37.1k, False: 2.47k]
  ------------------
  250|  37.1k|        if (!ossl_assert(type->prov != NULL)) {
  ------------------
  |  |   52|  37.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  37.1k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (250:13): [True: 0, False: 37.1k]
  ------------------
  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|  37.1k|    } else {
  255|  2.47k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (255:13): [True: 0, False: 2.47k]
  ------------------
  256|      0|            return 0;
  257|  2.47k|    }
  258|       |
  259|  39.6k|    if (type->prov == NULL) {
  ------------------
  |  Branch (259:9): [True: 0, False: 39.6k]
  ------------------
  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|  39.6k|    if (type->prov != NULL && ctx->fetched_digest != type) {
  ------------------
  |  Branch (280:9): [True: 39.6k, False: 0]
  |  Branch (280:31): [True: 2.47k, False: 37.1k]
  ------------------
  281|  2.47k|        if (!EVP_MD_up_ref((EVP_MD *)type)) {
  ------------------
  |  Branch (281:13): [True: 0, False: 2.47k]
  ------------------
  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.47k|        EVP_MD_free(ctx->fetched_digest);
  286|  2.47k|        ctx->fetched_digest = (EVP_MD *)type;
  287|  2.47k|    }
  288|  39.6k|    ctx->digest = type;
  289|  39.6k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (289:9): [True: 2.47k, False: 37.1k]
  ------------------
  290|  2.47k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  291|  2.47k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (291:13): [True: 0, False: 2.47k]
  ------------------
  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.47k|    }
  296|       |
  297|  39.6k|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 39.6k]
  ------------------
  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|  39.6k|    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|    977|{
 1154|    977|    return EVP_MD_up_ref(md);
 1155|    977|}
digest.c:evp_md_free:
 1158|     56|{
 1159|     56|    EVP_MD_free(md);
 1160|     56|}

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

EVP_CIPHER_CTX_reset:
   34|      9|{
   35|      9|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 9]
  ------------------
   36|      0|        return 1;
   37|       |
   38|      9|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 9]
  |  Branch (38:32): [True: 0, False: 9]
  ------------------
   39|      0|        goto legacy;
   40|       |
   41|      9|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 9, False: 0]
  ------------------
   42|      9|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 9, False: 0]
  ------------------
   43|      9|            ctx->cipher->freectx(ctx->algctx);
   44|      9|        ctx->algctx = NULL;
   45|      9|    }
   46|      9|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 9, False: 0]
  ------------------
   47|      9|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|      9|    memset(ctx, 0, sizeof(*ctx));
   49|      9|    ctx->iv_len = -1;
   50|       |
   51|      9|    return 1;
   52|       |
   53|       |    /* Remove legacy code below when legacy support is removed. */
   54|      0| legacy:
   55|       |
   56|      0|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   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|      0|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|      0|    ENGINE_finish(ctx->engine);
   66|      0|#endif
   67|      0|    memset(ctx, 0, sizeof(*ctx));
   68|      0|    ctx->iv_len = -1;
   69|      0|    return 1;
   70|      0|}
EVP_CIPHER_CTX_new:
   73|      9|{
   74|      9|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|      9|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   77|      9|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 9]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|      9|    ctx->iv_len = -1;
   81|      9|    return ctx;
   82|      9|}
EVP_CIPHER_CTX_free:
   85|      9|{
   86|      9|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 9]
  ------------------
   87|      0|        return;
   88|      9|    EVP_CIPHER_CTX_reset(ctx);
   89|      9|    OPENSSL_free(ctx);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   90|      9|}
EVP_CipherInit_ex:
  652|  2.61k|{
  653|  2.61k|    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, 0, NULL);
  654|  2.61k|}
EVP_CipherUpdate:
  718|  1.79k|{
  719|  1.79k|    if (ctx->encrypt)
  ------------------
  |  Branch (719:9): [True: 1.79k, False: 0]
  ------------------
  720|  1.79k|        return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  721|      0|    else
  722|      0|        return EVP_DecryptUpdate(ctx, out, outl, in, inl);
  723|  1.79k|}
EVP_EncryptUpdate:
  979|  1.79k|{
  980|  1.79k|    int ret;
  981|  1.79k|    size_t soutl, inl_ = (size_t)inl;
  982|  1.79k|    int blocksize;
  983|       |
  984|  1.79k|    if (ossl_likely(outl != NULL)) {
  ------------------
  |  |   22|  1.79k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 1.79k, False: 0]
  |  |  ------------------
  ------------------
  985|  1.79k|        *outl = 0;
  986|  1.79k|    } else {
  987|      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)
  |  |  ------------------
  ------------------
  988|      0|        return 0;
  989|      0|    }
  990|       |
  991|       |    /* Prevent accidental use of decryption context when encrypting */
  992|  1.79k|    if (ossl_unlikely(!ctx->encrypt)) {
  ------------------
  |  |   23|  1.79k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 1.79k]
  |  |  ------------------
  ------------------
  993|      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)
  |  |  ------------------
  ------------------
  994|      0|        return 0;
  995|      0|    }
  996|       |
  997|  1.79k|    if (ossl_unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   23|  1.79k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 1.79k]
  |  |  ------------------
  ------------------
  998|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  999|      0|        return 0;
 1000|      0|    }
 1001|       |
 1002|  1.79k|    if (ossl_unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   23|  1.79k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 1.79k]
  |  |  ------------------
  ------------------
 1003|      0|        goto legacy;
 1004|       |
 1005|  1.79k|    blocksize = ctx->cipher->block_size;
 1006|       |
 1007|  1.79k|    if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   23|  3.58k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 1.79k]
  |  |  |  Branch (23:50): [True: 0, False: 1.79k]
  |  |  |  Branch (23:50): [True: 0, False: 1.79k]
  |  |  ------------------
  ------------------
 1008|      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)
  |  |  ------------------
  ------------------
 1009|      0|        return 0;
 1010|      0|    }
 1011|       |
 1012|  1.79k|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
 1013|  1.79k|                               inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (1013:48): [True: 858, False: 935]
  ------------------
 1014|  1.79k|                               in, inl_);
 1015|       |
 1016|  1.79k|    if (ossl_likely(ret)) {
  ------------------
  |  |   22|  1.79k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 1.79k, False: 0]
  |  |  ------------------
  ------------------
 1017|  1.79k|        if (soutl > INT_MAX) {
  ------------------
  |  Branch (1017:13): [True: 0, False: 1.79k]
  ------------------
 1018|      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)
  |  |  ------------------
  ------------------
 1019|      0|            return 0;
 1020|      0|        }
 1021|  1.79k|        *outl = soutl;
 1022|  1.79k|    }
 1023|       |
 1024|  1.79k|    return ret;
 1025|       |
 1026|       |    /* Code below to be removed when legacy support is dropped. */
 1027|      0| legacy:
 1028|       |
 1029|      0|    return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
 1030|  1.79k|}
EVP_CIPHER_gettable_ctx_params:
 1699|    130|{
 1700|    130|    void *provctx;
 1701|       |
 1702|    130|    if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (1702:9): [True: 130, False: 0]
  |  Branch (1702:27): [True: 130, False: 0]
  ------------------
 1703|    130|        provctx = ossl_provider_ctx(EVP_CIPHER_get0_provider(cipher));
 1704|    130|        return cipher->gettable_ctx_params(NULL, provctx);
 1705|    130|    }
 1706|      0|    return NULL;
 1707|    130|}
evp_cipher_new:
 1842|    130|{
 1843|    130|    EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
  ------------------
  |  |  104|    130|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1844|       |
 1845|    130|    if (cipher != NULL && !CRYPTO_NEW_REF(&cipher->refcnt, 1)) {
  ------------------
  |  Branch (1845:9): [True: 130, False: 0]
  |  Branch (1845:27): [True: 0, False: 130]
  ------------------
 1846|      0|        OPENSSL_free(cipher);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
 1847|      0|        return NULL;
 1848|      0|    }
 1849|    130|    return cipher;
 1850|    130|}
evp_cipher_fetch_from_prov:
 2085|      6|{
 2086|      6|    return evp_generic_fetch_from_prov(prov, OSSL_OP_CIPHER,
  ------------------
  |  |  311|      6|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
 2087|      6|                                       algorithm, properties,
 2088|      6|                                       evp_cipher_from_algorithm,
 2089|      6|                                       evp_cipher_up_ref,
 2090|      6|                                       evp_cipher_free);
 2091|      6|}
EVP_CIPHER_up_ref:
 2103|    147|{
 2104|    147|    int ref = 0;
 2105|       |
 2106|    147|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|    147|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2106:9): [True: 147, False: 0]
  ------------------
 2107|    147|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 2108|    147|    return 1;
 2109|    147|}
evp_cipher_free_int:
 2112|    130|{
 2113|    130|    OPENSSL_free(cipher->type_name);
  ------------------
  |  |  115|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2114|    130|    ossl_provider_free(cipher->prov);
 2115|    130|    CRYPTO_FREE_REF(&cipher->refcnt);
 2116|    130|    OPENSSL_free(cipher);
  ------------------
  |  |  115|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2117|    130|}
EVP_CIPHER_free:
 2120|    292|{
 2121|    292|    int i;
 2122|       |
 2123|    292|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|    277|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2123:9): [True: 15, False: 277]
  |  Branch (2123:27): [True: 0, False: 277]
  ------------------
 2124|     15|        return;
 2125|       |
 2126|    277|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 2127|    277|    if (i > 0)
  ------------------
  |  Branch (2127:9): [True: 147, False: 130]
  ------------------
 2128|    147|        return;
 2129|    130|    evp_cipher_free_int(cipher);
 2130|    130|}
evp_enc.c:evp_cipher_init_internal:
   98|  2.61k|{
   99|  2.61k|    int n;
  100|  2.61k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  101|  2.61k|    ENGINE *tmpimpl = NULL;
  102|  2.61k|#endif
  103|       |
  104|       |    /*
  105|       |     * enc == 1 means we are encrypting.
  106|       |     * enc == 0 means we are decrypting.
  107|       |     * enc == -1 means, use the previously initialised value for encrypt/decrypt
  108|       |     */
  109|  2.61k|    if (enc == -1) {
  ------------------
  |  Branch (109:9): [True: 2.60k, False: 9]
  ------------------
  110|  2.60k|        enc = ctx->encrypt;
  111|  2.60k|    } else {
  112|      9|        if (enc)
  ------------------
  |  Branch (112:13): [True: 9, False: 0]
  ------------------
  113|      9|            enc = 1;
  114|      9|        ctx->encrypt = enc;
  115|      9|    }
  116|       |
  117|  2.61k|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (117:9): [True: 2.60k, False: 9]
  |  Branch (117:27): [True: 0, False: 2.60k]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|       |
  122|       |    /* Code below to be removed when legacy support is dropped. */
  123|  2.61k|    if (is_pipeline)
  ------------------
  |  Branch (123:9): [True: 0, False: 2.61k]
  ------------------
  124|      0|        goto nonlegacy;
  125|       |
  126|  2.61k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  127|       |    /*
  128|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  129|       |     * this context may already have an ENGINE! Try to avoid releasing the
  130|       |     * previous handle, re-querying for an ENGINE, and having a
  131|       |     * reinitialisation, when it may all be unnecessary.
  132|       |     */
  133|  2.61k|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (133:9): [True: 0, False: 2.61k]
  |  Branch (133:24): [True: 0, False: 0]
  ------------------
  134|  2.61k|        && (cipher == NULL || cipher->nid == ctx->cipher->nid))
  ------------------
  |  Branch (134:13): [True: 0, False: 0]
  |  Branch (134:31): [True: 0, False: 0]
  ------------------
  135|      0|        goto skip_to_init;
  136|       |
  137|  2.61k|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (137:9): [True: 9, False: 2.60k]
  |  Branch (137:27): [True: 9, False: 0]
  ------------------
  138|       |         /* Ask if an ENGINE is reserved for this job */
  139|      9|        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
  140|      9|    }
  141|  2.61k|#endif
  142|       |
  143|       |    /*
  144|       |     * If there are engines involved then we should use legacy handling for now.
  145|       |     */
  146|  2.61k|    if (ctx->engine != NULL
  ------------------
  |  Branch (146:9): [True: 0, False: 2.61k]
  ------------------
  147|  2.61k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  148|  2.61k|            || tmpimpl != NULL
  ------------------
  |  Branch (148:16): [True: 0, False: 2.61k]
  ------------------
  149|  2.61k|#endif
  150|  2.61k|            || impl != NULL
  ------------------
  |  Branch (150:16): [True: 0, False: 2.61k]
  ------------------
  151|  2.61k|            || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|      9|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (151:17): [True: 9, False: 2.60k]
  |  Branch (151:35): [True: 0, False: 9]
  ------------------
  152|  2.61k|            || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (152:17): [True: 2.60k, False: 9]
  |  Branch (152:35): [True: 2.60k, False: 0]
  ------------------
  153|  2.61k|                               && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  254|  2.60k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (153:35): [True: 0, False: 2.60k]
  ------------------
  154|      0|        if (ctx->cipher == ctx->fetched_cipher)
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            ctx->cipher = NULL;
  156|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  157|      0|        ctx->fetched_cipher = NULL;
  158|      0|        goto legacy;
  159|      0|    }
  160|       |    /*
  161|       |     * Ensure a context left lying around from last time is cleared
  162|       |     * (legacy code)
  163|       |     */
  164|  2.61k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (164:9): [True: 9, False: 2.60k]
  |  Branch (164:27): [True: 0, False: 9]
  ------------------
  165|      0|        if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (165:13): [True: 0, False: 0]
  |  Branch (165:45): [True: 0, False: 0]
  ------------------
  166|      0|            return 0;
  167|      0|        OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->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__
  |  |  ------------------
  ------------------
  168|      0|        ctx->cipher_data = NULL;
  169|      0|    }
  170|       |
  171|       |    /* Start of non-legacy code below */
  172|  2.61k|nonlegacy:
  173|       |    /* Ensure a context left lying around from last time is cleared */
  174|  2.61k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (174:9): [True: 9, False: 2.60k]
  |  Branch (174:27): [True: 0, False: 9]
  ------------------
  175|      0|        unsigned long flags = ctx->flags;
  176|       |
  177|      0|        EVP_CIPHER_CTX_reset(ctx);
  178|       |        /* Restore encrypt and flags */
  179|      0|        ctx->encrypt = enc;
  180|      0|        ctx->flags = flags;
  181|      0|    }
  182|       |
  183|  2.61k|    if (cipher == NULL)
  ------------------
  |  Branch (183:9): [True: 2.60k, False: 9]
  ------------------
  184|  2.60k|        cipher = ctx->cipher;
  185|       |
  186|  2.61k|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 2.61k]
  ------------------
  187|       |#ifdef FIPS_MODULE
  188|       |        /* We only do explicit fetches inside the FIPS module */
  189|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  190|       |        return 0;
  191|       |#else
  192|      0|        EVP_CIPHER *provciph =
  193|      0|            EVP_CIPHER_fetch(NULL,
  194|      0|                             cipher->nid == NID_undef ? "NULL"
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (194:30): [True: 0, False: 0]
  ------------------
  195|      0|                                                      : OBJ_nid2sn(cipher->nid),
  196|      0|                             "");
  197|       |
  198|      0|        if (provciph == NULL)
  ------------------
  |  Branch (198:13): [True: 0, False: 0]
  ------------------
  199|      0|            return 0;
  200|      0|        cipher = provciph;
  201|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  202|      0|        ctx->fetched_cipher = provciph;
  203|      0|#endif
  204|      0|    }
  205|       |
  206|  2.61k|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   52|  2.61k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.61k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (206:9): [True: 0, False: 2.61k]
  ------------------
  207|      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)
  |  |  ------------------
  ------------------
  208|      0|        return 0;
  209|      0|    }
  210|       |
  211|  2.61k|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (211:9): [True: 9, False: 2.60k]
  ------------------
  212|      9|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (212:13): [True: 0, False: 9]
  ------------------
  213|      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)
  |  |  ------------------
  ------------------
  214|      0|            return 0;
  215|      0|        }
  216|      9|        EVP_CIPHER_free(ctx->fetched_cipher);
  217|       |        /* Coverity false positive, the reference counting is confusing it */
  218|       |        /* coverity[use_after_free] */
  219|      9|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  220|      9|    }
  221|  2.61k|    ctx->cipher = cipher;
  222|       |
  223|  2.61k|    if (is_pipeline && !EVP_CIPHER_can_pipeline(cipher, enc)) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2.61k]
  |  Branch (223:24): [True: 0, False: 0]
  ------------------
  224|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_PIPELINE_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)
  |  |  ------------------
  ------------------
  225|      0|        return 0;
  226|      0|    }
  227|       |
  228|  2.61k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (228:9): [True: 9, False: 2.60k]
  ------------------
  229|      9|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  230|      9|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (230:13): [True: 0, False: 9]
  ------------------
  231|      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)
  |  |  ------------------
  ------------------
  232|      0|            return 0;
  233|      0|        }
  234|      9|    }
  235|       |
  236|  2.61k|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  346|  2.61k|# define         EVP_CIPH_NO_PADDING             0x100
  ------------------
  |  Branch (236:9): [True: 0, False: 2.61k]
  ------------------
  237|       |        /*
  238|       |         * If this ctx was already set up for no padding then we need to tell
  239|       |         * the new cipher about it.
  240|       |         */
  241|      0|        if (!EVP_CIPHER_CTX_set_padding(ctx, 0))
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|            return 0;
  243|      0|    }
  244|       |
  245|  2.61k|#ifndef FIPS_MODULE
  246|       |    /*
  247|       |     * Fix for CVE-2023-5363
  248|       |     * Passing in a size as part of the init call takes effect late
  249|       |     * so, force such to occur before the initialisation.
  250|       |     *
  251|       |     * The FIPS provider's internal library context is used in a manner
  252|       |     * such that this is not an issue.
  253|       |     */
  254|  2.61k|    if (params != NULL) {
  ------------------
  |  Branch (254:9): [True: 0, False: 2.61k]
  ------------------
  255|      0|        OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  256|      0|                                     OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  257|      0|        OSSL_PARAM *q = param_lens;
  258|      0|        const OSSL_PARAM *p;
  259|       |
  260|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|      0|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  261|      0|        if (p != NULL)
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            memcpy(q++, p, sizeof(*q));
  263|       |
  264|       |        /*
  265|       |         * Note that OSSL_CIPHER_PARAM_AEAD_IVLEN is a synonym for
  266|       |         * OSSL_CIPHER_PARAM_IVLEN so both are covered here.
  267|       |         */
  268|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|      0|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  269|      0|        if (p != NULL)
  ------------------
  |  Branch (269:13): [True: 0, False: 0]
  ------------------
  270|      0|            memcpy(q++, p, sizeof(*q));
  271|       |
  272|      0|        if (q != param_lens) {
  ------------------
  |  Branch (272:13): [True: 0, False: 0]
  ------------------
  273|      0|            if (!EVP_CIPHER_CTX_set_params(ctx, param_lens)) {
  ------------------
  |  Branch (273:17): [True: 0, False: 0]
  ------------------
  274|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|        }
  278|      0|    }
  279|  2.61k|#endif
  280|       |
  281|  2.61k|    if (is_pipeline)
  ------------------
  |  Branch (281:9): [True: 0, False: 2.61k]
  ------------------
  282|      0|        return 1;
  283|       |
  284|  2.61k|    if (enc) {
  ------------------
  |  Branch (284:9): [True: 2.61k, False: 0]
  ------------------
  285|  2.61k|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (285:13): [True: 0, False: 2.61k]
  ------------------
  286|       |            /*
  287|       |             * We still should be able to set the IV using the new API
  288|       |             * if the key is not specified and old API is not available
  289|       |             */
  290|      0|            if (key == NULL && ctx->cipher->einit_skey != NULL) {
  ------------------
  |  Branch (290:17): [True: 0, False: 0]
  |  Branch (290:32): [True: 0, False: 0]
  ------------------
  291|      0|                return ctx->cipher->einit_skey(ctx->algctx, NULL,
  292|      0|                                               iv,
  293|      0|                                               iv == NULL ? 0
  ------------------
  |  Branch (293:48): [True: 0, False: 0]
  ------------------
  294|      0|                                                          : EVP_CIPHER_CTX_get_iv_length(ctx),
  295|      0|                                               params);
  296|      0|            }
  297|      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)
  |  |  ------------------
  ------------------
  298|      0|            return 0;
  299|      0|        }
  300|       |
  301|  2.61k|        return ctx->cipher->einit(ctx->algctx,
  302|  2.61k|                                  key,
  303|  2.61k|                                  key == NULL ? 0
  ------------------
  |  Branch (303:35): [True: 864, False: 1.74k]
  ------------------
  304|  2.61k|                                              : EVP_CIPHER_CTX_get_key_length(ctx),
  305|  2.61k|                                  iv,
  306|  2.61k|                                  iv == NULL ? 0
  ------------------
  |  Branch (306:35): [True: 1.75k, False: 858]
  ------------------
  307|  2.61k|                                             : EVP_CIPHER_CTX_get_iv_length(ctx),
  308|  2.61k|                                  params);
  309|  2.61k|    }
  310|       |
  311|      0|    if (ctx->cipher->dinit == NULL) {
  ------------------
  |  Branch (311:9): [True: 0, False: 0]
  ------------------
  312|       |        /*
  313|       |         * We still should be able to set the IV using the new API
  314|       |         * if the key is not specified and old API is not available
  315|       |         */
  316|      0|        if (key == NULL && ctx->cipher->dinit_skey != NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 0]
  |  Branch (316:28): [True: 0, False: 0]
  ------------------
  317|      0|            return ctx->cipher->dinit_skey(ctx->algctx, NULL,
  318|      0|                                           iv,
  319|      0|                                           iv == NULL ? 0
  ------------------
  |  Branch (319:44): [True: 0, False: 0]
  ------------------
  320|      0|                                                      : EVP_CIPHER_CTX_get_iv_length(ctx),
  321|      0|                                           params);
  322|      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|        return 0;
  325|      0|    }
  326|       |
  327|      0|    return ctx->cipher->dinit(ctx->algctx,
  328|      0|                              key,
  329|      0|                              key == NULL ? 0
  ------------------
  |  Branch (329:31): [True: 0, False: 0]
  ------------------
  330|      0|                                          : EVP_CIPHER_CTX_get_key_length(ctx),
  331|      0|                              iv,
  332|      0|                              iv == NULL ? 0
  ------------------
  |  Branch (332:31): [True: 0, False: 0]
  ------------------
  333|      0|                                         : EVP_CIPHER_CTX_get_iv_length(ctx),
  334|      0|                                  params);
  335|       |
  336|       |    /* Code below to be removed when legacy support is dropped. */
  337|      0| legacy:
  338|       |
  339|      0|    if (cipher != NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|       |        /*
  341|       |         * Ensure a context left lying around from last time is cleared (we
  342|       |         * previously attempted to avoid this if the same ENGINE and
  343|       |         * EVP_CIPHER could be used).
  344|       |         */
  345|      0|        if (ctx->cipher) {
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            unsigned long flags = ctx->flags;
  347|      0|            EVP_CIPHER_CTX_reset(ctx);
  348|       |            /* Restore encrypt and flags */
  349|      0|            ctx->encrypt = enc;
  350|      0|            ctx->flags = flags;
  351|      0|        }
  352|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  353|      0|        if (impl != NULL) {
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  ------------------
  355|      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)
  |  |  ------------------
  ------------------
  356|      0|                return 0;
  357|      0|            }
  358|      0|        } else {
  359|      0|            impl = tmpimpl;
  360|      0|        }
  361|      0|        if (impl != NULL) {
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  ------------------
  362|       |            /* There's an ENGINE for this job ... (apparently) */
  363|      0|            const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
  364|       |
  365|      0|            if (c == NULL) {
  ------------------
  |  Branch (365:17): [True: 0, False: 0]
  ------------------
  366|       |                /*
  367|       |                 * One positive side-effect of US's export control history,
  368|       |                 * is that we should at least be able to avoid using US
  369|       |                 * misspellings of "initialisation"?
  370|       |                 */
  371|      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)
  |  |  ------------------
  ------------------
  372|      0|                return 0;
  373|      0|            }
  374|       |            /* We'll use the ENGINE's private cipher definition */
  375|      0|            cipher = c;
  376|       |            /*
  377|       |             * Store the ENGINE functional reference so we know 'cipher' came
  378|       |             * from an ENGINE and we need to release it when done.
  379|       |             */
  380|      0|            ctx->engine = impl;
  381|      0|        } else {
  382|      0|            ctx->engine = NULL;
  383|      0|        }
  384|      0|#endif
  385|       |
  386|      0|        ctx->cipher = cipher;
  387|      0|        if (ctx->cipher->ctx_size) {
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            ctx->cipher_data = OPENSSL_zalloc(ctx->cipher->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__
  |  |  ------------------
  ------------------
  389|      0|            if (ctx->cipher_data == NULL) {
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  ------------------
  390|      0|                ctx->cipher = NULL;
  391|      0|                return 0;
  392|      0|            }
  393|      0|        } else {
  394|      0|            ctx->cipher_data = NULL;
  395|      0|        }
  396|      0|        ctx->key_len = cipher->key_len;
  397|       |        /* Preserve wrap enable flag, zero everything else */
  398|      0|        ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
  ------------------
  |  |  386|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  399|      0|        if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
  ------------------
  |  |  342|      0|# define         EVP_CIPH_CTRL_INIT              0x40
  ------------------
  |  Branch (399:13): [True: 0, False: 0]
  ------------------
  400|      0|            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
  ------------------
  |  |  390|      0|# define         EVP_CTRL_INIT                   0x0
  ------------------
  |  Branch (400:17): [True: 0, False: 0]
  ------------------
  401|      0|                ctx->cipher = NULL;
  402|      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)
  |  |  ------------------
  ------------------
  403|      0|                return 0;
  404|      0|            }
  405|      0|        }
  406|      0|    }
  407|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  408|      0| skip_to_init:
  409|      0|#endif
  410|      0|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (410:9): [True: 0, False: 0]
  ------------------
  411|      0|        return 0;
  412|       |
  413|       |    /* we assume block size is a power of 2 in *cryptUpdate */
  414|      0|    OPENSSL_assert(ctx->cipher->block_size == 1
  ------------------
  |  |  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:13): [True: 0, False: 0]
  |  |  |  Branch (438:13): [True: 0, False: 0]
  |  |  |  Branch (438:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  415|      0|                   || ctx->cipher->block_size == 8
  416|      0|                   || ctx->cipher->block_size == 16);
  417|       |
  418|      0|    if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW)
  ------------------
  |  |  386|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  |  Branch (418:9): [True: 0, False: 0]
  ------------------
  419|      0|        && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  679|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
                      && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  330|      0|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  |  Branch (419:12): [True: 0, False: 0]
  ------------------
  420|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|        return 0;
  422|      0|    }
  423|       |
  424|      0|    if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ctx))
  ------------------
  |  Branch (424:9): [True: 0, False: 0]
  ------------------
  425|      0|                & EVP_CIPH_CUSTOM_IV) == 0) {
  ------------------
  |  |  338|      0|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  426|      0|        switch (EVP_CIPHER_CTX_get_mode(ctx)) {
  ------------------
  |  |  679|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
  427|       |
  428|      0|        case EVP_CIPH_STREAM_CIPHER:
  ------------------
  |  |  321|      0|# define         EVP_CIPH_STREAM_CIPHER          0x0
  ------------------
  |  Branch (428:9): [True: 0, False: 0]
  ------------------
  429|      0|        case EVP_CIPH_ECB_MODE:
  ------------------
  |  |  322|      0|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|      0|            break;
  431|       |
  432|      0|        case EVP_CIPH_CFB_MODE:
  ------------------
  |  |  324|      0|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (432:9): [True: 0, False: 0]
  ------------------
  433|      0|        case EVP_CIPH_OFB_MODE:
  ------------------
  |  |  325|      0|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (433:9): [True: 0, False: 0]
  ------------------
  434|       |
  435|      0|            ctx->num = 0;
  436|       |            /* fall-through */
  437|       |
  438|      0|        case EVP_CIPH_CBC_MODE:
  ------------------
  |  |  323|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (438:9): [True: 0, False: 0]
  ------------------
  439|      0|            n = EVP_CIPHER_CTX_get_iv_length(ctx);
  440|      0|            if (n < 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (440:17): [True: 0, False: 0]
  |  Branch (440:26): [True: 0, False: 0]
  ------------------
  441|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|            if (iv != NULL)
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                memcpy(ctx->oiv, iv, n);
  446|      0|            memcpy(ctx->iv, ctx->oiv, n);
  447|      0|            break;
  448|       |
  449|      0|        case EVP_CIPH_CTR_MODE:
  ------------------
  |  |  326|      0|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (449:9): [True: 0, False: 0]
  ------------------
  450|      0|            ctx->num = 0;
  451|       |            /* Don't reuse IV for CTR mode */
  452|      0|            if (iv != NULL) {
  ------------------
  |  Branch (452:17): [True: 0, False: 0]
  ------------------
  453|      0|                n = EVP_CIPHER_CTX_get_iv_length(ctx);
  454|      0|                if (n <= 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (454:21): [True: 0, False: 0]
  |  Branch (454:31): [True: 0, False: 0]
  ------------------
  455|      0|                    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|                memcpy(ctx->iv, iv, n);
  459|      0|            }
  460|      0|            break;
  461|       |
  462|      0|        default:
  ------------------
  |  Branch (462:9): [True: 0, False: 0]
  ------------------
  463|      0|            return 0;
  464|      0|        }
  465|      0|    }
  466|       |
  467|      0|    if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
  ------------------
  |  |  340|      0|# define         EVP_CIPH_ALWAYS_CALL_INIT       0x20
  ------------------
  |  Branch (467:9): [True: 0, False: 0]
  |  Branch (467:24): [True: 0, False: 0]
  ------------------
  468|      0|        if (!ctx->cipher->init(ctx, key, iv, enc))
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  ------------------
  469|      0|            return 0;
  470|      0|    }
  471|      0|    ctx->buf_len = 0;
  472|      0|    ctx->final_used = 0;
  473|      0|    ctx->block_mask = ctx->cipher->block_size - 1;
  474|      0|    return 1;
  475|      0|}
evp_enc.c:evp_cipher_from_algorithm:
 1886|    130|{
 1887|    130|    const OSSL_DISPATCH *fns = algodef->implementation;
 1888|    130|    EVP_CIPHER *cipher = NULL;
 1889|    130|    int fnciphcnt = 0, encinit = 0, decinit = 0, fnpipecnt = 0, fnctxcnt = 0;
 1890|       |
 1891|    130|    if ((cipher = evp_cipher_new()) == NULL) {
  ------------------
  |  Branch (1891:9): [True: 0, False: 130]
  ------------------
 1892|      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)
  |  |  ------------------
  ------------------
 1893|      0|        return NULL;
 1894|      0|    }
 1895|       |
 1896|    130|#ifndef FIPS_MODULE
 1897|    130|    cipher->nid = NID_undef;
  ------------------
  |  |   18|    130|#define NID_undef                       0
  ------------------
 1898|    130|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
  ------------------
  |  Branch (1898:9): [True: 0, False: 130]
  ------------------
 1899|    130|            || cipher->nid == -1) {
  ------------------
  |  Branch (1899:16): [True: 0, False: 130]
  ------------------
 1900|      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)
  |  |  ------------------
  ------------------
 1901|      0|        goto err;
 1902|      0|    }
 1903|    130|#endif
 1904|       |
 1905|    130|    cipher->name_id = name_id;
 1906|    130|    if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1906:9): [True: 0, False: 130]
  ------------------
 1907|      0|        goto err;
 1908|       |
 1909|    130|    cipher->description = algodef->algorithm_description;
 1910|       |
 1911|  2.07k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1911:12): [True: 1.94k, False: 130]
  ------------------
 1912|  1.94k|        switch (fns->function_id) {
  ------------------
  |  Branch (1912:17): [True: 0, False: 1.94k]
  ------------------
 1913|    130|        case OSSL_FUNC_CIPHER_NEWCTX:
  ------------------
  |  |  378|    130|# define OSSL_FUNC_CIPHER_NEWCTX                     1
  ------------------
  |  Branch (1913:9): [True: 130, False: 1.81k]
  ------------------
 1914|    130|            if (cipher->newctx != NULL)
  ------------------
  |  Branch (1914:17): [True: 0, False: 130]
  ------------------
 1915|      0|                break;
 1916|    130|            cipher->newctx = OSSL_FUNC_cipher_newctx(fns);
 1917|    130|            fnctxcnt++;
 1918|    130|            break;
 1919|    130|        case OSSL_FUNC_CIPHER_ENCRYPT_INIT:
  ------------------
  |  |  379|    130|# define OSSL_FUNC_CIPHER_ENCRYPT_INIT               2
  ------------------
  |  Branch (1919:9): [True: 130, False: 1.81k]
  ------------------
 1920|    130|            if (cipher->einit != NULL)
  ------------------
  |  Branch (1920:17): [True: 0, False: 130]
  ------------------
 1921|      0|                break;
 1922|    130|            cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns);
 1923|    130|            encinit = 1;
 1924|    130|            break;
 1925|    130|        case OSSL_FUNC_CIPHER_DECRYPT_INIT:
  ------------------
  |  |  380|    130|# define OSSL_FUNC_CIPHER_DECRYPT_INIT               3
  ------------------
  |  Branch (1925:9): [True: 130, False: 1.81k]
  ------------------
 1926|    130|            if (cipher->dinit != NULL)
  ------------------
  |  Branch (1926:17): [True: 0, False: 130]
  ------------------
 1927|      0|                break;
 1928|    130|            cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns);
 1929|    130|            decinit = 1;
 1930|    130|            break;
 1931|     68|        case OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT:
  ------------------
  |  |  396|     68|# define OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT         19
  ------------------
  |  Branch (1931:9): [True: 68, False: 1.87k]
  ------------------
 1932|     68|            if (cipher->einit_skey != NULL)
  ------------------
  |  Branch (1932:17): [True: 0, False: 68]
  ------------------
 1933|      0|                break;
 1934|     68|            cipher->einit_skey = OSSL_FUNC_cipher_encrypt_skey_init(fns);
 1935|     68|            encinit = 1;
 1936|     68|            break;
 1937|     68|        case OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT:
  ------------------
  |  |  397|     68|# define OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT         20
  ------------------
  |  Branch (1937:9): [True: 68, False: 1.87k]
  ------------------
 1938|     68|            if (cipher->dinit_skey != NULL)
  ------------------
  |  Branch (1938:17): [True: 0, False: 68]
  ------------------
 1939|      0|                break;
 1940|     68|            cipher->dinit_skey = OSSL_FUNC_cipher_decrypt_skey_init(fns);
 1941|     68|            decinit = 1;
 1942|     68|            break;
 1943|    130|        case OSSL_FUNC_CIPHER_UPDATE:
  ------------------
  |  |  381|    130|# define OSSL_FUNC_CIPHER_UPDATE                     4
  ------------------
  |  Branch (1943:9): [True: 130, False: 1.81k]
  ------------------
 1944|    130|            if (cipher->cupdate != NULL)
  ------------------
  |  Branch (1944:17): [True: 0, False: 130]
  ------------------
 1945|      0|                break;
 1946|    130|            cipher->cupdate = OSSL_FUNC_cipher_update(fns);
 1947|    130|            fnciphcnt++;
 1948|    130|            break;
 1949|    130|        case OSSL_FUNC_CIPHER_FINAL:
  ------------------
  |  |  382|    130|# define OSSL_FUNC_CIPHER_FINAL                      5
  ------------------
  |  Branch (1949:9): [True: 130, False: 1.81k]
  ------------------
 1950|    130|            if (cipher->cfinal != NULL)
  ------------------
  |  Branch (1950:17): [True: 0, False: 130]
  ------------------
 1951|      0|                break;
 1952|    130|            cipher->cfinal = OSSL_FUNC_cipher_final(fns);
 1953|    130|            fnciphcnt++;
 1954|    130|            break;
 1955|    118|        case OSSL_FUNC_CIPHER_CIPHER:
  ------------------
  |  |  383|    118|# define OSSL_FUNC_CIPHER_CIPHER                     6
  ------------------
  |  Branch (1955:9): [True: 118, False: 1.82k]
  ------------------
 1956|    118|            if (cipher->ccipher != NULL)
  ------------------
  |  Branch (1956:17): [True: 0, False: 118]
  ------------------
 1957|      0|                break;
 1958|    118|            cipher->ccipher = OSSL_FUNC_cipher_cipher(fns);
 1959|    118|            break;
 1960|      0|        case OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT:
  ------------------
  |  |  392|      0|# define OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT     15
  ------------------
  |  Branch (1960:9): [True: 0, False: 1.94k]
  ------------------
 1961|      0|            if (cipher->p_einit != NULL)
  ------------------
  |  Branch (1961:17): [True: 0, False: 0]
  ------------------
 1962|      0|                break;
 1963|      0|            cipher->p_einit = OSSL_FUNC_cipher_pipeline_encrypt_init(fns);
 1964|      0|            fnpipecnt++;
 1965|      0|            break;
 1966|      0|        case OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT:
  ------------------
  |  |  393|      0|# define OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT     16
  ------------------
  |  Branch (1966:9): [True: 0, False: 1.94k]
  ------------------
 1967|      0|            if (cipher->p_dinit != NULL)
  ------------------
  |  Branch (1967:17): [True: 0, False: 0]
  ------------------
 1968|      0|                break;
 1969|      0|            cipher->p_dinit = OSSL_FUNC_cipher_pipeline_decrypt_init(fns);
 1970|      0|            fnpipecnt++;
 1971|      0|            break;
 1972|      0|        case OSSL_FUNC_CIPHER_PIPELINE_UPDATE:
  ------------------
  |  |  394|      0|# define OSSL_FUNC_CIPHER_PIPELINE_UPDATE           17
  ------------------
  |  Branch (1972:9): [True: 0, False: 1.94k]
  ------------------
 1973|      0|            if (cipher->p_cupdate != NULL)
  ------------------
  |  Branch (1973:17): [True: 0, False: 0]
  ------------------
 1974|      0|                break;
 1975|      0|            cipher->p_cupdate = OSSL_FUNC_cipher_pipeline_update(fns);
 1976|      0|            fnpipecnt++;
 1977|      0|            break;
 1978|      0|        case OSSL_FUNC_CIPHER_PIPELINE_FINAL:
  ------------------
  |  |  395|      0|# define OSSL_FUNC_CIPHER_PIPELINE_FINAL            18
  ------------------
  |  Branch (1978:9): [True: 0, False: 1.94k]
  ------------------
 1979|      0|            if (cipher->p_cfinal != NULL)
  ------------------
  |  Branch (1979:17): [True: 0, False: 0]
  ------------------
 1980|      0|                break;
 1981|      0|            cipher->p_cfinal = OSSL_FUNC_cipher_pipeline_final(fns);
 1982|      0|            fnpipecnt++;
 1983|      0|            break;
 1984|    130|        case OSSL_FUNC_CIPHER_FREECTX:
  ------------------
  |  |  384|    130|# define OSSL_FUNC_CIPHER_FREECTX                    7
  ------------------
  |  Branch (1984:9): [True: 130, False: 1.81k]
  ------------------
 1985|    130|            if (cipher->freectx != NULL)
  ------------------
  |  Branch (1985:17): [True: 0, False: 130]
  ------------------
 1986|      0|                break;
 1987|    130|            cipher->freectx = OSSL_FUNC_cipher_freectx(fns);
 1988|    130|            fnctxcnt++;
 1989|    130|            break;
 1990|    129|        case OSSL_FUNC_CIPHER_DUPCTX:
  ------------------
  |  |  385|    129|# define OSSL_FUNC_CIPHER_DUPCTX                     8
  ------------------
  |  Branch (1990:9): [True: 129, False: 1.81k]
  ------------------
 1991|    129|            if (cipher->dupctx != NULL)
  ------------------
  |  Branch (1991:17): [True: 0, False: 129]
  ------------------
 1992|      0|                break;
 1993|    129|            cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns);
 1994|    129|            break;
 1995|    130|        case OSSL_FUNC_CIPHER_GET_PARAMS:
  ------------------
  |  |  386|    130|# define OSSL_FUNC_CIPHER_GET_PARAMS                 9
  ------------------
  |  Branch (1995:9): [True: 130, False: 1.81k]
  ------------------
 1996|    130|            if (cipher->get_params != NULL)
  ------------------
  |  Branch (1996:17): [True: 0, False: 130]
  ------------------
 1997|      0|                break;
 1998|    130|            cipher->get_params = OSSL_FUNC_cipher_get_params(fns);
 1999|    130|            break;
 2000|    130|        case OSSL_FUNC_CIPHER_GET_CTX_PARAMS:
  ------------------
  |  |  387|    130|# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS            10
  ------------------
  |  Branch (2000:9): [True: 130, False: 1.81k]
  ------------------
 2001|    130|            if (cipher->get_ctx_params != NULL)
  ------------------
  |  Branch (2001:17): [True: 0, False: 130]
  ------------------
 2002|      0|                break;
 2003|    130|            cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns);
 2004|    130|            break;
 2005|    130|        case OSSL_FUNC_CIPHER_SET_CTX_PARAMS:
  ------------------
  |  |  388|    130|# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS            11
  ------------------
  |  Branch (2005:9): [True: 130, False: 1.81k]
  ------------------
 2006|    130|            if (cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (2006:17): [True: 0, False: 130]
  ------------------
 2007|      0|                break;
 2008|    130|            cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns);
 2009|    130|            break;
 2010|    130|        case OSSL_FUNC_CIPHER_GETTABLE_PARAMS:
  ------------------
  |  |  389|    130|# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS           12
  ------------------
  |  Branch (2010:9): [True: 130, False: 1.81k]
  ------------------
 2011|    130|            if (cipher->gettable_params != NULL)
  ------------------
  |  Branch (2011:17): [True: 0, False: 130]
  ------------------
 2012|      0|                break;
 2013|    130|            cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns);
 2014|    130|            break;
 2015|    130|        case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  390|    130|# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (2015:9): [True: 130, False: 1.81k]
  ------------------
 2016|    130|            if (cipher->gettable_ctx_params != NULL)
  ------------------
  |  Branch (2016:17): [True: 0, False: 130]
  ------------------
 2017|      0|                break;
 2018|    130|            cipher->gettable_ctx_params =
 2019|    130|                OSSL_FUNC_cipher_gettable_ctx_params(fns);
 2020|    130|            break;
 2021|    130|        case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  391|    130|# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS       14
  ------------------
  |  Branch (2021:9): [True: 130, False: 1.81k]
  ------------------
 2022|    130|            if (cipher->settable_ctx_params != NULL)
  ------------------
  |  Branch (2022:17): [True: 0, False: 130]
  ------------------
 2023|      0|                break;
 2024|    130|            cipher->settable_ctx_params =
 2025|    130|                OSSL_FUNC_cipher_settable_ctx_params(fns);
 2026|    130|            break;
 2027|  1.94k|        }
 2028|  1.94k|    }
 2029|    130|    fnciphcnt += encinit + decinit;
 2030|    130|    if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
  ------------------
  |  Branch (2030:10): [True: 130, False: 0]
  |  Branch (2030:28): [True: 130, False: 0]
  |  Branch (2030:46): [True: 0, False: 130]
  ------------------
 2031|    130|            || (fnciphcnt == 0 && cipher->ccipher == NULL && fnpipecnt == 0)
  ------------------
  |  Branch (2031:17): [True: 0, False: 130]
  |  Branch (2031:35): [True: 0, False: 0]
  |  Branch (2031:62): [True: 0, False: 0]
  ------------------
 2032|    130|            || (fnpipecnt != 0 && (fnpipecnt < 3 || cipher->p_cupdate == NULL
  ------------------
  |  Branch (2032:17): [True: 0, False: 130]
  |  Branch (2032:36): [True: 0, False: 0]
  |  Branch (2032:53): [True: 0, False: 0]
  ------------------
 2033|      0|                                   || cipher->p_cfinal == NULL))
  ------------------
  |  Branch (2033:39): [True: 0, False: 0]
  ------------------
 2034|    130|            || fnctxcnt != 2) {
  ------------------
  |  Branch (2034:16): [True: 0, False: 130]
  ------------------
 2035|       |        /*
 2036|       |         * In order to be a consistent set of functions we must have at least
 2037|       |         * a complete set of "encrypt" functions, or a complete set of "decrypt"
 2038|       |         * functions, or a single "cipher" function. In all cases we need both
 2039|       |         * the "newctx" and "freectx" functions.
 2040|       |         */
 2041|      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)
  |  |  ------------------
  ------------------
 2042|      0|        goto err;
 2043|      0|    }
 2044|    130|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (2044:9): [True: 130, False: 0]
  |  Branch (2044:25): [True: 0, False: 130]
  ------------------
 2045|      0|        goto err;
 2046|       |
 2047|    130|    cipher->prov = prov;
 2048|       |
 2049|    130|    if (!evp_cipher_cache_constants(cipher)) {
  ------------------
  |  Branch (2049:9): [True: 0, False: 130]
  ------------------
 2050|      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)
  |  |  ------------------
  ------------------
 2051|      0|        goto err;
 2052|      0|    }
 2053|       |
 2054|    130|    return cipher;
 2055|       |
 2056|      0|err:
 2057|      0|    EVP_CIPHER_free(cipher);
 2058|      0|    return NULL;
 2059|    130|}
evp_enc.c:set_legacy_nid:
 1860|    243|{
 1861|    243|    int nid;
 1862|    243|    int *legacy_nid = vlegacy_nid;
 1863|       |    /*
 1864|       |     * We use lowest level function to get the associated method, because
 1865|       |     * higher level functions such as EVP_get_cipherbyname() have changed
 1866|       |     * to look at providers too.
 1867|       |     */
 1868|    243|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|    243|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
 1869|       |
 1870|    243|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (1870:9): [True: 0, False: 243]
  ------------------
 1871|      0|        return;
 1872|    243|    if (legacy_method == NULL)
  ------------------
  |  Branch (1872:9): [True: 109, False: 134]
  ------------------
 1873|    109|        return;
 1874|    134|    nid = EVP_CIPHER_get_nid(legacy_method);
 1875|    134|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|    268|#define NID_undef                       0
  ------------------
  |  Branch (1875:9): [True: 26, False: 108]
  |  Branch (1875:37): [True: 0, False: 26]
  ------------------
 1876|      0|        *legacy_nid = -1;
 1877|      0|        return;
 1878|      0|    }
 1879|    134|    *legacy_nid = nid;
 1880|    134|}
evp_enc.c:evp_cipher_up_ref:
 2062|    138|{
 2063|    138|    return EVP_CIPHER_up_ref(cipher);
 2064|    138|}
evp_enc.c:evp_cipher_free:
 2067|    262|{
 2068|    262|    EVP_CIPHER_free(cipher);
 2069|    262|}

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

evp_generic_fetch:
  397|  1.68k|{
  398|  1.68k|    struct evp_method_data_st methdata;
  399|  1.68k|    void *method;
  400|       |
  401|  1.68k|    methdata.libctx = libctx;
  402|  1.68k|    methdata.tmp_store = NULL;
  403|  1.68k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  404|  1.68k|                                     name, properties,
  405|  1.68k|                                     new_method, up_ref_method, free_method);
  406|  1.68k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  407|  1.68k|    return method;
  408|  1.68k|}
evp_generic_fetch_from_prov:
  423|    386|{
  424|    386|    struct evp_method_data_st methdata;
  425|    386|    void *method;
  426|       |
  427|    386|    methdata.libctx = ossl_provider_libctx(prov);
  428|    386|    methdata.tmp_store = NULL;
  429|    386|    method = inner_evp_generic_fetch(&methdata, prov, operation_id,
  430|    386|                                     name, properties,
  431|    386|                                     new_method, up_ref_method, free_method);
  432|    386|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  433|    386|    return method;
  434|    386|}
evp_is_a:
  658|    240|{
  659|       |    /*
  660|       |     * For a |prov| that is NULL, the library context will be NULL
  661|       |     */
  662|    240|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  663|    240|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  664|       |
  665|    240|    if (prov == NULL)
  ------------------
  |  Branch (665:9): [True: 0, False: 240]
  ------------------
  666|      0|        number = ossl_namemap_name2num(namemap, legacy_name);
  667|    240|    return ossl_namemap_name2num(namemap, name) == number;
  668|    240|}
evp_names_do_all:
  673|    646|{
  674|    646|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  675|    646|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  676|       |
  677|    646|    return ossl_namemap_doall_names(namemap, number, fn, data);
  678|    646|}
evp_fetch.c:inner_evp_generic_fetch:
  259|  2.07k|{
  260|  2.07k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  261|  2.07k|    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|  2.07k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (271:31): [True: 284, False: 1.79k]
  ------------------
  272|  2.07k|#endif  /* FIPS_MODULE */
  273|  2.07k|    uint32_t meth_id = 0;
  274|  2.07k|    void *method = NULL;
  275|  2.07k|    int unsupported, name_id;
  276|       |
  277|  2.07k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.07k]
  |  Branch (277:26): [True: 0, False: 2.07k]
  ------------------
  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|  2.07k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  2.07k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.07k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (286:9): [True: 0, False: 2.07k]
  ------------------
  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|  2.07k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (292:15): [True: 2.07k, False: 0]
  ------------------
  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|  2.07k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (302:9): [True: 2.06k, False: 6]
  |  Branch (302:25): [True: 0, False: 2.06k]
  ------------------
  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|  2.07k|    unsupported = name_id == 0;
  312|       |
  313|  2.07k|    if (meth_id == 0
  ------------------
  |  Branch (313:9): [True: 6, False: 2.06k]
  ------------------
  314|  2.07k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (314:12): [True: 14, False: 2.05k]
  ------------------
  315|     20|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  316|     20|            get_tmp_evp_method_store,
  317|     20|            reserve_evp_method_store,
  318|     20|            unreserve_evp_method_store,
  319|     20|            get_evp_method_from_store,
  320|     20|            put_evp_method_in_store,
  321|     20|            construct_evp_method,
  322|     20|            destruct_evp_method
  323|     20|        };
  324|       |
  325|     20|        methdata->operation_id = operation_id;
  326|     20|        methdata->name_id = name_id;
  327|     20|        methdata->names = name;
  328|     20|        methdata->propquery = propq;
  329|     20|        methdata->method_from_algorithm = new_method;
  330|     20|        methdata->refcnt_up_method = up_ref_method;
  331|     20|        methdata->destruct_method = free_method;
  332|     20|        methdata->flag_construct_error_occurred = 0;
  333|     20|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (333:13): [True: 18, False: 2]
  ------------------
  334|     20|                                            &prov, 0 /* !force_cache */,
  335|     20|                                            &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|     18|            if (name_id == 0)
  ------------------
  |  Branch (348:17): [True: 4, False: 14]
  ------------------
  349|      4|                name_id = ossl_namemap_name2num(namemap, name);
  350|     18|            if (name_id == 0) {
  ------------------
  |  Branch (350:17): [True: 0, False: 18]
  ------------------
  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|     18|            } else {
  356|     18|                meth_id = evp_method_id(name_id, operation_id);
  357|     18|                if (meth_id != 0)
  ------------------
  |  Branch (357:21): [True: 18, False: 0]
  ------------------
  358|     18|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  359|     18|                                                method, up_ref_method, free_method);
  360|     18|            }
  361|     18|        }
  362|       |
  363|       |        /*
  364|       |         * If we never were in the constructor, the algorithm to be fetched
  365|       |         * is unsupported.
  366|       |         */
  367|     20|        unsupported = !methdata->flag_construct_error_occurred;
  368|     20|    }
  369|       |
  370|  2.07k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (370:10): [True: 2.07k, False: 2]
  |  Branch (370:26): [True: 2, False: 0]
  |  Branch (370:43): [True: 2, False: 2.07k]
  ------------------
  371|      2|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  363|      2|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      2|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      2|# 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: 2, False: 0]
  ------------------
  372|       |
  373|      2|        if (name == NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 2]
  ------------------
  374|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  375|      2|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  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_EVP, code,
  ------------------
  |  |   76|      2|# define ERR_LIB_EVP             6
  ------------------
  376|      2|                       "%s, Algorithm (%s : %d), Properties (%s)",
  377|      2|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  378|      2|                       name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (378:24): [True: 0, False: 2]
  ------------------
  379|      2|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (379:24): [True: 2, False: 0]
  ------------------
  380|  2.07k|    } else {
  381|  2.07k|        OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n",
  ------------------
  |  |  297|  2.07k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|  2.07k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  382|  2.07k|                    ossl_lib_ctx_get_descriptor(methdata->libctx),
  383|  2.07k|                    name == NULL ? "<null>" : name, name_id,
  384|  2.07k|                    properties == NULL ? "<null>" : properties);
  385|  2.07k|    }
  386|       |
  387|  2.07k|    return method;
  388|  2.07k|}
evp_fetch.c:evp_method_id:
  117|  2.36k|{
  118|  2.36k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  4.73k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.36k, False: 0]
  |  |  |  Branch (52:43): [True: 2.36k, False: 0]
  |  |  ------------------
  |  |   53|  4.73k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (118:9): [True: 0, False: 2.36k]
  ------------------
  119|  2.36k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  4.73k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.36k, False: 0]
  |  |  |  Branch (52:43): [True: 2.36k, False: 0]
  |  |  ------------------
  |  |   53|  2.36k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (119:12): [True: 0, False: 2.36k]
  ------------------
  120|  2.36k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  121|      0|        return 0;
  122|  2.36k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  114|  2.36k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  113|  2.36k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  123|  2.36k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  111|  2.36k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  124|  2.36k|}
evp_fetch.c:reserve_evp_method_store:
   73|     20|{
   74|     20|    struct evp_method_data_st *methdata = data;
   75|       |
   76|     20|    if (store == NULL
  ------------------
  |  Branch (76:9): [True: 20, False: 0]
  ------------------
   77|     20|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (77:12): [True: 0, False: 20]
  ------------------
   78|      0|        return 0;
   79|       |
   80|     20|    return ossl_method_lock_store(store);
   81|     20|}
evp_fetch.c:unreserve_evp_method_store:
   84|     20|{
   85|     20|    struct evp_method_data_st *methdata = data;
   86|       |
   87|     20|    if (store == NULL
  ------------------
  |  Branch (87:9): [True: 20, False: 0]
  ------------------
   88|     20|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (88:12): [True: 0, False: 20]
  ------------------
   89|      0|        return 0;
   90|       |
   91|     20|    return ossl_method_unlock_store(store);
   92|     20|}
evp_fetch.c:get_evp_method_from_store:
  128|     20|{
  129|     20|    struct evp_method_data_st *methdata = data;
  130|     20|    void *method = NULL;
  131|     20|    int name_id;
  132|     20|    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|     20|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (139:9): [True: 6, False: 14]
  |  Branch (139:47): [True: 6, False: 0]
  ------------------
  140|      6|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  141|      6|        const char *names = methdata->names;
  142|      6|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|      6|#define NAME_SEPARATOR ':'
  ------------------
  143|      6|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (143:21): [True: 6, False: 0]
  ------------------
  144|       |
  145|      6|        if (namemap == 0)
  ------------------
  |  Branch (145:13): [True: 0, False: 6]
  ------------------
  146|      0|            return NULL;
  147|      6|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  148|      6|    }
  149|       |
  150|     20|    if (name_id == 0
  ------------------
  |  Branch (150:9): [True: 2, False: 18]
  ------------------
  151|     20|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (151:12): [True: 0, False: 18]
  ------------------
  152|      2|        return NULL;
  153|       |
  154|     18|    if (store == NULL
  ------------------
  |  Branch (154:9): [True: 18, False: 0]
  ------------------
  155|     18|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (155:12): [True: 0, False: 18]
  ------------------
  156|      0|        return NULL;
  157|       |
  158|     18|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (158:9): [True: 0, False: 18]
  ------------------
  159|     18|                                 &method))
  160|      0|        return NULL;
  161|     18|    return method;
  162|     18|}
evp_fetch.c:put_evp_method_in_store:
  168|    261|{
  169|    261|    struct evp_method_data_st *methdata = data;
  170|    261|    OSSL_NAMEMAP *namemap;
  171|    261|    int name_id;
  172|    261|    uint32_t meth_id;
  173|    261|    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|    261|    if (names != NULL) {
  ------------------
  |  Branch (181:9): [True: 261, False: 0]
  ------------------
  182|    261|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|    261|#define NAME_SEPARATOR ':'
  ------------------
  183|       |
  184|    261|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (184:14): [True: 79, False: 182]
  ------------------
  185|    261|    }
  186|       |
  187|    261|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (187:9): [True: 0, False: 261]
  ------------------
  188|    261|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (188:12): [True: 0, False: 261]
  ------------------
  189|    261|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (189:12): [True: 0, False: 261]
  ------------------
  190|      0|        return 0;
  191|       |
  192|    261|    OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store);
  ------------------
  |  |  291|    261|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|    261|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  193|    261|    if (store == NULL
  ------------------
  |  Branch (193:9): [True: 261, False: 0]
  ------------------
  194|    261|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (194:12): [True: 0, False: 261]
  ------------------
  195|      0|        return 0;
  196|       |
  197|    261|    OSSL_TRACE5(QUERY,
  ------------------
  |  |  299|    261|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5))
  |  |  ------------------
  |  |  |  |  283|    261|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  198|    261|                "put_evp_method_in_store: "
  199|    261|                "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n",
  200|    261|                store, names, methdata->operation_id, meth_id, propdef ? propdef : "<null>");
  201|    261|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  202|    261|                                 methdata->refcnt_up_method,
  203|    261|                                 methdata->destruct_method);
  204|    261|}
evp_fetch.c:construct_evp_method:
  212|    261|{
  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|    261|    struct evp_method_data_st *methdata = data;
  221|    261|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  222|    261|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  223|    261|    const char *names = algodef->algorithm_names;
  224|    261|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|    261|#define NAME_SEPARATOR ':'
  ------------------
  225|    261|    void *method;
  226|       |
  227|    261|    if (name_id == 0)
  ------------------
  |  Branch (227:9): [True: 0, False: 261]
  ------------------
  228|      0|        return NULL;
  229|       |
  230|    261|    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|    261|    if (method == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 261]
  ------------------
  238|      0|        methdata->flag_construct_error_occurred = 1;
  239|       |
  240|    261|    return method;
  241|    261|}
evp_fetch.c:destruct_evp_method:
  244|    261|{
  245|    261|    struct evp_method_data_st *methdata = data;
  246|       |
  247|    261|    methdata->destruct_method(method);
  248|    261|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   61|  2.07k|{
   62|  2.07k|    OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store);
  ------------------
  |  |  291|  2.07k|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|  2.07k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   63|  2.07k|    if (store != NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 2.07k]
  ------------------
   64|      0|        ossl_method_store_free(store);
   65|  2.07k|}
evp_fetch.c:get_evp_method_store:
   68|  2.39k|{
   69|  2.39k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   98|  2.39k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   70|  2.39k|}

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_cache_constants:
  321|    130|{
  322|    130|    int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
  323|    130|    int encrypt_then_mac = 0;
  324|    130|    size_t ivlen = 0;
  325|    130|    size_t blksz = 0;
  326|    130|    size_t keylen = 0;
  327|    130|    unsigned int mode = 0;
  328|    130|    OSSL_PARAM params[11];
  329|       |
  330|    130|    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  183|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  331|    130|    params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
  ------------------
  |  |  193|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  332|    130|    params[2] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &keylen);
  ------------------
  |  |  194|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  333|    130|    params[3] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_MODE, &mode);
  ------------------
  |  |  195|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
  334|    130|    params[4] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_AEAD, &aead);
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
  335|    130|    params[5] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CUSTOM_IV,
  ------------------
  |  |  186|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
  336|    130|                                         &custom_iv);
  337|    130|    params[6] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CTS, &cts);
  ------------------
  |  |  184|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
  338|    130|    params[7] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK,
  ------------------
  |  |  203|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
  339|    130|                                         &multiblock);
  340|    130|    params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
  ------------------
  |  |  191|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
  341|    130|                                         &randkey);
  342|    130|    params[9] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC,
  ------------------
  |  |  188|    130|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
  343|    130|                                         &encrypt_then_mac);
  344|    130|    params[10] = OSSL_PARAM_construct_end();
  345|    130|    ok = evp_do_ciph_getparams(cipher, params) > 0;
  346|    130|    if (ok) {
  ------------------
  |  Branch (346:9): [True: 130, False: 0]
  ------------------
  347|    130|        cipher->block_size = blksz;
  348|    130|        cipher->iv_len = ivlen;
  349|    130|        cipher->key_len = keylen;
  350|    130|        cipher->flags = mode;
  351|    130|        if (aead)
  ------------------
  |  Branch (351:13): [True: 28, False: 102]
  ------------------
  352|     28|            cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
  ------------------
  |  |  368|     28|# define         EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
  ------------------
  353|    130|        if (custom_iv)
  ------------------
  |  Branch (353:13): [True: 41, False: 89]
  ------------------
  354|     41|            cipher->flags |= EVP_CIPH_CUSTOM_IV;
  ------------------
  |  |  338|     41|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  355|    130|        if (cts)
  ------------------
  |  Branch (355:13): [True: 6, False: 124]
  ------------------
  356|      6|            cipher->flags |= EVP_CIPH_FLAG_CTS;
  ------------------
  |  |  366|      6|# define         EVP_CIPH_FLAG_CTS               0x4000
  ------------------
  357|    130|        if (multiblock)
  ------------------
  |  Branch (357:13): [True: 4, False: 126]
  ------------------
  358|      4|            cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
  ------------------
  |  |  369|      4|# define         EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
  ------------------
  359|    130|        if (cipher->ccipher != NULL)
  ------------------
  |  Branch (359:13): [True: 118, False: 12]
  ------------------
  360|    118|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
  ------------------
  |  |  367|    118|# define         EVP_CIPH_FLAG_CUSTOM_CIPHER     0x100000
  ------------------
  361|    130|        if (randkey)
  ------------------
  |  Branch (361:13): [True: 11, False: 119]
  ------------------
  362|     11|            cipher->flags |= EVP_CIPH_RAND_KEY;
  ------------------
  |  |  348|     11|# define         EVP_CIPH_RAND_KEY               0x200
  ------------------
  363|    130|        if (encrypt_then_mac)
  ------------------
  |  Branch (363:13): [True: 0, False: 130]
  ------------------
  364|      0|            cipher->flags |= EVP_CIPH_FLAG_ENC_THEN_MAC;
  ------------------
  |  |  379|      0|# define         EVP_CIPH_FLAG_ENC_THEN_MAC      0x10000000
  ------------------
  365|    130|        if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
  ------------------
  |  Branch (365:13): [True: 0, False: 130]
  ------------------
  366|    130|                                    OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
  ------------------
  |  |  181|    130|# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
  |  |  ------------------
  |  |  |  |  120|    130|# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params"
  |  |  ------------------
  ------------------
  367|      0|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
  ------------------
  |  |  373|      0|# define         EVP_CIPH_FLAG_CUSTOM_ASN1       0x1000000
  ------------------
  368|    130|    }
  369|    130|    return ok;
  370|    130|}
EVP_CIPHER_get_iv_length:
  491|      3|{
  492|      3|    return (cipher == NULL) ? 0 : cipher->iv_len;
  ------------------
  |  Branch (492:12): [True: 0, False: 3]
  ------------------
  493|      3|}
EVP_CIPHER_CTX_get_iv_length:
  496|    858|{
  497|    858|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 858]
  ------------------
  498|      0|        return 0;
  499|       |
  500|    858|    if (ctx->iv_len < 0) {
  ------------------
  |  Branch (500:9): [True: 3, False: 855]
  ------------------
  501|      3|        int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
  502|      3|        size_t v = len;
  503|      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 }
  ------------------
  504|       |
  505|      3|        if (ctx->cipher->get_ctx_params != NULL) {
  ------------------
  |  Branch (505:13): [True: 3, False: 0]
  ------------------
  506|      3|            params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
  ------------------
  |  |  193|      3|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  507|      3|                                                    &v);
  508|      3|            rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  509|      3|            if (rv > 0) {
  ------------------
  |  Branch (509:17): [True: 3, False: 0]
  ------------------
  510|      3|                if (OSSL_PARAM_modified(params)
  ------------------
  |  Branch (510:21): [True: 3, False: 0]
  ------------------
  511|      3|                        && !OSSL_PARAM_get_int(params, &len))
  ------------------
  |  Branch (511:28): [True: 0, False: 3]
  ------------------
  512|      0|                    return -1;
  513|      3|            } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  |  Branch (513:24): [True: 0, False: 0]
  ------------------
  514|      0|                return -1;
  515|      0|            }
  516|      3|        }
  517|       |        /* Code below to be removed when legacy support is dropped. */
  518|      0|        else if ((EVP_CIPHER_get_flags(ctx->cipher)
  ------------------
  |  Branch (518:18): [True: 0, False: 0]
  ------------------
  519|      0|                  & EVP_CIPH_CUSTOM_IV_LENGTH) != 0) {
  ------------------
  |  |  352|      0|# define         EVP_CIPH_CUSTOM_IV_LENGTH       0x800
  ------------------
  520|      0|            rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
  ------------------
  |  |  453|      0|# define         EVP_CTRL_GET_IVLEN                      0x25
  ------------------
  521|      0|                                     0, &len);
  522|      0|            if (rv <= 0)
  ------------------
  |  Branch (522:17): [True: 0, False: 0]
  ------------------
  523|      0|                return -1;
  524|      0|        }
  525|       |        /*-
  526|       |         * Casting away the const is annoying but required here.  We need to
  527|       |         * cache the result for performance reasons.
  528|       |         */
  529|      3|        ((EVP_CIPHER_CTX *)ctx)->iv_len = len;
  530|      3|    }
  531|    858|    return ctx->iv_len;
  532|    858|}
EVP_CIPHER_get_key_length:
  642|      3|{
  643|      3|    return cipher->key_len;
  644|      3|}
EVP_CIPHER_CTX_get_key_length:
  647|  1.74k|{
  648|  1.74k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (648:9): [True: 0, False: 1.74k]
  ------------------
  649|      0|        return 0;
  650|       |
  651|  1.74k|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (651:9): [True: 9, False: 1.74k]
  |  Branch (651:30): [True: 9, False: 0]
  ------------------
  652|      9|        int ok;
  653|      9|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      9|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      9|    { NULL, 0, NULL, 0, 0 }
  ------------------
  654|      9|        size_t len;
  655|       |
  656|      9|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  194|      9|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  657|      9|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  658|      9|        if (ok <= 0)
  ------------------
  |  Branch (658:13): [True: 0, False: 9]
  ------------------
  659|      0|            return EVP_CTRL_RET_UNSUPPORTED;
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  660|       |
  661|       |        /*-
  662|       |         * The if branch should never be taken since EVP_MAX_KEY_LENGTH is
  663|       |         * less than INT_MAX but best to be safe.
  664|       |         *
  665|       |         * Casting away the const is annoying but required here.  We need to
  666|       |         * cache the result for performance reasons.
  667|       |         */
  668|      9|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (668:13): [True: 0, False: 9]
  ------------------
  669|      0|            return -1;
  670|      9|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  671|      9|    }
  672|  1.74k|    return ctx->key_len;
  673|  1.74k|}
EVP_CIPHER_get_nid:
  676|    317|{
  677|    317|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (677:12): [True: 0, False: 317]
  ------------------
  678|    317|}
EVP_CIPHER_get0_provider:
  732|    130|{
  733|    130|    return cipher->prov;
  734|    130|}
EVP_MD_get_type:
  795|     82|{
  796|     82|    return md->type;
  797|     82|}
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_set_flags:
 1114|  1.20k|{
 1115|  1.20k|    ctx->flags |= flags;
 1116|  1.20k|}
EVP_MD_CTX_clear_flags:
 1119|  39.7k|{
 1120|  39.7k|    ctx->flags &= ~flags;
 1121|  39.7k|}
EVP_MD_CTX_test_flags:
 1124|  1.35k|{
 1125|  1.35k|    return (ctx->flags & flags);
 1126|  1.35k|}

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

EVP_PKEY_get0_type_name:
  246|    119|{
  247|    119|    const EVP_PKEY_ASN1_METHOD *ameth;
  248|    119|    const char *name = NULL;
  249|       |
  250|    119|    if (key->keymgmt != NULL)
  ------------------
  |  Branch (250:9): [True: 119, False: 0]
  ------------------
  251|    119|        return EVP_KEYMGMT_get0_name(key->keymgmt);
  252|       |
  253|       |    /* Otherwise fallback to legacy */
  254|      0|    ameth = EVP_PKEY_get0_asn1(key);
  255|      0|    if (ameth != NULL)
  ------------------
  |  Branch (255:9): [True: 0, False: 0]
  ------------------
  256|      0|        EVP_PKEY_asn1_get0_info(NULL, NULL,
  257|      0|                                NULL, NULL, &name, ameth);
  258|       |
  259|      0|    return name;
  260|    119|}

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

evp_do_ciph_getparams:
   38|    130|int name (const type *obj, OSSL_PARAM params[])                                \
   39|    130|{                                                                              \
   40|    260|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|    130|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   29|    130|        return 0;                                                              \
  |  |   30|    130|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   31|    130|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|    130|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   41|    260|    return obj->func(params);                                                  \
   42|    260|}
evp_do_ciph_ctx_getparams:
   45|     12|int name (const type *obj, void *algctx, OSSL_PARAM params[])                  \
   46|     12|{                                                                              \
   47|     24|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|     12|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 12]
  |  |  ------------------
  |  |   29|     12|        return 0;                                                              \
  |  |   30|     12|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 12]
  |  |  ------------------
  |  |   31|     12|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|     12|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 12]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   48|     24|    return obj->func(algctx, params);                                          \
   49|     24|}
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|    449|{
   63|    449|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 449]
  |  Branch (63:25): [True: 0, False: 449]
  |  Branch (63:44): [True: 0, False: 449]
  ------------------
   64|    449|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 449]
  ------------------
   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|    449|    pkey->keydata = keydata;
   69|    449|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|    449|    return 1;
   71|    449|}
evp_keymgmt_util_export:
   89|      4|{
   90|      4|    if (pk == NULL || export_cb == NULL)
  ------------------
  |  Branch (90:9): [True: 0, False: 4]
  |  Branch (90:23): [True: 0, False: 4]
  ------------------
   91|      0|        return 0;
   92|      4|    return evp_keymgmt_export(pk->keymgmt, pk->keydata, selection,
   93|      4|                              export_cb, export_cbarg);
   94|      4|}
evp_keymgmt_util_export_to_provider:
   98|    380|{
   99|    380|    struct evp_keymgmt_util_try_import_data_st import_data;
  100|    380|    OP_CACHE_ELEM *op;
  101|       |
  102|       |    /* Export to where? */
  103|    380|    if (keymgmt == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 380]
  ------------------
  104|      0|        return NULL;
  105|       |
  106|       |    /* If we have an unassigned key, give up */
  107|    380|    if (pk->keydata == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 380]
  ------------------
  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|    380|    if (pk->keymgmt == keymgmt
  ------------------
  |  Branch (117:9): [True: 380, False: 0]
  ------------------
  118|    380|        || (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|    380|        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|    474|{
  224|    474|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 474, False: 0]
  ------------------
  225|    474|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|    474|        pk->operation_cache = NULL;
  227|    474|    }
  228|       |
  229|    474|    return 1;
  230|    474|}
evp_keymgmt_util_cache_keyinfo:
  290|    449|{
  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|    449|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 449, False: 0]
  ------------------
  297|    449|        int bits = 0;
  298|    449|        int security_bits = 0;
  299|    449|        int security_category = -1;
  300|    449|        int size = 0;
  301|    449|        OSSL_PARAM params[5];
  302|       |
  303|    449|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  360|    449|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  304|    449|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  487|    449|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  305|    449|                                             &security_bits);
  306|    449|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_CATEGORY,
  ------------------
  |  |  488|    449|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|    449|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  307|    449|                                             &security_category);
  308|    449|        params[3] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  416|    449|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  309|    449|        params[4] = OSSL_PARAM_construct_end();
  310|    449|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (310:13): [True: 449, False: 0]
  ------------------
  311|    449|            pk->cache.size = size;
  312|    449|            pk->cache.bits = bits;
  313|    449|            pk->cache.security_bits = security_bits;
  314|    449|            pk->cache.security_category = security_category;
  315|    449|        }
  316|    449|    }
  317|    449|}
evp_keymgmt_util_fromdata:
  321|     30|{
  322|     30|    void *keydata = NULL;
  323|       |
  324|     30|    if ((keydata = evp_keymgmt_newdata(keymgmt)) == NULL
  ------------------
  |  Branch (324:9): [True: 0, False: 30]
  ------------------
  325|     30|        || !evp_keymgmt_import(keymgmt, keydata, selection, params)
  ------------------
  |  Branch (325:12): [True: 25, False: 5]
  ------------------
  326|     30|        || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) {
  ------------------
  |  Branch (326:12): [True: 0, False: 5]
  ------------------
  327|     25|        evp_keymgmt_freedata(keymgmt, keydata);
  328|     25|        keydata = NULL;
  329|     25|    }
  330|     30|    return keydata;
  331|     30|}
evp_keymgmt_util_has:
  334|     44|{
  335|       |    /* Check if key is even assigned */
  336|     44|    if (pk->keymgmt == NULL)
  ------------------
  |  Branch (336:9): [True: 0, False: 44]
  ------------------
  337|      0|        return 0;
  338|       |
  339|     44|    return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection);
  340|     44|}
evp_keymgmt_util_match:
  356|     22|{
  357|     22|    EVP_KEYMGMT *keymgmt1 = NULL, *keymgmt2 = NULL;
  358|     22|    void *keydata1 = NULL, *keydata2 = NULL;
  359|       |
  360|     22|    if (pk1 == NULL || pk2 == NULL) {
  ------------------
  |  Branch (360:9): [True: 0, False: 22]
  |  Branch (360:24): [True: 0, False: 22]
  ------------------
  361|      0|        if (pk1 == NULL && pk2 == NULL)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  |  Branch (361:28): [True: 0, False: 0]
  ------------------
  362|      0|            return 1;
  363|      0|        return 0;
  364|      0|    }
  365|       |
  366|     22|    keymgmt1 = pk1->keymgmt;
  367|     22|    keydata1 = pk1->keydata;
  368|     22|    keymgmt2 = pk2->keymgmt;
  369|     22|    keydata2 = pk2->keydata;
  370|       |
  371|     22|    if (keymgmt1 != keymgmt2) {
  ------------------
  |  Branch (371:9): [True: 2, False: 20]
  ------------------
  372|       |        /*
  373|       |         * The condition for a successful cross export is that the
  374|       |         * keydata to be exported is NULL (typed, but otherwise empty
  375|       |         * EVP_PKEY), or that it was possible to export it with
  376|       |         * evp_keymgmt_util_export_to_provider().
  377|       |         *
  378|       |         * We use |ok| to determine if it's ok to cross export one way,
  379|       |         * but also to determine if we should attempt a cross export
  380|       |         * the other way.  There's no point doing it both ways.
  381|       |         */
  382|      2|        int ok = 0;
  383|       |
  384|       |        /* Complex case, where the keymgmt differ */
  385|      2|        if (keymgmt1 != NULL
  ------------------
  |  Branch (385:13): [True: 2, False: 0]
  ------------------
  386|      2|            && keymgmt2 != NULL
  ------------------
  |  Branch (386:16): [True: 2, False: 0]
  ------------------
  387|      2|            && !match_type(keymgmt1, keymgmt2)) {
  ------------------
  |  Branch (387:16): [True: 2, False: 0]
  ------------------
  388|      2|            ERR_raise(ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  389|      2|            return -1;           /* Not the same type */
  390|      2|        }
  391|       |
  392|       |        /*
  393|       |         * The key types are determined to match, so we try cross export,
  394|       |         * but only to keymgmt's that supply a matching function.
  395|       |         */
  396|      0|        if (keymgmt2 != NULL
  ------------------
  |  Branch (396:13): [True: 0, False: 0]
  ------------------
  397|      0|            && keymgmt2->match != NULL) {
  ------------------
  |  Branch (397:16): [True: 0, False: 0]
  ------------------
  398|      0|            void *tmp_keydata = NULL;
  399|       |
  400|      0|            ok = 1;
  401|      0|            if (keydata1 != NULL) {
  ------------------
  |  Branch (401:17): [True: 0, False: 0]
  ------------------
  402|      0|                tmp_keydata =
  403|      0|                    evp_keymgmt_util_export_to_provider(pk1, keymgmt2,
  404|      0|                                                        selection);
  405|      0|                ok = (tmp_keydata != NULL);
  406|      0|            }
  407|      0|            if (ok) {
  ------------------
  |  Branch (407:17): [True: 0, False: 0]
  ------------------
  408|      0|                keymgmt1 = keymgmt2;
  409|      0|                keydata1 = tmp_keydata;
  410|      0|            }
  411|      0|        }
  412|       |        /*
  413|       |         * If we've successfully cross exported one way, there's no point
  414|       |         * doing it the other way, hence the |!ok| check.
  415|       |         */
  416|      0|        if (!ok
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            && keymgmt1 != NULL
  ------------------
  |  Branch (417:16): [True: 0, False: 0]
  ------------------
  418|      0|            && keymgmt1->match != NULL) {
  ------------------
  |  Branch (418:16): [True: 0, False: 0]
  ------------------
  419|      0|            void *tmp_keydata = NULL;
  420|       |
  421|      0|            ok = 1;
  422|      0|            if (keydata2 != NULL) {
  ------------------
  |  Branch (422:17): [True: 0, False: 0]
  ------------------
  423|      0|                tmp_keydata =
  424|      0|                    evp_keymgmt_util_export_to_provider(pk2, keymgmt1,
  425|      0|                                                        selection);
  426|      0|                ok = (tmp_keydata != NULL);
  427|      0|            }
  428|      0|            if (ok) {
  ------------------
  |  Branch (428:17): [True: 0, False: 0]
  ------------------
  429|      0|                keymgmt2 = keymgmt1;
  430|      0|                keydata2 = tmp_keydata;
  431|      0|            }
  432|      0|        }
  433|      0|    }
  434|       |
  435|       |    /* If we still don't have matching keymgmt implementations, we give up */
  436|     20|    if (keymgmt1 != keymgmt2)
  ------------------
  |  Branch (436:9): [True: 0, False: 20]
  ------------------
  437|      0|        return -2;
  438|       |
  439|       |    /* If both keydata are NULL, then they're the same key */
  440|     20|    if (keydata1 == NULL && keydata2 == NULL)
  ------------------
  |  Branch (440:9): [True: 0, False: 20]
  |  Branch (440:29): [True: 0, False: 0]
  ------------------
  441|      0|        return 1;
  442|       |    /* If only one of the keydata is NULL, then they're different keys */
  443|     20|    if (keydata1 == NULL || keydata2 == NULL)
  ------------------
  |  Branch (443:9): [True: 0, False: 20]
  |  Branch (443:29): [True: 0, False: 20]
  ------------------
  444|      0|        return 0;
  445|       |    /* If both keydata are non-NULL, we let the backend decide */
  446|     20|    return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection);
  447|     20|}
evp_keymgmt_util_gen:
  519|    444|{
  520|    444|    void *keydata = NULL;
  521|       |
  522|    444|    if ((keydata = evp_keymgmt_gen(keymgmt, genctx, cb, cbarg)) == NULL
  ------------------
  |  Branch (522:9): [True: 0, False: 444]
  ------------------
  523|    444|        || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) {
  ------------------
  |  Branch (523:12): [True: 0, False: 444]
  ------------------
  524|      0|        evp_keymgmt_freedata(keymgmt, keydata);
  525|      0|        keydata = NULL;
  526|      0|    }
  527|       |
  528|    444|    return keydata;
  529|    444|}
evp_keymgmt_util_get_deflt_digest_name:
  540|    142|{
  541|    142|    OSSL_PARAM params[3];
  542|    142|    char mddefault[100] = "";
  543|    142|    char mdmandatory[100] = "";
  544|    142|    char *result = NULL;
  545|    142|    int rv = -2;
  546|       |
  547|    142|    params[0] =
  548|    142|        OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST,
  ------------------
  |  |  362|    142|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  549|    142|                                         mddefault, sizeof(mddefault));
  550|    142|    params[1] =
  551|    142|        OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST,
  ------------------
  |  |  414|    142|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  552|    142|                                         mdmandatory,
  553|    142|                                         sizeof(mdmandatory));
  554|    142|    params[2] = OSSL_PARAM_construct_end();
  555|       |
  556|    142|    if (!evp_keymgmt_get_params(keymgmt, keydata, params))
  ------------------
  |  Branch (556:9): [True: 0, False: 142]
  ------------------
  557|      0|        return 0;
  558|       |
  559|    142|    if (OSSL_PARAM_modified(params + 1)) {
  ------------------
  |  Branch (559:9): [True: 142, False: 0]
  ------------------
  560|    142|        if (params[1].return_size <= 1) /* Only a NUL byte */
  ------------------
  |  Branch (560:13): [True: 142, False: 0]
  ------------------
  561|    142|            result = SN_undef;
  ------------------
  |  |   16|    142|#define SN_undef                        "UNDEF"
  ------------------
  562|      0|        else
  563|      0|            result = mdmandatory;
  564|    142|        rv = 2;
  565|    142|    } else if (OSSL_PARAM_modified(params)) {
  ------------------
  |  Branch (565:16): [True: 0, False: 0]
  ------------------
  566|      0|        if (params[0].return_size <= 1) /* Only a NUL byte */
  ------------------
  |  Branch (566:13): [True: 0, False: 0]
  ------------------
  567|      0|            result = SN_undef;
  ------------------
  |  |   16|      0|#define SN_undef                        "UNDEF"
  ------------------
  568|      0|        else
  569|      0|            result = mddefault;
  570|      0|        rv = 1;
  571|      0|    }
  572|    142|    if (rv > 0)
  ------------------
  |  Branch (572:9): [True: 142, False: 0]
  ------------------
  573|    142|        OPENSSL_strlcpy(mdname, result, mdname_sz);
  574|    142|    return rv;
  575|    142|}
evp_keymgmt_util_query_operation_name:
  584|    142|{
  585|    142|    const char *name = NULL;
  586|       |
  587|    142|    if (keymgmt != NULL) {
  ------------------
  |  Branch (587:9): [True: 142, False: 0]
  ------------------
  588|    142|        if (keymgmt->query_operation_name != NULL)
  ------------------
  |  Branch (588:13): [True: 0, False: 142]
  ------------------
  589|      0|            name = keymgmt->query_operation_name(op_id);
  590|    142|        if (name == NULL)
  ------------------
  |  Branch (590:13): [True: 142, False: 0]
  ------------------
  591|    142|            name = EVP_KEYMGMT_get0_name(keymgmt);
  592|    142|    }
  593|    142|    return name;
  594|    142|}
keymgmt_lib.c:match_type:
   23|      2|{
   24|      2|    const char *name2 = EVP_KEYMGMT_get0_name(keymgmt2);
   25|       |
   26|      2|    return EVP_KEYMGMT_is_a(keymgmt1, name2);
   27|      2|}

evp_keymgmt_fetch_from_prov:
  277|    380|{
  278|    380|    return evp_generic_fetch_from_prov(prov, OSSL_OP_KEYMGMT,
  ------------------
  |  |  315|    380|# define OSSL_OP_KEYMGMT                            10
  ------------------
  279|    380|                                       name, properties,
  280|    380|                                       keymgmt_from_algorithm,
  281|    380|                                       evp_keymgmt_up_ref,
  282|    380|                                       evp_keymgmt_free);
  283|    380|}
EVP_KEYMGMT_fetch:
  287|    476|{
  288|    476|    return evp_generic_fetch(ctx, OSSL_OP_KEYMGMT, algorithm, properties,
  ------------------
  |  |  315|    476|# define OSSL_OP_KEYMGMT                            10
  ------------------
  289|    476|                             keymgmt_from_algorithm,
  290|    476|                             evp_keymgmt_up_ref,
  291|    476|                             evp_keymgmt_free);
  292|    476|}
EVP_KEYMGMT_up_ref:
  295|  1.73k|{
  296|  1.73k|    int ref = 0;
  297|       |
  298|  1.73k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  299|  1.73k|    return 1;
  300|  1.73k|}
EVP_KEYMGMT_free:
  303|  2.29k|{
  304|  2.29k|    int ref = 0;
  305|       |
  306|  2.29k|    if (keymgmt == NULL)
  ------------------
  |  Branch (306:9): [True: 522, False: 1.77k]
  ------------------
  307|    522|        return;
  308|       |
  309|  1.77k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  310|  1.77k|    if (ref > 0)
  ------------------
  |  Branch (310:9): [True: 1.73k, False: 40]
  ------------------
  311|  1.73k|        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|    474|{
  320|    474|    return keymgmt->prov;
  321|    474|}
evp_keymgmt_get_legacy_alg:
  329|    858|{
  330|    858|    return keymgmt->legacy_alg;
  331|    858|}
EVP_KEYMGMT_get0_name:
  339|  1.26k|{
  340|  1.26k|    return keymgmt->type_name;
  341|  1.26k|}
EVP_KEYMGMT_is_a:
  344|      2|{
  345|      2|    return keymgmt != NULL
  ------------------
  |  Branch (345:12): [True: 2, False: 0]
  ------------------
  346|      2|           && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (346:15): [True: 0, False: 2]
  ------------------
  347|      2|}
EVP_KEYMGMT_names_do_all:
  363|    489|{
  364|    489|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (364:9): [True: 489, False: 0]
  ------------------
  365|    489|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  366|       |
  367|      0|    return 1;
  368|    489|}
evp_keymgmt_newdata:
  374|     30|{
  375|     30|    void *provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(keymgmt));
  376|       |
  377|       |    /*
  378|       |     * 'new' is currently mandatory on its own, but when new
  379|       |     * constructors appear, it won't be quite as mandatory,
  380|       |     * so we have a check for future cases.
  381|       |     */
  382|     30|    if (keymgmt->new == NULL)
  ------------------
  |  Branch (382:9): [True: 0, False: 30]
  ------------------
  383|      0|        return NULL;
  384|     30|    return keymgmt->new(provctx);
  385|     30|}
evp_keymgmt_freedata:
  388|    474|{
  389|       |    /* This is mandatory, no need to check for its presence */
  390|    474|    keymgmt->free(keydata);
  391|    474|}
evp_keymgmt_gen_init:
  395|    444|{
  396|    444|    void *provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(keymgmt));
  397|       |
  398|    444|    if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (398:9): [True: 0, False: 444]
  ------------------
  399|      0|        return NULL;
  400|    444|    return keymgmt->gen_init(provctx, selection, params);
  401|    444|}
evp_keymgmt_gen:
  453|    444|{
  454|    444|    void *ret;
  455|    444|    const char *desc = keymgmt->description != NULL ? keymgmt->description : "";
  ------------------
  |  Branch (455:24): [True: 444, False: 0]
  ------------------
  456|       |
  457|    444|    if (keymgmt->gen == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 444]
  ------------------
  458|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_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_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |  110|      0|# define EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED             236
  ------------------
  459|      0|                       "%s key generation:%s", keymgmt->type_name, desc);
  460|      0|        return NULL;
  461|      0|    }
  462|       |
  463|    444|    ret = keymgmt->gen(genctx, cb, cbarg);
  464|    444|    if (ret == NULL)
  ------------------
  |  Branch (464:9): [True: 0, False: 444]
  ------------------
  465|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_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_KEYMGMT_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |  109|      0|# define EVP_R_PROVIDER_KEYMGMT_FAILURE                   233
  ------------------
  466|      0|                       "%s key generation:%s", keymgmt->type_name, desc);
  467|    444|    return ret;
  468|    444|}
evp_keymgmt_gen_cleanup:
  471|    444|{
  472|    444|    if (keymgmt->gen_cleanup != NULL)
  ------------------
  |  Branch (472:9): [True: 444, False: 0]
  ------------------
  473|    444|        keymgmt->gen_cleanup(genctx);
  474|    444|}
evp_keymgmt_get_params:
  491|    591|{
  492|    591|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 591]
  ------------------
  493|      0|        return 1;
  494|    591|    return keymgmt->get_params(keydata, params);
  495|    591|}
evp_keymgmt_has:
  524|     44|{
  525|       |    /* This is mandatory, no need to check for its presence */
  526|     44|    return keymgmt->has(keydata, selection);
  527|     44|}
evp_keymgmt_match:
  541|     20|{
  542|       |    /* We assume no match if the implementation doesn't have a function */
  543|     20|    if (keymgmt->match == NULL)
  ------------------
  |  Branch (543:9): [True: 0, False: 20]
  ------------------
  544|      0|        return 0;
  545|     20|    return keymgmt->match(keydata1, keydata2, selection);
  546|     20|}
evp_keymgmt_import:
  550|     30|{
  551|     30|    if (keymgmt->import == NULL)
  ------------------
  |  Branch (551:9): [True: 0, False: 30]
  ------------------
  552|      0|        return 0;
  553|     30|    return keymgmt->import(keydata, selection, params);
  554|     30|}
evp_keymgmt_export:
  570|      4|{
  571|      4|    if (keymgmt->export == NULL)
  ------------------
  |  Branch (571:9): [True: 0, False: 4]
  ------------------
  572|      0|        return 0;
  573|      4|    return keymgmt->export(keydata, selection, param_cb, cbarg);
  574|      4|}
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|    900|{
   27|    900|    return EVP_KEYMGMT_up_ref(data);
   28|    900|}
keymgmt_meth.c:evp_keymgmt_free:
   21|     86|{
   22|     86|    EVP_KEYMGMT_free(data);
   23|     86|}

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|      1|{
  104|      1|    return &sha1_md;
  105|      1|}
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_DigestSignInit_ex:
  375|     71|{
  376|     71|    return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 0,
  377|     71|                          params);
  378|     71|}
EVP_DigestVerifyInit_ex:
  391|     71|{
  392|     71|    return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 1,
  393|     71|                          params);
  394|     71|}
EVP_DigestSign:
  613|    142|{
  614|    142|    EVP_PKEY_CTX *pctx = ctx->pctx;
  615|    142|    int ret;
  616|       |
  617|    142|    if (pctx == NULL) {
  ------------------
  |  Branch (617:9): [True: 0, False: 142]
  ------------------
  618|      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)
  |  |  ------------------
  ------------------
  619|      0|        return 0;
  620|      0|    }
  621|       |
  622|    142|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|    142|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (622:9): [True: 0, False: 142]
  ------------------
  623|      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)
  |  |  ------------------
  ------------------
  624|      0|        return 0;
  625|      0|    }
  626|       |
  627|    142|    if (pctx->operation == EVP_PKEY_OP_SIGNCTX
  ------------------
  |  | 1751|    284|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (627:9): [True: 142, False: 0]
  ------------------
  628|    142|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (628:16): [True: 142, False: 0]
  ------------------
  629|    142|            && pctx->op.sig.signature != NULL) {
  ------------------
  |  Branch (629:16): [True: 142, False: 0]
  ------------------
  630|    142|        EVP_SIGNATURE *signature = pctx->op.sig.signature;
  631|       |
  632|    142|        if (signature->digest_sign != NULL) {
  ------------------
  |  Branch (632:13): [True: 142, False: 0]
  ------------------
  633|    142|            const char *desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (633:32): [True: 0, False: 142]
  ------------------
  634|       |
  635|    142|            if (sigret != NULL)
  ------------------
  |  Branch (635:17): [True: 71, False: 71]
  ------------------
  636|     71|                ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|     71|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  637|    142|            ret = signature->digest_sign(pctx->op.sig.algctx, sigret, siglen,
  638|    142|                                         sigret == NULL ? 0 : *siglen, tbs, tbslen);
  ------------------
  |  Branch (638:42): [True: 71, False: 71]
  ------------------
  639|    142|            if (ret <= 0)
  ------------------
  |  Branch (639:17): [True: 0, False: 142]
  ------------------
  640|      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
  ------------------
  641|      0|                               "%s digest_sign:%s", signature->type_name, desc);
  642|    142|            return ret;
  643|    142|        }
  644|    142|    } else {
  645|       |        /* legacy */
  646|      0|        if (pctx->pmeth != NULL && pctx->pmeth->digestsign != NULL)
  ------------------
  |  Branch (646:13): [True: 0, False: 0]
  |  Branch (646:36): [True: 0, False: 0]
  ------------------
  647|      0|            return pctx->pmeth->digestsign(ctx, sigret, siglen, tbs, tbslen);
  648|      0|    }
  649|       |
  650|      0|    if (sigret != NULL && EVP_DigestSignUpdate(ctx, tbs, tbslen) <= 0)
  ------------------
  |  Branch (650:9): [True: 0, False: 0]
  |  Branch (650:27): [True: 0, False: 0]
  ------------------
  651|      0|        return 0;
  652|      0|    return EVP_DigestSignFinal(ctx, sigret, siglen);
  653|      0|}
EVP_DigestVerify:
  746|     71|{
  747|     71|    EVP_PKEY_CTX *pctx = ctx->pctx;
  748|       |
  749|     71|    if (pctx == NULL) {
  ------------------
  |  Branch (749:9): [True: 0, False: 71]
  ------------------
  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|     71|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|     71|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (754:9): [True: 0, False: 71]
  ------------------
  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|     71|    if (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|    142|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (759:9): [True: 71, False: 0]
  ------------------
  760|     71|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (760:16): [True: 71, False: 0]
  ------------------
  761|     71|            && pctx->op.sig.signature != NULL) {
  ------------------
  |  Branch (761:16): [True: 71, False: 0]
  ------------------
  762|     71|        if (pctx->op.sig.signature->digest_verify != NULL) {
  ------------------
  |  Branch (762:13): [True: 71, False: 0]
  ------------------
  763|     71|            EVP_SIGNATURE *signature = pctx->op.sig.signature;
  764|     71|            const char *desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (764:32): [True: 0, False: 71]
  ------------------
  765|     71|            int ret;
  766|       |
  767|     71|            ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|     71|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  768|     71|            ret = signature->digest_verify(pctx->op.sig.algctx, sigret, siglen, tbs, tbslen);
  769|     71|            if (ret <= 0)
  ------------------
  |  Branch (769:17): [True: 0, False: 71]
  ------------------
  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|     71|            return ret;
  773|     71|        }
  774|     71|    } 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|      0|    if (EVP_DigestVerifyUpdate(ctx, tbs, tbslen) <= 0)
  ------------------
  |  Branch (779:9): [True: 0, False: 0]
  ------------------
  780|      0|        return -1;
  781|      0|    return EVP_DigestVerifyFinal(ctx, sigret, siglen);
  782|      0|}
m_sigver.c:do_sigver_init:
   42|    142|{
   43|    142|    EVP_PKEY_CTX *locpctx = NULL;
   44|    142|    EVP_SIGNATURE *signature = NULL;
   45|    142|    const char *desc;
   46|    142|    EVP_KEYMGMT *tmp_keymgmt = NULL;
   47|    142|    const OSSL_PROVIDER *tmp_prov = NULL;
   48|    142|    const char *supported_sig = NULL;
   49|    142|    char locmdname[80] = "";     /* 80 chars should be enough */
   50|    142|    void *provkey = NULL;
   51|    142|    int ret, iter, reinit = 1;
   52|       |
   53|    142|    if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (53:9): [True: 0, False: 142]
  ------------------
   54|      0|        return 0;
   55|       |
   56|    142|    if (ctx->pctx == NULL) {
  ------------------
  |  Branch (56:9): [True: 142, False: 0]
  ------------------
   57|    142|        reinit = 0;
   58|    142|        if (e == NULL)
  ------------------
  |  Branch (58:13): [True: 142, False: 0]
  ------------------
   59|    142|            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|    142|    }
   63|    142|    if (ctx->pctx == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 142]
  ------------------
   64|      0|        return 0;
   65|       |
   66|    142|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|    142|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
   67|       |
   68|    142|    locpctx = ctx->pctx;
   69|    142|    ERR_set_mark();
   70|       |
   71|    142|    if (evp_pkey_ctx_is_legacy(locpctx))
  ------------------
  |  |   36|    142|    ((ctx)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 142]
  |  |  ------------------
  ------------------
   72|      0|        goto legacy;
   73|       |
   74|       |    /* do not reinitialize if pkey is set or operation is different */
   75|    142|    if (reinit
  ------------------
  |  Branch (75:9): [True: 0, False: 142]
  ------------------
   76|    142|        && (pkey != NULL
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            || 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|      0|            || (signature = locpctx->op.sig.signature) == NULL
  ------------------
  |  Branch (79:16): [True: 0, False: 0]
  ------------------
   80|      0|            || locpctx->op.sig.algctx == NULL))
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|      0|        reinit = 0;
   82|       |
   83|    142|    if (props == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 142]
  ------------------
   84|      0|        props = locpctx->propquery;
   85|       |
   86|    142|    if (locpctx->pkey == NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 142]
  ------------------
   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|    142|    if (!reinit) {
  ------------------
  |  Branch (92:9): [True: 142, False: 0]
  ------------------
   93|    142|        evp_pkey_ctx_free_old_ops(locpctx);
   94|    142|    } 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|    142|    if (!ossl_assert(locpctx->pkey->keymgmt == NULL
  ------------------
  |  |   52|    284|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 142]
  |  |  |  Branch (52:43): [True: 142, False: 0]
  |  |  ------------------
  |  |   53|    142|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (103:9): [True: 0, False: 142]
  ------------------
  104|    142|                     || 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|    142|    supported_sig = evp_keymgmt_util_query_operation_name(locpctx->keymgmt,
  110|    142|                                                          OSSL_OP_SIGNATURE);
  ------------------
  |  |  317|    142|# define OSSL_OP_SIGNATURE                          12
  ------------------
  111|    142|    if (supported_sig == NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 142]
  ------------------
  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|    284|    for (iter = 1, provkey = NULL; iter < 3 && provkey == NULL; iter++) {
  ------------------
  |  Branch (134:36): [True: 284, False: 0]
  |  Branch (134:48): [True: 142, False: 142]
  ------------------
  135|    142|        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|    142|        EVP_SIGNATURE_free(signature);
  143|    142|        EVP_KEYMGMT_free(tmp_keymgmt);
  144|       |
  145|    142|        switch (iter) {
  ------------------
  |  Branch (145:17): [True: 0, False: 142]
  ------------------
  146|    142|        case 1:
  ------------------
  |  Branch (146:9): [True: 142, False: 0]
  ------------------
  147|    142|            signature = EVP_SIGNATURE_fetch(locpctx->libctx, supported_sig,
  148|    142|                                            locpctx->propquery);
  149|    142|            if (signature != NULL)
  ------------------
  |  Branch (149:17): [True: 142, False: 0]
  ------------------
  150|    142|                tmp_prov = EVP_SIGNATURE_get0_provider(signature);
  151|    142|            break;
  152|      0|        case 2:
  ------------------
  |  Branch (152:9): [True: 0, False: 142]
  ------------------
  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|    142|        }
  161|    142|        if (signature == NULL)
  ------------------
  |  Branch (161:13): [True: 0, False: 142]
  ------------------
  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|    142|        tmp_keymgmt_tofree = tmp_keymgmt =
  175|    142|            evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  176|    142|                                        EVP_KEYMGMT_get0_name(locpctx->keymgmt),
  177|    142|                                        locpctx->propquery);
  178|    142|        if (tmp_keymgmt != NULL)
  ------------------
  |  Branch (178:13): [True: 142, False: 0]
  ------------------
  179|    142|            provkey = evp_pkey_export_to_provider(locpctx->pkey, locpctx->libctx,
  180|    142|                                                  &tmp_keymgmt, locpctx->propquery);
  181|    142|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (181:13): [True: 0, False: 142]
  ------------------
  182|      0|            EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  183|    142|    }
  184|       |
  185|    142|    if (provkey == NULL) {
  ------------------
  |  Branch (185:9): [True: 0, False: 142]
  ------------------
  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|    142|    ERR_pop_to_mark();
  193|       |
  194|       |    /* No more legacy from here down to legacy: */
  195|       |
  196|    142|    locpctx->op.sig.signature = signature;
  197|    142|    locpctx->operation = ver ? EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|     71|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (197:26): [True: 71, False: 71]
  ------------------
  198|    142|                             : EVP_PKEY_OP_SIGNCTX;
  ------------------
  |  | 1751|    213|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  199|    142|    locpctx->op.sig.algctx
  200|    142|        = signature->newctx(ossl_provider_ctx(signature->prov), props);
  201|    142|    if (locpctx->op.sig.algctx == NULL) {
  ------------------
  |  Branch (201:9): [True: 0, False: 142]
  ------------------
  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|    142| reinitialize:
  207|    142|    if (pctx != NULL)
  ------------------
  |  Branch (207:9): [True: 0, False: 142]
  ------------------
  208|      0|        *pctx = locpctx;
  209|       |
  210|    142|    if (type != NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 142]
  ------------------
  211|      0|        ctx->reqdigest = type;
  212|      0|        if (mdname == NULL)
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            mdname = canon_mdname(EVP_MD_get0_name(type));
  214|    142|    } else {
  215|    142|        if (mdname == NULL && !reinit) {
  ------------------
  |  Branch (215:13): [True: 142, False: 0]
  |  Branch (215:31): [True: 142, False: 0]
  ------------------
  216|    142|            if (evp_keymgmt_util_get_deflt_digest_name(tmp_keymgmt, provkey,
  ------------------
  |  Branch (216:17): [True: 142, False: 0]
  ------------------
  217|    142|                                                       locmdname,
  218|    142|                                                       sizeof(locmdname)) > 0) {
  219|    142|                mdname = canon_mdname(locmdname);
  220|    142|            }
  221|    142|        }
  222|       |
  223|    142|        if (mdname != NULL) {
  ------------------
  |  Branch (223:13): [True: 0, False: 142]
  ------------------
  224|       |            /*
  225|       |             * We're about to get a new digest so clear anything associated with
  226|       |             * an old digest.
  227|       |             */
  228|      0|            evp_md_ctx_clear_digest(ctx, 1, 0);
  229|       |
  230|       |            /* legacy code support for engines */
  231|      0|            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|      0|            ctx->fetched_digest = EVP_MD_fetch(locpctx->libctx, mdname, props);
  240|      0|            if (ctx->fetched_digest != NULL) {
  ------------------
  |  Branch (240:17): [True: 0, False: 0]
  ------------------
  241|      0|                ctx->digest = ctx->reqdigest = ctx->fetched_digest;
  242|      0|            } 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|      0|            (void)ERR_pop_to_mark();
  252|      0|        }
  253|    142|    }
  254|       |
  255|    142|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (255:12): [True: 0, False: 142]
  ------------------
  256|    142|    if (ver) {
  ------------------
  |  Branch (256:9): [True: 71, False: 71]
  ------------------
  257|     71|        if (signature->digest_verify_init == NULL) {
  ------------------
  |  Branch (257:13): [True: 0, False: 71]
  ------------------
  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|     71|        ret = signature->digest_verify_init(locpctx->op.sig.algctx,
  263|     71|                                            mdname, provkey, params);
  264|     71|    } else {
  265|     71|        if (signature->digest_sign_init == NULL) {
  ------------------
  |  Branch (265:13): [True: 0, False: 71]
  ------------------
  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|     71|        ret = signature->digest_sign_init(locpctx->op.sig.algctx,
  271|     71|                                          mdname, provkey, params);
  272|     71|    }
  273|       |
  274|       |    /*
  275|       |     * If the operation was not a success and no digest was found, an error
  276|       |     * needs to be raised.
  277|       |     */
  278|    142|    if (ret > 0 || mdname != NULL)
  ------------------
  |  Branch (278:9): [True: 142, False: 0]
  |  Branch (278:20): [True: 0, False: 0]
  ------------------
  279|    142|        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|    142| end:
  364|    142|    if (ret > 0)
  ------------------
  |  Branch (364:9): [True: 142, False: 0]
  ------------------
  365|    142|        ret = evp_pkey_ctx_use_cached_data(locpctx);
  366|       |
  367|    142|    EVP_KEYMGMT_free(tmp_keymgmt);
  368|    142|    return ret > 0 ? 1 : 0;
  ------------------
  |  Branch (368:12): [True: 142, False: 0]
  ------------------
  369|      0|}
m_sigver.c:canon_mdname:
   30|    142|{
   31|    142|    if (mdname != NULL && strcmp(mdname, "UNDEF") == 0)
  ------------------
  |  Branch (31:9): [True: 142, False: 0]
  |  Branch (31:27): [True: 142, False: 0]
  ------------------
   32|    142|        return NULL;
   33|       |
   34|      0|    return mdname;
   35|    142|}

EVP_add_cipher:
   20|    144|{
   21|    144|    int r;
   22|       |
   23|    144|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 144]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    144|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    144|                     (const char *)c);
   28|    144|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 144]
  ------------------
   29|      0|        return 0;
   30|    144|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    144|                     (const char *)c);
   32|    144|    return r;
   33|    144|}
EVP_add_digest:
   36|     22|{
   37|     22|    int r;
   38|     22|    const char *name;
   39|       |
   40|     22|    name = OBJ_nid2sn(md->type);
   41|     22|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     22|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 22]
  ------------------
   43|      0|        return 0;
   44|     22|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     22|                     (const char *)md);
   46|     22|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     22|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 17, False: 5]
  |  Branch (49:26): [True: 16, False: 1]
  ------------------
   50|     16|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     16|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 16]
  ------------------
   53|      0|            return 0;
   54|     16|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     16|    }
   57|     22|    return r;
   58|     22|}
evp_cleanup_int:
  180|      1|{
  181|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      1|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  182|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      1|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  183|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      1|# 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|      1|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      1|    EVP_PBE_cleanup();
  192|      1|    OBJ_sigid_free();
  193|       |
  194|      1|    evp_app_cleanup_int();
  195|      1|}

EVP_PKEY_eq:
  369|     44|{
  370|       |    /*
  371|       |     * This will just call evp_keymgmt_util_match when legacy support
  372|       |     * is gone.
  373|       |     */
  374|       |
  375|       |    /* Trivial shortcuts */
  376|     44|    if (a == b)
  ------------------
  |  Branch (376:9): [True: 22, False: 22]
  ------------------
  377|     22|        return 1;
  378|     22|    if (a == NULL || b == NULL)
  ------------------
  |  Branch (378:9): [True: 0, False: 22]
  |  Branch (378:22): [True: 0, False: 22]
  ------------------
  379|      0|        return 0;
  380|       |
  381|     22|#ifndef FIPS_MODULE
  382|     22|    if (a->keymgmt != NULL || b->keymgmt != NULL)
  ------------------
  |  Branch (382:9): [True: 22, False: 0]
  |  Branch (382:31): [True: 0, False: 0]
  ------------------
  383|     22|#endif  /* !FIPS_MODULE */
  384|     22|    {
  385|     22|        int selection = SELECT_PARAMETERS;
  ------------------
  |  |   58|     22|# define SELECT_PARAMETERS OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS
  |  |  ------------------
  |  |  |  |  642|     22|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  ------------------
  386|       |
  387|     22|        if (evp_keymgmt_util_has((EVP_PKEY *)a, OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  ------------------
  |  |  641|     22|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (387:13): [True: 22, False: 0]
  ------------------
  388|     22|            && evp_keymgmt_util_has((EVP_PKEY *)b, OSSL_KEYMGMT_SELECT_PUBLIC_KEY))
  ------------------
  |  |  641|     22|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (388:16): [True: 22, False: 0]
  ------------------
  389|     22|            selection |= OSSL_KEYMGMT_SELECT_PUBLIC_KEY;
  ------------------
  |  |  641|     22|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  390|      0|        else
  391|      0|            selection |= OSSL_KEYMGMT_SELECT_KEYPAIR;
  ------------------
  |  |  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
  |  |  ------------------
  ------------------
  392|     22|        return evp_pkey_cmp_any(a, b, selection);
  393|     22|    }
  394|       |
  395|      0|#ifndef FIPS_MODULE
  396|       |    /* All legacy keys */
  397|      0|    if (a->type != b->type)
  ------------------
  |  Branch (397:9): [True: 0, False: 0]
  ------------------
  398|      0|        return -1;
  399|       |
  400|      0|    if (a->ameth != NULL) {
  ------------------
  |  Branch (400:9): [True: 0, False: 0]
  ------------------
  401|      0|        int ret;
  402|       |        /* Compare parameters if the algorithm has them */
  403|      0|        if (a->ameth->param_cmp != NULL) {
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|            ret = a->ameth->param_cmp(a, b);
  405|      0|            if (ret <= 0)
  ------------------
  |  Branch (405:17): [True: 0, False: 0]
  ------------------
  406|      0|                return ret;
  407|      0|        }
  408|       |
  409|      0|        if (a->ameth->pub_cmp != NULL)
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|            return a->ameth->pub_cmp(a, b);
  411|      0|    }
  412|       |
  413|      0|    return -2;
  414|      0|#endif  /* !FIPS_MODULE */
  415|      0|}
EVP_PKEY_new_raw_private_key_ex:
  537|     14|{
  538|     14|    return new_raw_key_int(libctx, keytype, propq, EVP_PKEY_NONE, NULL, priv,
  ------------------
  |  |   62|     14|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     14|#define NID_undef                       0
  |  |  ------------------
  ------------------
  539|     14|                           len, 1);
  540|     14|}
EVP_PKEY_new_raw_public_key_ex:
  552|     18|{
  553|     18|    return new_raw_key_int(libctx, keytype, propq, EVP_PKEY_NONE, NULL, pub,
  ------------------
  |  |   62|     18|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     18|#define NID_undef                       0
  |  |  ------------------
  ------------------
  554|     18|                           len, 0);
  555|     18|}
EVP_PKEY_type:
 1026|  1.87k|{
 1027|  1.87k|    int ret;
 1028|  1.87k|    const EVP_PKEY_ASN1_METHOD *ameth;
 1029|  1.87k|    ENGINE *e;
 1030|  1.87k|    ameth = EVP_PKEY_asn1_find(&e, type);
 1031|  1.87k|    if (ameth)
  ------------------
  |  Branch (1031:9): [True: 5, False: 1.86k]
  ------------------
 1032|      5|        ret = ameth->pkey_id;
 1033|  1.86k|    else
 1034|  1.86k|        ret = NID_undef;
  ------------------
  |  |   18|  1.86k|#define NID_undef                       0
  ------------------
 1035|  1.87k|# ifndef OPENSSL_NO_ENGINE
 1036|  1.87k|    ENGINE_finish(e);
 1037|  1.87k|# endif
 1038|  1.87k|    return ret;
 1039|  1.87k|}
evp_pkey_name2type:
 1079|    944|{
 1080|    944|    int type;
 1081|    944|    size_t i;
 1082|       |
 1083|  12.2k|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|  12.2k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1083:17): [True: 11.2k, False: 938]
  ------------------
 1084|  11.2k|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1084:13): [True: 6, False: 11.2k]
  ------------------
 1085|      6|            return (int)standard_name2type[i].id;
 1086|  11.2k|    }
 1087|       |
 1088|    938|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|    938|#define NID_undef                       0
  ------------------
  |  Branch (1088:9): [True: 5, False: 933]
  ------------------
 1089|      5|        return type;
 1090|    933|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1091|    938|}
EVP_PKEY_new:
 1509|    474|{
 1510|    474|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|    474|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1511|       |
 1512|    474|    if (ret == NULL)
  ------------------
  |  Branch (1512:9): [True: 0, False: 474]
  ------------------
 1513|      0|        return NULL;
 1514|       |
 1515|    474|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|    474|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    474|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1516|    474|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   62|    474|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    474|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1517|       |
 1518|    474|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1518:9): [True: 0, False: 474]
  ------------------
 1519|      0|        goto err;
 1520|       |
 1521|    474|    ret->lock = CRYPTO_THREAD_lock_new();
 1522|    474|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1522:9): [True: 0, False: 474]
  ------------------
 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|    474|#ifndef FIPS_MODULE
 1528|    474|    ret->save_parameters = 1;
 1529|    474|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  247|    474|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1529:9): [True: 0, False: 474]
  ------------------
 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|    474|#endif
 1534|    474|    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|    474|}
EVP_PKEY_set_type_by_keymgmt:
 1695|    449|{
 1696|    449|#ifndef FIPS_MODULE
 1697|    449|# define EVP_PKEY_TYPE_STR str[0]
 1698|    449|# 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|    449|    const char *str[2] = { NULL, NULL };
 1705|       |
 1706|    449|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1706:9): [True: 0, False: 449]
  ------------------
 1707|    449|            || str[1] != NULL) {
  ------------------
  |  Branch (1707:16): [True: 0, False: 449]
  ------------------
 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|    449|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   62|    449|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    449|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1716|    449|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1697|    449|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1698|    449|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1698:32): [True: 449, False: 0]
  |  |  ------------------
  ------------------
 1717|    449|                         keymgmt);
 1718|       |
 1719|    449|#undef EVP_PKEY_TYPE_STR
 1720|    449|#undef EVP_PKEY_TYPE_STRLEN
 1721|    449|}
EVP_PKEY_up_ref:
 1724|    384|{
 1725|    384|    int i;
 1726|       |
 1727|    384|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1727:9): [True: 0, False: 384]
  ------------------
 1728|      0|        return 0;
 1729|       |
 1730|    384|    REF_PRINT_COUNT("EVP_PKEY", i, pkey);
  ------------------
  |  |  301|    384|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    384|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|    384|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    384|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|    384|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|    384|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 384]
  |  |  ------------------
  ------------------
 1732|    384|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1732:13): [True: 384, False: 0]
  ------------------
 1733|    384|}
evp_pkey_free_legacy:
 1798|    918|{
 1799|    918|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1800|    918|    ENGINE *tmpe = NULL;
 1801|       |
 1802|    918|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1802:9): [True: 918, False: 0]
  |  Branch (1802:26): [True: 0, False: 918]
  ------------------
 1803|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1804|       |
 1805|    918|    if (ameth != NULL) {
  ------------------
  |  Branch (1805:9): [True: 0, False: 918]
  ------------------
 1806|      0|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 0]
  ------------------
 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|      0|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1819:13): [True: 0, False: 0]
  ------------------
 1820|      0|            ameth->pkey_free(x);
 1821|      0|        x->pkey.ptr = NULL;
 1822|      0|    }
 1823|    918|# ifndef OPENSSL_NO_ENGINE
 1824|    918|    ENGINE_finish(tmpe);
 1825|    918|    ENGINE_finish(x->engine);
 1826|    918|    x->engine = NULL;
 1827|    918|    ENGINE_finish(x->pmeth_engine);
 1828|    918|    x->pmeth_engine = NULL;
 1829|    918|# endif
 1830|    918|}
EVP_PKEY_free:
 1851|  2.91k|{
 1852|  2.91k|    int i;
 1853|       |
 1854|  2.91k|    if (x == NULL)
  ------------------
  |  Branch (1854:9): [True: 2.05k, False: 858]
  ------------------
 1855|  2.05k|        return;
 1856|       |
 1857|    858|    CRYPTO_DOWN_REF(&x->references, &i);
 1858|    858|    REF_PRINT_COUNT("EVP_PKEY", i, x);
  ------------------
  |  |  301|    858|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    858|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|    858|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    858|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1859|    858|    if (i > 0)
  ------------------
  |  Branch (1859:9): [True: 384, False: 474]
  ------------------
 1860|    384|        return;
 1861|    474|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|    474|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 474]
  |  |  ------------------
  ------------------
 1862|    474|    evp_pkey_free_it(x);
 1863|    474|#ifndef FIPS_MODULE
 1864|    474|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  247|    474|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1865|    474|#endif
 1866|    474|    CRYPTO_THREAD_lock_free(x->lock);
 1867|    474|    CRYPTO_FREE_REF(&x->references);
 1868|    474|#ifndef FIPS_MODULE
 1869|    474|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|    474|#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|    474|#endif
 1871|    474|    OPENSSL_free(x);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1872|    474|}
evp_pkey_export_to_provider:
 1909|    380|{
 1910|    380|    EVP_KEYMGMT *allocated_keymgmt = NULL;
 1911|    380|    EVP_KEYMGMT *tmp_keymgmt = NULL;
 1912|    380|    int selection = OSSL_KEYMGMT_SELECT_ALL;
  ------------------
  |  |  652|    380|    ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  650|    380|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    380|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    380|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  647|    380|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|    380|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  648|    380|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|    380|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1913|    380|    void *keydata = NULL;
 1914|    380|    int check;
 1915|       |
 1916|    380|    if (pk == NULL)
  ------------------
  |  Branch (1916:9): [True: 0, False: 380]
  ------------------
 1917|      0|        return NULL;
 1918|       |
 1919|       |    /* No key data => nothing to export */
 1920|    380|    check = 1;
 1921|    380|#ifndef FIPS_MODULE
 1922|    380|    check = check && pk->pkey.ptr == NULL;
  ------------------
  |  Branch (1922:13): [True: 380, False: 0]
  |  Branch (1922:22): [True: 380, False: 0]
  ------------------
 1923|    380|#endif
 1924|    380|    check = check && pk->keydata == NULL;
  ------------------
  |  Branch (1924:13): [True: 380, False: 0]
  |  Branch (1924:22): [True: 0, False: 380]
  ------------------
 1925|    380|    if (check)
  ------------------
  |  Branch (1925:9): [True: 0, False: 380]
  ------------------
 1926|      0|        return NULL;
 1927|       |
 1928|    380|#ifndef FIPS_MODULE
 1929|    380|    if (pk->pkey.ptr != NULL) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 380]
  ------------------
 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|    380|#endif
 1938|       |
 1939|    380|    if (keymgmt != NULL) {
  ------------------
  |  Branch (1939:9): [True: 380, False: 0]
  ------------------
 1940|    380|        tmp_keymgmt = *keymgmt;
 1941|    380|        *keymgmt = NULL;
 1942|    380|    }
 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|    380|    if (tmp_keymgmt == NULL) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 380]
  ------------------
 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|    380|    if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (1959:9): [True: 0, False: 380]
  ------------------
 1960|      0|        goto end;
 1961|       |
 1962|    380|#ifndef FIPS_MODULE
 1963|    380|    if (pk->pkey.ptr != NULL) {
  ------------------
  |  Branch (1963:9): [True: 0, False: 380]
  ------------------
 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|    380|#endif  /* FIPS_MODULE */
 2064|       |
 2065|    380|    keydata = evp_keymgmt_util_export_to_provider(pk, tmp_keymgmt, selection);
 2066|       |
 2067|    380| 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|    380|    if (keydata == NULL)
  ------------------
  |  Branch (2073:9): [True: 0, False: 380]
  ------------------
 2074|      0|        tmp_keymgmt = NULL;
 2075|       |
 2076|    380|    if (keymgmt != NULL && tmp_keymgmt != NULL) {
  ------------------
  |  Branch (2076:9): [True: 380, False: 0]
  |  Branch (2076:28): [True: 380, False: 0]
  ------------------
 2077|    380|        *keymgmt = tmp_keymgmt;
 2078|    380|        allocated_keymgmt = NULL;
 2079|    380|    }
 2080|       |
 2081|    380|    EVP_KEYMGMT_free(allocated_keymgmt);
 2082|    380|    return keydata;
 2083|    380|}
p_lib.c:evp_pkey_cmp_any:
  263|     22|{
  264|       |#ifdef FIPS_MODULE
  265|       |    return evp_keymgmt_util_match((EVP_PKEY *)a, (EVP_PKEY *)b, selection);
  266|       |#else
  267|     22|    EVP_KEYMGMT *keymgmt1 = NULL, *keymgmt2 = NULL;
  268|     22|    void *keydata1 = NULL, *keydata2 = NULL, *tmp_keydata = NULL;
  269|       |
  270|       |    /* If none of them are provided, this function shouldn't have been called */
  271|     22|    if (!ossl_assert(evp_pkey_is_provided(a) || evp_pkey_is_provided(b)))
  ------------------
  |  |   52|     22|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 22, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|     22|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (271:9): [True: 0, False: 22]
  ------------------
  272|      0|        return -2;
  273|       |
  274|       |    /* For purely provided keys, we just call the keymgmt utility */
  275|     22|    if (evp_pkey_is_provided(a) && evp_pkey_is_provided(b))
  ------------------
  |  |  649|     44|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 22, False: 0]
  |  |  ------------------
  ------------------
                  if (evp_pkey_is_provided(a) && evp_pkey_is_provided(b))
  ------------------
  |  |  649|     22|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 22, False: 0]
  |  |  ------------------
  ------------------
  276|     22|        return evp_keymgmt_util_match((EVP_PKEY *)a, (EVP_PKEY *)b, selection);
  277|       |
  278|       |    /*
  279|       |     * At this point, one of them is provided, the other not.  This allows
  280|       |     * us to compare types using legacy NIDs.
  281|       |     */
  282|      0|    if (evp_pkey_is_legacy(a)
  ------------------
  |  |  647|      0|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 0, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  283|      0|        && !EVP_KEYMGMT_is_a(b->keymgmt, OBJ_nid2sn(a->type)))
  ------------------
  |  Branch (283:12): [True: 0, False: 0]
  ------------------
  284|      0|        return -1;               /* not the same key type */
  285|      0|    if (evp_pkey_is_legacy(b)
  ------------------
  |  |  647|      0|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 0, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  286|      0|        && !EVP_KEYMGMT_is_a(a->keymgmt, OBJ_nid2sn(b->type)))
  ------------------
  |  Branch (286:12): [True: 0, False: 0]
  ------------------
  287|      0|        return -1;               /* not the same key type */
  288|       |
  289|       |    /*
  290|       |     * We've determined that they both are the same keytype, so the next
  291|       |     * step is to do a bit of cross export to ensure we have keydata for
  292|       |     * both keys in the same keymgmt.
  293|       |     */
  294|      0|    keymgmt1 = a->keymgmt;
  295|      0|    keydata1 = a->keydata;
  296|      0|    keymgmt2 = b->keymgmt;
  297|      0|    keydata2 = b->keydata;
  298|       |
  299|      0|    if (keymgmt2 != NULL && keymgmt2->match != NULL) {
  ------------------
  |  Branch (299:9): [True: 0, False: 0]
  |  Branch (299:29): [True: 0, False: 0]
  ------------------
  300|      0|        tmp_keydata =
  301|      0|            evp_pkey_export_to_provider((EVP_PKEY *)a, NULL, &keymgmt2, NULL);
  302|      0|        if (tmp_keydata != NULL) {
  ------------------
  |  Branch (302:13): [True: 0, False: 0]
  ------------------
  303|      0|            keymgmt1 = keymgmt2;
  304|      0|            keydata1 = tmp_keydata;
  305|      0|        }
  306|      0|    }
  307|      0|    if (tmp_keydata == NULL && keymgmt1 != NULL && keymgmt1->match != NULL) {
  ------------------
  |  Branch (307:9): [True: 0, False: 0]
  |  Branch (307:32): [True: 0, False: 0]
  |  Branch (307:52): [True: 0, False: 0]
  ------------------
  308|      0|        tmp_keydata =
  309|      0|            evp_pkey_export_to_provider((EVP_PKEY *)b, NULL, &keymgmt1, NULL);
  310|      0|        if (tmp_keydata != NULL) {
  ------------------
  |  Branch (310:13): [True: 0, False: 0]
  ------------------
  311|      0|            keymgmt2 = keymgmt1;
  312|      0|            keydata2 = tmp_keydata;
  313|      0|        }
  314|      0|    }
  315|       |
  316|       |    /* If we still don't have matching keymgmt implementations, we give up */
  317|      0|    if (keymgmt1 != keymgmt2)
  ------------------
  |  Branch (317:9): [True: 0, False: 0]
  ------------------
  318|      0|        return -2;
  319|       |
  320|       |    /* If the keymgmt implementations are NULL, the export failed */
  321|      0|    if (keymgmt1 == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 0]
  ------------------
  322|      0|        return -2;
  323|       |
  324|      0|    return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection);
  325|      0|#endif  /* FIPS_MODULE */
  326|      0|}
p_lib.c:new_raw_key_int:
  426|     32|{
  427|     32|    EVP_PKEY *pkey = NULL;
  428|     32|    EVP_PKEY_CTX *ctx = NULL;
  429|     32|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
  430|     32|    int result = 0;
  431|       |
  432|     32|# ifndef OPENSSL_NO_ENGINE
  433|       |    /* Check if there is an Engine for this type */
  434|     32|    if (e == NULL) {
  ------------------
  |  Branch (434:9): [True: 32, False: 0]
  ------------------
  435|     32|        ENGINE *tmpe = NULL;
  436|       |
  437|     32|        if (strtype != NULL)
  ------------------
  |  Branch (437:13): [True: 31, False: 1]
  ------------------
  438|     31|            ameth = EVP_PKEY_asn1_find_str(&tmpe, strtype, -1);
  439|      1|        else if (nidtype != EVP_PKEY_NONE)
  ------------------
  |  |   62|      1|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      1|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (439:18): [True: 0, False: 1]
  ------------------
  440|      0|            ameth = EVP_PKEY_asn1_find(&tmpe, nidtype);
  441|       |
  442|       |        /* If tmpe is NULL then no engine is claiming to support this type */
  443|     32|        if (tmpe == NULL)
  ------------------
  |  Branch (443:13): [True: 32, False: 0]
  ------------------
  444|     32|            ameth = NULL;
  445|       |
  446|     32|        ENGINE_finish(tmpe);
  447|     32|    }
  448|     32|# endif
  449|       |
  450|     32|    if (e == NULL && ameth == NULL) {
  ------------------
  |  Branch (450:9): [True: 32, False: 0]
  |  Branch (450:22): [True: 32, False: 0]
  ------------------
  451|       |        /*
  452|       |         * No engine is claiming to support this type, so lets see if we have
  453|       |         * a provider.
  454|       |         */
  455|     32|        ctx = EVP_PKEY_CTX_new_from_name(libctx,
  456|     32|                                         strtype != NULL ? strtype
  ------------------
  |  Branch (456:42): [True: 31, False: 1]
  ------------------
  457|     32|                                                         : OBJ_nid2sn(nidtype),
  458|     32|                                         propq);
  459|     32|        if (ctx == NULL)
  ------------------
  |  Branch (459:13): [True: 2, False: 30]
  ------------------
  460|      2|            goto err;
  461|       |        /* May fail if no provider available */
  462|     30|        ERR_set_mark();
  463|     30|        if (EVP_PKEY_fromdata_init(ctx) == 1) {
  ------------------
  |  Branch (463:13): [True: 30, False: 0]
  ------------------
  464|     30|            OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     30|    { NULL, 0, NULL, 0, 0 }
  ------------------
                          OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     30|    { NULL, 0, NULL, 0, 0 }
  ------------------
  465|       |
  466|     30|            ERR_clear_last_mark();
  467|     30|            params[0] = OSSL_PARAM_construct_octet_string(
  468|     30|                            key_is_priv ? OSSL_PKEY_PARAM_PRIV_KEY
  ------------------
  |  |  431|     14|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (468:29): [True: 14, False: 16]
  ------------------
  469|     30|                                        : OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  433|     46|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  470|     30|                            (void *)key, len);
  471|       |
  472|     30|            if (EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEYPAIR, params) != 1) {
  ------------------
  |  |  113|     30|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  111|     30|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     30|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  647|     30|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  642|     30|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  648|     30|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  643|     30|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|     30|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|     30|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
  |  Branch (472:17): [True: 25, False: 5]
  ------------------
  473|     25|                ERR_raise(ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  474|     25|                goto err;
  475|     25|            }
  476|       |
  477|      5|            EVP_PKEY_CTX_free(ctx);
  478|       |
  479|      5|            return pkey;
  480|     30|        }
  481|      0|        ERR_pop_to_mark();
  482|       |        /* else not supported so fallback to legacy */
  483|      0|    }
  484|       |
  485|       |    /* Legacy code path */
  486|       |
  487|      0|    pkey = EVP_PKEY_new();
  488|      0|    if (pkey == NULL) {
  ------------------
  |  Branch (488:9): [True: 0, False: 0]
  ------------------
  489|      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)
  |  |  ------------------
  ------------------
  490|      0|        goto err;
  491|      0|    }
  492|       |
  493|      0|    if (!pkey_set_type(pkey, e, nidtype, strtype, -1, NULL)) {
  ------------------
  |  Branch (493:9): [True: 0, False: 0]
  ------------------
  494|       |        /* ERR_raise(ERR_LIB_EVP, ...) already called */
  495|      0|        goto err;
  496|      0|    }
  497|       |
  498|      0|    if (!ossl_assert(pkey->ameth != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  ------------------
  499|      0|        goto err;
  500|       |
  501|      0|    if (key_is_priv) {
  ------------------
  |  Branch (501:9): [True: 0, False: 0]
  ------------------
  502|      0|        if (pkey->ameth->set_priv_key == NULL) {
  ------------------
  |  Branch (502:13): [True: 0, False: 0]
  ------------------
  503|      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)
  |  |  ------------------
  ------------------
  504|      0|            goto err;
  505|      0|        }
  506|       |
  507|      0|        if (!pkey->ameth->set_priv_key(pkey, key, len)) {
  ------------------
  |  Branch (507:13): [True: 0, False: 0]
  ------------------
  508|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|    } else {
  512|      0|        if (pkey->ameth->set_pub_key == NULL) {
  ------------------
  |  Branch (512:13): [True: 0, False: 0]
  ------------------
  513|      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)
  |  |  ------------------
  ------------------
  514|      0|            goto err;
  515|      0|        }
  516|       |
  517|      0|        if (!pkey->ameth->set_pub_key(pkey, key, len)) {
  ------------------
  |  Branch (517:13): [True: 0, False: 0]
  ------------------
  518|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|    }
  522|       |
  523|      0|    result = 1;
  524|     27| err:
  525|     27|    if (!result) {
  ------------------
  |  Branch (525:9): [True: 27, False: 0]
  ------------------
  526|     27|        EVP_PKEY_free(pkey);
  527|     27|        pkey = NULL;
  528|     27|    }
  529|     27|    EVP_PKEY_CTX_free(ctx);
  530|     27|    return pkey;
  531|      0|}
p_lib.c:pkey_set_type:
 1558|  2.24k|{
 1559|  2.24k|#ifndef FIPS_MODULE
 1560|  2.24k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1561|  2.24k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1561:21): [True: 2.24k, False: 0]
  ------------------
 1562|  2.24k|#endif
 1563|       |
 1564|       |    /*
 1565|       |     * The setups can't set both legacy and provider side methods.
 1566|       |     * It is forbidden
 1567|       |     */
 1568|  2.24k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|  4.49k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.24k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  4.49k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1568:9): [True: 0, False: 2.24k]
  ------------------
 1569|  2.24k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|  2.24k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.24k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  2.24k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1569:12): [True: 0, False: 2.24k]
  ------------------
 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|  2.24k|    if (pkey != NULL) {
  ------------------
  |  Branch (1574:9): [True: 449, False: 1.79k]
  ------------------
 1575|    449|        int free_it = 0;
 1576|       |
 1577|    449|#ifndef FIPS_MODULE
 1578|    449|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1578:19): [True: 0, False: 449]
  |  Branch (1578:30): [True: 0, False: 449]
  ------------------
 1579|    449|#endif
 1580|    449|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1580:19): [True: 0, False: 449]
  |  Branch (1580:30): [True: 0, False: 449]
  ------------------
 1581|    449|        if (free_it)
  ------------------
  |  Branch (1581:13): [True: 0, False: 449]
  ------------------
 1582|      0|            evp_pkey_free_it(pkey);
 1583|    449|#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|    449|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   62|    449|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    898|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1588:13): [True: 0, False: 449]
  ------------------
 1589|    449|            && type == pkey->save_type
  ------------------
  |  Branch (1589:16): [True: 0, False: 0]
  ------------------
 1590|    449|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1590:16): [True: 0, False: 0]
  ------------------
 1591|      0|            return 1;
 1592|    449|# ifndef OPENSSL_NO_ENGINE
 1593|       |        /* If we have ENGINEs release them */
 1594|    449|        ENGINE_finish(pkey->engine);
 1595|    449|        pkey->engine = NULL;
 1596|    449|        ENGINE_finish(pkey->pmeth_engine);
 1597|    449|        pkey->pmeth_engine = NULL;
 1598|    449|# endif
 1599|    449|#endif
 1600|    449|    }
 1601|  2.24k|#ifndef FIPS_MODULE
 1602|  2.24k|    if (str != NULL)
  ------------------
  |  Branch (1602:9): [True: 1.79k, False: 449]
  ------------------
 1603|  1.79k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1604|    449|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   62|    449|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    449|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1604:14): [True: 0, False: 449]
  ------------------
 1605|      0|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1606|  2.24k|# ifndef OPENSSL_NO_ENGINE
 1607|  2.24k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1607:9): [True: 1.79k, False: 449]
  |  Branch (1607:25): [True: 1.79k, False: 0]
  ------------------
 1608|  1.79k|        ENGINE_finish(e);
 1609|  2.24k|# endif
 1610|  2.24k|#endif
 1611|       |
 1612|       |
 1613|  2.24k|    {
 1614|  2.24k|        int check = 1;
 1615|       |
 1616|  2.24k|#ifndef FIPS_MODULE
 1617|  2.24k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1617:17): [True: 2.24k, False: 0]
  |  Branch (1617:26): [True: 2.24k, False: 0]
  ------------------
 1618|  2.24k|#endif
 1619|  2.24k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1619:17): [True: 2.24k, False: 0]
  |  Branch (1619:26): [True: 1.79k, False: 449]
  ------------------
 1620|  2.24k|        if (check) {
  ------------------
  |  Branch (1620:13): [True: 1.79k, False: 449]
  ------------------
 1621|  1.79k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  1.79k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.79k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.79k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.79k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.79k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.79k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.79k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1622|  1.79k|            return 0;
 1623|  1.79k|        }
 1624|  2.24k|    }
 1625|    449|    if (pkey != NULL) {
  ------------------
  |  Branch (1625:9): [True: 449, False: 0]
  ------------------
 1626|    449|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1626:13): [True: 449, False: 0]
  |  Branch (1626:32): [True: 0, False: 449]
  ------------------
 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|    449|        pkey->keymgmt = keymgmt;
 1632|       |
 1633|    449|        pkey->save_type = type;
 1634|    449|        pkey->type = type;
 1635|       |
 1636|    449|#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|    449|        if (keymgmt == NULL)
  ------------------
  |  Branch (1642:13): [True: 0, False: 449]
  ------------------
 1643|      0|            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|    449|        if (ameth != NULL) {
  ------------------
  |  Branch (1653:13): [True: 0, False: 449]
  ------------------
 1654|      0|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1654:17): [True: 0, False: 0]
  ------------------
 1655|      0|                pkey->type = ameth->pkey_id;
 1656|    449|        } else {
 1657|    449|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |  103|    449|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1658|    449|        }
 1659|    449|# ifndef OPENSSL_NO_ENGINE
 1660|    449|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1660:13): [True: 0, False: 449]
  |  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|    449|# endif
 1665|    449|        pkey->engine = e;
 1666|    449|#endif
 1667|    449|    }
 1668|    449|    return 1;
 1669|    449|}
p_lib.c:find_ameth:
 1673|  1.79k|{
 1674|  1.79k|    const char **str = data;
 1675|       |
 1676|       |    /*
 1677|       |     * The error messages from pkey_set_type() are uninteresting here,
 1678|       |     * and misleading.
 1679|       |     */
 1680|  1.79k|    ERR_set_mark();
 1681|       |
 1682|  1.79k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   62|  1.79k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  1.79k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1682:9): [True: 0, False: 1.79k]
  ------------------
 1683|  1.79k|                      NULL)) {
 1684|      0|        if (str[0] == NULL)
  ------------------
  |  Branch (1684:13): [True: 0, False: 0]
  ------------------
 1685|      0|            str[0] = name;
 1686|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1686:18): [True: 0, False: 0]
  ------------------
 1687|      0|            str[1] = name;
 1688|      0|    }
 1689|       |
 1690|  1.79k|    ERR_pop_to_mark();
 1691|  1.79k|}
p_lib.c:evp_pkey_free_it:
 1834|    474|{
 1835|       |    /* internal function; x is never NULL */
 1836|    474|    evp_keymgmt_util_clear_operation_cache(x);
 1837|    474|#ifndef FIPS_MODULE
 1838|    474|    evp_pkey_free_legacy(x);
 1839|    474|#endif
 1840|       |
 1841|    474|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1841:9): [True: 449, False: 25]
  ------------------
 1842|    449|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1843|    449|        EVP_KEYMGMT_free(x->keymgmt);
 1844|    449|        x->keymgmt = NULL;
 1845|    449|        x->keydata = NULL;
 1846|    449|    }
 1847|    474|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|    474|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    474|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1848|    474|}

EVP_PKEY_keygen_init:
  100|    444|{
  101|    444|    return gen_init(ctx, EVP_PKEY_OP_KEYGEN);
  ------------------
  |  | 1746|    444|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  102|    444|}
EVP_PKEY_generate:
  129|    444|{
  130|    444|    int ret = 0;
  131|    444|    EVP_PKEY *allocated_pkey = NULL;
  132|       |    /* Legacy compatible keygen callback info, only used with provider impls */
  133|    444|    int gentmp[2];
  134|       |
  135|    444|    if (ppkey == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 444]
  ------------------
  136|      0|        return -1;
  137|       |
  138|    444|    if (ctx == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 444]
  ------------------
  139|      0|        goto not_supported;
  140|       |
  141|    444|    if ((ctx->operation & EVP_PKEY_OP_TYPE_GEN) == 0)
  ------------------
  |  | 1782|    444|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  ------------------
  |  |  |  | 1745|    444|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  ------------------
  |  |  |  | 1746|    444|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (141:9): [True: 0, False: 444]
  ------------------
  142|      0|        goto not_initialized;
  143|       |
  144|    444|    if (*ppkey == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 444]
  ------------------
  145|      0|        *ppkey = allocated_pkey = EVP_PKEY_new();
  146|       |
  147|    444|    if (*ppkey == NULL) {
  ------------------
  |  Branch (147:9): [True: 0, False: 444]
  ------------------
  148|      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)
  |  |  ------------------
  ------------------
  149|      0|        return -1;
  150|      0|    }
  151|       |
  152|    444|    if (ctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 444]
  ------------------
  153|      0|        goto legacy;
  154|       |
  155|       |    /*
  156|       |     * Assigning gentmp to ctx->keygen_info is something our legacy
  157|       |     * implementations do.  Because the provider implementations aren't
  158|       |     * allowed to reach into our EVP_PKEY_CTX, we need to provide similar
  159|       |     * space for backward compatibility.  It's ok that we attach a local
  160|       |     * variable, as it should only be useful in the calls down from here.
  161|       |     * This is cleared as soon as it isn't useful any more, i.e. directly
  162|       |     * after the evp_keymgmt_util_gen() call.
  163|       |     */
  164|    444|    ctx->keygen_info = gentmp;
  165|    444|    ctx->keygen_info_count = 2;
  166|       |
  167|    444|    ret = 1;
  168|    444|    if (ctx->pkey != NULL) {
  ------------------
  |  Branch (168:9): [True: 0, False: 444]
  ------------------
  169|      0|        EVP_KEYMGMT *tmp_keymgmt = ctx->keymgmt;
  170|      0|        void *keydata =
  171|      0|            evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  172|      0|                                        &tmp_keymgmt, ctx->propquery);
  173|       |
  174|      0|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            goto not_supported;
  176|       |        /*
  177|       |         * It's ok if keydata is NULL here.  The backend is expected to deal
  178|       |         * with that as it sees fit.
  179|       |         */
  180|      0|        ret = evp_keymgmt_gen_set_template(ctx->keymgmt,
  181|      0|                                           ctx->op.keymgmt.genctx, keydata);
  182|      0|    }
  183|       |
  184|       |    /*
  185|       |     * the returned value from evp_keymgmt_util_gen() is cached in *ppkey,
  186|       |     * so we do not need to save it, just check it.
  187|       |     */
  188|    444|    ret = ret
  ------------------
  |  Branch (188:11): [True: 444, False: 0]
  ------------------
  189|    444|        && (evp_keymgmt_util_gen(*ppkey, ctx->keymgmt, ctx->op.keymgmt.genctx,
  ------------------
  |  Branch (189:12): [True: 444, False: 0]
  ------------------
  190|    444|                                 ossl_callback_to_pkey_gencb, ctx)
  191|    444|            != NULL);
  192|       |
  193|    444|    ctx->keygen_info = NULL;
  194|       |
  195|    444|#ifndef FIPS_MODULE
  196|       |    /* In case |*ppkey| was originally a legacy key */
  197|    444|    if (ret)
  ------------------
  |  Branch (197:9): [True: 444, False: 0]
  ------------------
  198|    444|        evp_pkey_free_legacy(*ppkey);
  199|    444|#endif
  200|       |
  201|       |    /*
  202|       |     * Because we still have legacy keys
  203|       |     */
  204|    444|    (*ppkey)->type = ctx->legacy_keytype;
  205|       |
  206|    444|    goto end;
  207|       |
  208|      0| legacy:
  209|       |#ifdef FIPS_MODULE
  210|       |    goto not_supported;
  211|       |#else
  212|       |    /*
  213|       |     * If we get here then we're using legacy paramgen/keygen. In that case
  214|       |     * the pkey in ctx (if there is one) had better not be provided (because the
  215|       |     * legacy methods may not know how to handle it). However we can only get
  216|       |     * here if ctx->op.keymgmt.genctx == NULL, but that should never be the case
  217|       |     * if ctx->pkey is provided because we don't allow this when we initialise
  218|       |     * the ctx.
  219|       |     */
  220|      0|    if (ctx->pkey != NULL && !ossl_assert(!evp_pkey_is_provided(ctx->pkey)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (220:9): [True: 0, False: 0]
  |  Branch (220:30): [True: 0, False: 0]
  ------------------
  221|      0|        goto not_accessible;
  222|       |
  223|      0|    switch (ctx->operation) {
  224|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (224:5): [True: 0, False: 0]
  ------------------
  225|      0|        ret = ctx->pmeth->paramgen(ctx, *ppkey);
  226|      0|        break;
  227|      0|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (227:5): [True: 0, False: 0]
  ------------------
  228|      0|        ret = ctx->pmeth->keygen(ctx, *ppkey);
  229|      0|        break;
  230|      0|    default:
  ------------------
  |  Branch (230:5): [True: 0, False: 0]
  ------------------
  231|      0|        goto not_supported;
  232|      0|    }
  233|      0|#endif
  234|       |
  235|    444| end:
  236|    444|    if (ret <= 0) {
  ------------------
  |  Branch (236:9): [True: 0, False: 444]
  ------------------
  237|      0|        if (allocated_pkey != NULL)
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|            *ppkey = NULL;
  239|      0|        EVP_PKEY_free(allocated_pkey);
  240|      0|    }
  241|    444|    return ret;
  242|       |
  243|      0| not_supported:
  244|      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)
  |  |  ------------------
  ------------------
  245|      0|    ret = -2;
  246|      0|    goto end;
  247|      0| not_initialized:
  248|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_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)
  |  |  ------------------
  ------------------
  249|      0|    ret = -1;
  250|      0|    goto end;
  251|      0|#ifndef FIPS_MODULE
  252|      0| not_accessible:
  253|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_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)
  |  |  ------------------
  ------------------
  254|      0|    ret = -1;
  255|      0|    goto end;
  256|      0|#endif
  257|      0|}
EVP_PKEY_fromdata_init:
  359|     30|{
  360|     30|    return fromdata_init(ctx, EVP_PKEY_OP_FROMDATA);
  ------------------
  |  | 1747|     30|# define EVP_PKEY_OP_FROMDATA            (1 << 3)
  ------------------
  361|     30|}
EVP_PKEY_fromdata:
  365|     34|{
  366|     34|    void *keydata = NULL;
  367|     34|    EVP_PKEY *allocated_pkey = NULL;
  368|       |
  369|     34|    if (ctx == NULL || (ctx->operation & EVP_PKEY_OP_FROMDATA) == 0) {
  ------------------
  |  | 1747|     34|# define EVP_PKEY_OP_FROMDATA            (1 << 3)
  ------------------
  |  Branch (369:9): [True: 0, False: 34]
  |  Branch (369:24): [True: 4, False: 30]
  ------------------
  370|      4|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  371|      4|        return -2;
  372|      4|    }
  373|       |
  374|     30|    if (ppkey == NULL)
  ------------------
  |  Branch (374:9): [True: 0, False: 30]
  ------------------
  375|      0|        return -1;
  376|       |
  377|     30|    if (*ppkey == NULL)
  ------------------
  |  Branch (377:9): [True: 30, False: 0]
  ------------------
  378|     30|        allocated_pkey = *ppkey = EVP_PKEY_new();
  379|       |
  380|     30|    if (*ppkey == NULL) {
  ------------------
  |  Branch (380:9): [True: 0, False: 30]
  ------------------
  381|      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)
  |  |  ------------------
  ------------------
  382|      0|        return -1;
  383|      0|    }
  384|       |
  385|     30|    keydata = evp_keymgmt_util_fromdata(*ppkey, ctx->keymgmt, selection, params);
  386|     30|    if (keydata == NULL) {
  ------------------
  |  Branch (386:9): [True: 25, False: 5]
  ------------------
  387|     25|        if (allocated_pkey != NULL) {
  ------------------
  |  Branch (387:13): [True: 25, False: 0]
  ------------------
  388|     25|            *ppkey = NULL;
  389|     25|            EVP_PKEY_free(allocated_pkey);
  390|     25|        }
  391|     25|        return 0;
  392|     25|    }
  393|       |    /* keydata is cached in *ppkey, so we need not bother with it further */
  394|      5|    return 1;
  395|     30|}
EVP_PKEY_todata:
  416|      4|{
  417|      4|    if (params == NULL)
  ------------------
  |  Branch (417:9): [True: 0, False: 4]
  ------------------
  418|      0|        return 0;
  419|      4|    return EVP_PKEY_export(pkey, selection, ossl_pkey_todata_cb, params);
  420|      4|}
EVP_PKEY_export:
  440|      4|{
  441|      4|    if (pkey == NULL) {
  ------------------
  |  Branch (441:9): [True: 0, False: 4]
  ------------------
  442|      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)
  |  |  ------------------
  ------------------
  443|      0|        return 0;
  444|      0|    }
  445|      4|#ifndef FIPS_MODULE
  446|      4|    if (evp_pkey_is_legacy(pkey)) {
  ------------------
  |  |  647|      4|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|      4|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|      8|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 4, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  447|      0|        struct fake_import_data_st data;
  448|       |
  449|      0|        data.export_cb = export_cb;
  450|      0|        data.export_cbarg = export_cbarg;
  451|       |
  452|       |        /*
  453|       |         * We don't need to care about libctx or propq here, as we're only
  454|       |         * interested in the resulting OSSL_PARAM array.
  455|       |         */
  456|      0|        return pkey->ameth->export_to(pkey, &data, pkey_fake_import,
  457|      0|                                      NULL, NULL);
  458|      0|    }
  459|      4|#endif
  460|      4|    return evp_keymgmt_util_export(pkey, selection, export_cb, export_cbarg);
  461|      4|}
pmeth_gn.c:gen_init:
   26|    444|{
   27|    444|    int ret = 0;
   28|       |
   29|    444|    if (ctx == NULL)
  ------------------
  |  Branch (29:9): [True: 0, False: 444]
  ------------------
   30|      0|        goto not_supported;
   31|       |
   32|    444|    evp_pkey_ctx_free_old_ops(ctx);
   33|    444|    ctx->operation = operation;
   34|       |
   35|    444|    if (ctx->keymgmt == NULL || ctx->keymgmt->gen_init == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 444]
  |  Branch (35:33): [True: 0, False: 444]
  ------------------
   36|      0|        goto legacy;
   37|       |
   38|    444|    switch (operation) {
  ------------------
  |  Branch (38:13): [True: 0, False: 444]
  ------------------
   39|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (39:5): [True: 0, False: 444]
  ------------------
   40|      0|        ctx->op.keymgmt.genctx =
   41|      0|            evp_keymgmt_gen_init(ctx->keymgmt,
   42|      0|                                 OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, NULL);
  ------------------
  |  |  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
  |  |  ------------------
  ------------------
   43|      0|        break;
   44|    444|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1746|    444|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (44:5): [True: 444, False: 0]
  ------------------
   45|    444|        ctx->op.keymgmt.genctx =
   46|    444|            evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR,
  ------------------
  |  |  650|    444|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    444|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    444|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
   47|    444|                                 NULL);
   48|    444|        break;
   49|    444|    }
   50|       |
   51|    444|    if (ctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (51:9): [True: 0, False: 444]
  ------------------
   52|    444|        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)
  |  |  ------------------
  ------------------
   53|    444|    else
   54|    444|        ret = 1;
   55|    444|    goto end;
   56|       |
   57|      0| legacy:
   58|       |#ifdef FIPS_MODULE
   59|       |    goto not_supported;
   60|       |#else
   61|      0|    if (ctx->pmeth == NULL
  ------------------
  |  Branch (61:9): [True: 0, False: 0]
  ------------------
   62|      0|        || (operation == EVP_PKEY_OP_PARAMGEN
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            && ctx->pmeth->paramgen == NULL)
  ------------------
  |  Branch (63:16): [True: 0, False: 0]
  ------------------
   64|      0|        || (operation == EVP_PKEY_OP_KEYGEN
  ------------------
  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  ------------------
   65|      0|            && ctx->pmeth->keygen == NULL))
  ------------------
  |  Branch (65:16): [True: 0, False: 0]
  ------------------
   66|      0|        goto not_supported;
   67|       |
   68|      0|    ret = 1;
   69|      0|    switch (operation) {
  ------------------
  |  Branch (69:13): [True: 0, False: 0]
  ------------------
   70|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (70:5): [True: 0, False: 0]
  ------------------
   71|      0|        if (ctx->pmeth->paramgen_init != NULL)
  ------------------
  |  Branch (71:13): [True: 0, False: 0]
  ------------------
   72|      0|            ret = ctx->pmeth->paramgen_init(ctx);
   73|      0|        break;
   74|      0|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (74:5): [True: 0, False: 0]
  ------------------
   75|      0|        if (ctx->pmeth->keygen_init != NULL)
  ------------------
  |  Branch (75:13): [True: 0, False: 0]
  ------------------
   76|      0|            ret = ctx->pmeth->keygen_init(ctx);
   77|      0|        break;
   78|      0|    }
   79|      0|#endif
   80|       |
   81|    444| end:
   82|    444|    if (ret <= 0 && ctx != NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 444]
  |  Branch (82:21): [True: 0, False: 0]
  ------------------
   83|      0|        evp_pkey_ctx_free_old_ops(ctx);
   84|      0|        ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
   85|      0|    }
   86|    444|    return ret;
   87|       |
   88|      0| not_supported:
   89|      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)
  |  |  ------------------
  ------------------
   90|      0|    ret = -2;
   91|      0|    goto end;
   92|      0|}
pmeth_gn.c:fromdata_init:
  340|     30|{
  341|     30|    if (ctx == NULL || ctx->keytype == NULL)
  ------------------
  |  Branch (341:9): [True: 0, False: 30]
  |  Branch (341:24): [True: 0, False: 30]
  ------------------
  342|      0|        goto not_supported;
  343|       |
  344|     30|    evp_pkey_ctx_free_old_ops(ctx);
  345|     30|    if (ctx->keymgmt == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 30]
  ------------------
  346|      0|        goto not_supported;
  347|       |
  348|     30|    ctx->operation = operation;
  349|     30|    return 1;
  350|       |
  351|      0| not_supported:
  352|      0|    if (ctx != NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|        ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  354|      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)
  |  |  ------------------
  ------------------
  355|      0|    return -2;
  356|     30|}
pmeth_gn.c:ossl_pkey_todata_cb:
  408|      4|{
  409|      4|    OSSL_PARAM **ret = arg;
  410|       |
  411|      4|    *ret = OSSL_PARAM_dup(params);
  412|      4|    return 1;
  413|      4|}

EVP_PKEY_CTX_new_from_name:
  348|    476|{
  349|    476|    return int_ctx_new(libctx, NULL, NULL, name, propquery, -1);
  350|    476|}
EVP_PKEY_CTX_new_from_pkey:
  354|    384|{
  355|    384|    return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
  356|    384|}
evp_pkey_ctx_free_old_ops:
  359|  1.71k|{
  360|  1.71k|    if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)) {
  ------------------
  |  |  741|  1.71k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|  1.71k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|  1.71k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|  1.71k|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|  1.71k|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|  1.71k|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|  1.71k|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|  1.71k|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|  1.71k|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|  1.71k|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|  1.71k|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|  1.71k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 380, False: 1.33k]
  |  |  ------------------
  ------------------
  361|    380|        if (ctx->op.sig.algctx != NULL && ctx->op.sig.signature != NULL)
  ------------------
  |  Branch (361:13): [True: 380, False: 0]
  |  Branch (361:43): [True: 380, False: 0]
  ------------------
  362|    380|            ctx->op.sig.signature->freectx(ctx->op.sig.algctx);
  363|    380|        EVP_SIGNATURE_free(ctx->op.sig.signature);
  364|    380|        ctx->op.sig.algctx = NULL;
  365|    380|        ctx->op.sig.signature = NULL;
  366|  1.33k|    } else if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) {
  ------------------
  |  |  744|  1.33k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|  1.33k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|  1.33k|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
  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.33k|    } else if (EVP_PKEY_CTX_IS_KEM_OP(ctx)) {
  ------------------
  |  |  756|  1.33k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|  1.33k|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|  1.33k|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|  1.33k|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
  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.33k|    else if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)) {
  ------------------
  |  |  747|  1.33k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|  1.33k|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|  1.33k|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|  1.33k|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
  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.33k|    } else if (EVP_PKEY_CTX_IS_GEN_OP(ctx)) {
  ------------------
  |  |  750|  1.33k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|  1.33k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|  1.33k|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|  1.33k|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 444, False: 888]
  |  |  ------------------
  ------------------
  386|    444|        if (ctx->op.keymgmt.genctx != NULL && ctx->keymgmt != NULL)
  ------------------
  |  Branch (386:13): [True: 444, False: 0]
  |  Branch (386:47): [True: 444, False: 0]
  ------------------
  387|    444|            evp_keymgmt_gen_cleanup(ctx->keymgmt, ctx->op.keymgmt.genctx);
  388|    444|    }
  389|  1.71k|}
EVP_PKEY_CTX_free:
  392|  2.06k|{
  393|  2.06k|    if (ctx == NULL)
  ------------------
  |  Branch (393:9): [True: 1.21k, False: 858]
  ------------------
  394|  1.21k|        return;
  395|    858|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (395:9): [True: 0, False: 858]
  |  Branch (395:23): [True: 0, False: 0]
  ------------------
  396|      0|        ctx->pmeth->cleanup(ctx);
  397|       |
  398|    858|    evp_pkey_ctx_free_old_ops(ctx);
  399|    858|#ifndef FIPS_MODULE
  400|    858|    evp_pkey_ctx_free_all_cached_data(ctx);
  401|    858|#endif
  402|    858|    EVP_KEYMGMT_free(ctx->keymgmt);
  403|       |
  404|    858|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  115|    858|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    858|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    858|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  405|    858|    EVP_PKEY_free(ctx->pkey);
  406|    858|    EVP_PKEY_free(ctx->peerkey);
  407|    858|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  408|    858|    ENGINE_finish(ctx->engine);
  409|    858|#endif
  410|    858|    BN_free(ctx->rsa_pubexp);
  411|    858|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    858|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    858|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    858|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|    858|}
evp_app_cleanup_int:
  633|      1|{
  634|      1|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 1]
  ------------------
  635|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  636|      1|}
evp_pkey_ctx_use_cached_data:
 1547|    380|{
 1548|    380|    int ret = 1;
 1549|       |
 1550|    380|    if (ret && ctx->cached_parameters.dist_id_set) {
  ------------------
  |  Branch (1550:9): [True: 380, False: 0]
  |  Branch (1550:16): [True: 0, False: 380]
  ------------------
 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|    380|    return ret;
 1564|    380|}
pmeth_lib.c:int_ctx_new:
  163|    860|{
  164|    860|    EVP_PKEY_CTX *ret = NULL;
  165|    860|    const EVP_PKEY_METHOD *pmeth = NULL, *app_pmeth = NULL;
  166|    860|    EVP_KEYMGMT *keymgmt = NULL;
  167|       |
  168|       |    /* Code below to be removed when legacy support is dropped. */
  169|       |    /* BEGIN legacy */
  170|    860|    if (id == -1) {
  ------------------
  |  Branch (170:9): [True: 860, False: 0]
  ------------------
  171|    860|        if (pkey != NULL && !evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  649|    384|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (171:13): [True: 384, False: 476]
  |  Branch (171:29): [True: 0, False: 384]
  ------------------
  172|      0|            id = pkey->type;
  173|    860|        } else {
  174|    860|            if (pkey != NULL) {
  ------------------
  |  Branch (174:17): [True: 384, False: 476]
  ------------------
  175|       |                /* Must be provided if we get here */
  176|    384|                keytype = EVP_KEYMGMT_get0_name(pkey->keymgmt);
  177|    384|            }
  178|    860|#ifndef FIPS_MODULE
  179|    860|            if (keytype != NULL) {
  ------------------
  |  Branch (179:17): [True: 860, False: 0]
  ------------------
  180|    860|                id = evp_pkey_name2type(keytype);
  181|    860|                if (id == NID_undef)
  ------------------
  |  |   18|    860|#define NID_undef                       0
  ------------------
  |  Branch (181:21): [True: 860, False: 0]
  ------------------
  182|    860|                    id = -1;
  183|    860|            }
  184|    860|#endif
  185|    860|        }
  186|    860|    }
  187|       |    /* If no ID was found here, we can only resort to find a keymgmt */
  188|    860|    if (id == -1) {
  ------------------
  |  Branch (188:9): [True: 860, False: 0]
  ------------------
  189|    860|#ifndef FIPS_MODULE
  190|       |        /* Using engine with a key without id will not work */
  191|    860|        if (e != NULL) {
  ------------------
  |  Branch (191:13): [True: 0, False: 860]
  ------------------
  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|    860|#endif
  196|    860|        goto common;
  197|    860|    }
  198|       |
  199|      0|#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|      0|    if (e != NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 0]
  ------------------
  209|      0|        keytype = NULL;
  210|      0|    if (e == NULL && (pkey == NULL || pkey->foreign == 0))
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  |  Branch (210:23): [True: 0, False: 0]
  |  Branch (210:39): [True: 0, False: 0]
  ------------------
  211|      0|        keytype = OBJ_nid2sn(id);
  212|       |
  213|      0|# ifndef OPENSSL_NO_ENGINE
  214|      0|    if (e == NULL && pkey != NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 0]
  |  Branch (214:22): [True: 0, False: 0]
  ------------------
  215|      0|        e = pkey->pmeth_engine != NULL ? pkey->pmeth_engine : pkey->engine;
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|       |    /* Try to find an ENGINE which implements this method */
  217|      0|    if (e != NULL) {
  ------------------
  |  Branch (217:9): [True: 0, False: 0]
  ------------------
  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|      0|    } else {
  223|      0|        e = ENGINE_get_pkey_meth_engine(id);
  224|      0|    }
  225|       |
  226|       |    /*
  227|       |     * If an ENGINE handled this method look it up. Otherwise use internal
  228|       |     * tables.
  229|       |     */
  230|      0|    if (e != NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        pmeth = ENGINE_get_pkey_meth(e, id);
  232|      0|    else
  233|      0|# endif /* OPENSSL_NO_ENGINE */
  234|      0|    if (pkey != NULL && pkey->foreign)
  ------------------
  |  Branch (234:9): [True: 0, False: 0]
  |  Branch (234:25): [True: 0, False: 0]
  ------------------
  235|      0|        pmeth = EVP_PKEY_meth_find(id);
  236|      0|    else
  237|      0|        app_pmeth = pmeth = evp_pkey_meth_find_added_by_application(id);
  238|       |
  239|       |    /* END legacy */
  240|      0|#endif /* FIPS_MODULE */
  241|    860| 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|    860|    if (e == NULL && app_pmeth == NULL && keytype != NULL) {
  ------------------
  |  Branch (246:9): [True: 860, False: 0]
  |  Branch (246:22): [True: 860, False: 0]
  |  Branch (246:43): [True: 860, False: 0]
  ------------------
  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|    860|        if (pkey != NULL && pkey->keymgmt != NULL) {
  ------------------
  |  Branch (253:13): [True: 384, False: 476]
  |  Branch (253:29): [True: 384, False: 0]
  ------------------
  254|    384|            if (!EVP_KEYMGMT_up_ref(pkey->keymgmt))
  ------------------
  |  Branch (254:17): [True: 0, False: 384]
  ------------------
  255|    384|                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|    384|            else
  257|    384|                keymgmt = pkey->keymgmt;
  258|    476|        } else {
  259|    476|            keymgmt = EVP_KEYMGMT_fetch(libctx, keytype, propquery);
  260|    476|        }
  261|    860|        if (keymgmt == NULL)
  ------------------
  |  Branch (261:13): [True: 2, False: 858]
  ------------------
  262|      2|            return NULL;   /* EVP_KEYMGMT_fetch() recorded an error */
  263|       |
  264|    858|#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|    858|        if (keymgmt != NULL) {
  ------------------
  |  Branch (272:13): [True: 858, False: 0]
  ------------------
  273|    858|            int tmp_id = evp_keymgmt_get_legacy_alg(keymgmt);
  274|       |
  275|    858|            if (tmp_id != NID_undef) {
  ------------------
  |  |   18|    858|#define NID_undef                       0
  ------------------
  |  Branch (275:17): [True: 0, False: 858]
  ------------------
  276|      0|                if (id == -1) {
  ------------------
  |  Branch (276:21): [True: 0, False: 0]
  ------------------
  277|      0|                    id = tmp_id;
  278|      0|                } else {
  279|       |                    /*
  280|       |                     * It really really shouldn't differ.  If it still does,
  281|       |                     * something is very wrong.
  282|       |                     */
  283|      0|                    if (!ossl_assert(id == tmp_id)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (283:25): [True: 0, False: 0]
  ------------------
  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|      0|                }
  289|      0|            }
  290|    858|        }
  291|    858|#endif
  292|    858|    }
  293|       |
  294|    858|    if (pmeth == NULL && keymgmt == NULL) {
  ------------------
  |  Branch (294:9): [True: 858, False: 0]
  |  Branch (294:26): [True: 0, False: 858]
  ------------------
  295|      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)
  |  |  ------------------
  ------------------
  296|    858|    } else {
  297|    858|        ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|    858|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    858|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    858|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  298|    858|    }
  299|       |
  300|    858|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  301|    858|    if ((ret == NULL || pmeth == NULL) && e != NULL)
  ------------------
  |  Branch (301:10): [True: 0, False: 858]
  |  Branch (301:25): [True: 858, False: 0]
  |  Branch (301:43): [True: 0, False: 858]
  ------------------
  302|      0|        ENGINE_finish(e);
  303|    858|#endif
  304|       |
  305|    858|    if (ret == NULL) {
  ------------------
  |  Branch (305:9): [True: 0, False: 858]
  ------------------
  306|      0|        EVP_KEYMGMT_free(keymgmt);
  307|      0|        return NULL;
  308|      0|    }
  309|    858|    if (propquery != NULL) {
  ------------------
  |  Branch (309:9): [True: 142, False: 716]
  ------------------
  310|    142|        ret->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  119|    142|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    142|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    142|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|    142|        if (ret->propquery == NULL) {
  ------------------
  |  Branch (311:13): [True: 0, False: 142]
  ------------------
  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|    142|    }
  317|    858|    ret->libctx = libctx;
  318|    858|    ret->keytype = keytype;
  319|    858|    ret->keymgmt = keymgmt;
  320|    858|    ret->legacy_keytype = id;
  321|    858|    ret->engine = e;
  322|    858|    ret->pmeth = pmeth;
  323|    858|    ret->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|    858|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  324|       |
  325|    858|    if (pkey != NULL && !EVP_PKEY_up_ref(pkey)) {
  ------------------
  |  Branch (325:9): [True: 384, False: 474]
  |  Branch (325:25): [True: 0, False: 384]
  ------------------
  326|      0|        EVP_PKEY_CTX_free(ret);
  327|      0|        return NULL;
  328|      0|    }
  329|       |
  330|    858|    ret->pkey = pkey;
  331|       |
  332|    858|    if (pmeth != NULL && pmeth->init != NULL) {
  ------------------
  |  Branch (332:9): [True: 0, False: 858]
  |  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|    858|    return ret;
  341|    858|}
pmeth_lib.c:decode_cmd:
 1443|    858|{
 1444|    858|    if (cmd == -1) {
  ------------------
  |  Branch (1444:9): [True: 0, False: 858]
  ------------------
 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|    858|    return cmd;
 1456|    858|}
pmeth_lib.c:evp_pkey_ctx_free_cached_data:
 1529|    858|{
 1530|    858|    cmd = decode_cmd(cmd, name);
 1531|    858|    switch (cmd) {
  ------------------
  |  Branch (1531:13): [True: 0, False: 858]
  ------------------
 1532|    858|    case EVP_PKEY_CTRL_SET1_ID:
  ------------------
  |  | 1807|    858|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
  |  Branch (1532:5): [True: 858, False: 0]
  ------------------
 1533|    858|        OPENSSL_free(ctx->cached_parameters.dist_id);
  ------------------
  |  |  115|    858|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    858|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    858|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1534|    858|        OPENSSL_free(ctx->cached_parameters.dist_id_name);
  ------------------
  |  |  115|    858|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    858|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    858|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1535|    858|        ctx->cached_parameters.dist_id = NULL;
 1536|    858|        ctx->cached_parameters.dist_id_name = NULL;
 1537|    858|        break;
 1538|    858|    }
 1539|    858|}
pmeth_lib.c:evp_pkey_ctx_free_all_cached_data:
 1542|    858|{
 1543|    858|    evp_pkey_ctx_free_cached_data(ctx, EVP_PKEY_CTRL_SET1_ID, NULL);
  ------------------
  |  | 1807|    858|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
 1544|    858|}

EVP_SIGNATURE_free:
  460|    836|{
  461|    836|    int i;
  462|       |
  463|    836|    if (signature == NULL)
  ------------------
  |  Branch (463:9): [True: 213, False: 623]
  ------------------
  464|    213|        return;
  465|    623|    CRYPTO_DOWN_REF(&signature->refcnt, &i);
  466|    623|    if (i > 0)
  ------------------
  |  Branch (466:9): [True: 564, False: 59]
  ------------------
  467|    564|        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|    564|{
  476|    564|    int ref = 0;
  477|       |
  478|    564|    CRYPTO_UP_REF(&signature->refcnt, &ref);
  479|    564|    return 1;
  480|    564|}
EVP_SIGNATURE_get0_provider:
  483|    380|{
  484|    380|    return signature->prov;
  485|    380|}
EVP_SIGNATURE_fetch:
  489|    261|{
  490|    261|    return evp_generic_fetch(ctx, OSSL_OP_SIGNATURE, algorithm, properties,
  ------------------
  |  |  317|    261|# define OSSL_OP_SIGNATURE                          12
  ------------------
  491|    261|                             evp_signature_from_algorithm,
  492|    261|                             evp_signature_up_ref,
  493|    261|                             evp_signature_free);
  494|    261|}
EVP_SIGNATURE_is_a:
  508|    238|{
  509|    238|    return signature != NULL
  ------------------
  |  Branch (509:12): [True: 238, False: 0]
  ------------------
  510|    238|           && evp_is_a(signature->prov, signature->name_id, NULL, name);
  ------------------
  |  Branch (510:15): [True: 238, False: 0]
  ------------------
  511|    238|}
EVP_PKEY_sign_message_init:
  927|    119|{
  928|    119|    return evp_pkey_signature_init(ctx, algo, EVP_PKEY_OP_SIGNMSG, params);
  ------------------
  |  | 1758|    119|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  929|    119|}
EVP_PKEY_sign:
  999|    238|{
 1000|    238|    EVP_SIGNATURE *signature;
 1001|    238|    const char *desc;
 1002|    238|    int ret;
 1003|       |
 1004|    238|    if (ctx == NULL) {
  ------------------
  |  Branch (1004:9): [True: 0, False: 238]
  ------------------
 1005|      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)
  |  |  ------------------
  ------------------
 1006|      0|        return -1;
 1007|      0|    }
 1008|       |
 1009|    238|    if (ctx->operation != EVP_PKEY_OP_SIGN
  ------------------
  |  | 1748|    476|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (1009:9): [True: 238, False: 0]
  ------------------
 1010|    238|        && ctx->operation != EVP_PKEY_OP_SIGNMSG) {
  ------------------
  |  | 1758|    238|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  |  Branch (1010:12): [True: 0, False: 238]
  ------------------
 1011|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_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)
  |  |  ------------------
  ------------------
 1012|      0|        return -1;
 1013|      0|    }
 1014|       |
 1015|    238|    if (ctx->op.sig.algctx == NULL)
  ------------------
  |  Branch (1015:9): [True: 0, False: 238]
  ------------------
 1016|      0|        goto legacy;
 1017|       |
 1018|    238|    signature = ctx->op.sig.signature;
 1019|    238|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (1019:12): [True: 0, False: 238]
  ------------------
 1020|    238|    if (signature->sign == NULL) {
  ------------------
  |  Branch (1020:9): [True: 0, False: 238]
  ------------------
 1021|      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
  ------------------
 1022|      0|                       "%s sign:%s", signature->type_name, desc);
 1023|      0|        return -2;
 1024|      0|    }
 1025|       |
 1026|    238|    ret = signature->sign(ctx->op.sig.algctx, sig, siglen,
 1027|    238|                          (sig == NULL) ? 0 : *siglen, tbs, tbslen);
  ------------------
  |  Branch (1027:27): [True: 119, False: 119]
  ------------------
 1028|    238|    if (ret <= 0)
  ------------------
  |  Branch (1028:9): [True: 0, False: 238]
  ------------------
 1029|      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
  ------------------
 1030|      0|                       "%s sign:%s", signature->type_name, desc);
 1031|    238|    return ret;
 1032|      0| legacy:
 1033|       |
 1034|      0|    if (ctx->pmeth == NULL || ctx->pmeth->sign == NULL) {
  ------------------
  |  Branch (1034:9): [True: 0, False: 0]
  |  Branch (1034:31): [True: 0, False: 0]
  ------------------
 1035|      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)
  |  |  ------------------
  ------------------
 1036|      0|        return -2;
 1037|      0|    }
 1038|       |
 1039|      0|    M_check_autoarg(ctx, sig, siglen, EVP_F_EVP_PKEY_SIGN)
  ------------------
  |  |  389|      0|    if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) {           \
  |  |  ------------------
  |  |  |  | 1813|      0|# define EVP_PKEY_FLAG_AUTOARGLEN        2
  |  |  ------------------
  |  |  |  Branch (389:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  390|      0|        size_t pksize = (size_t)EVP_PKEY_get_size(ctx->pkey);         \
  |  |  391|      0|                                                                  \
  |  |  392|      0|        if (pksize == 0) {                                        \
  |  |  ------------------
  |  |  |  Branch (392:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  393|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY); /*ckerr_ignore*/ \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  394|      0|            return 0;                                             \
  |  |  395|      0|        }                                                         \
  |  |  396|      0|        if (arg == NULL) {                                        \
  |  |  ------------------
  |  |  |  Branch (396:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  397|      0|            *arglen = pksize;                                     \
  |  |  398|      0|            return 1;                                             \
  |  |  399|      0|        }                                                         \
  |  |  400|      0|        if (*arglen < pksize) {                                   \
  |  |  ------------------
  |  |  |  Branch (400:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  401|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/ \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  402|      0|            return 0;                                             \
  |  |  403|      0|        }                                                         \
  |  |  404|      0|    }
  ------------------
 1040|      0|        return ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen);
 1041|      0|}
EVP_PKEY_verify_message_init:
 1061|    119|{
 1062|    119|    return evp_pkey_signature_init(ctx, algo, EVP_PKEY_OP_VERIFYMSG, params);
  ------------------
  |  | 1759|    119|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
 1063|    119|}
EVP_PKEY_verify:
 1153|    119|{
 1154|    119|    EVP_SIGNATURE *signature;
 1155|    119|    const char *desc;
 1156|    119|    int ret;
 1157|       |
 1158|    119|    if (ctx == NULL) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 119]
  ------------------
 1159|      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)
  |  |  ------------------
  ------------------
 1160|      0|        return -1;
 1161|      0|    }
 1162|       |
 1163|    119|    if (ctx->operation != EVP_PKEY_OP_VERIFY
  ------------------
  |  | 1749|    238|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (1163:9): [True: 119, False: 0]
  ------------------
 1164|    119|        && ctx->operation != EVP_PKEY_OP_VERIFYMSG) {
  ------------------
  |  | 1759|    119|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (1164:12): [True: 0, False: 119]
  ------------------
 1165|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_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)
  |  |  ------------------
  ------------------
 1166|      0|        return -1;
 1167|      0|    }
 1168|       |
 1169|    119|    if (ctx->op.sig.algctx == NULL)
  ------------------
  |  Branch (1169:9): [True: 0, False: 119]
  ------------------
 1170|      0|        goto legacy;
 1171|       |
 1172|    119|    signature = ctx->op.sig.signature;
 1173|    119|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (1173:12): [True: 0, False: 119]
  ------------------
 1174|    119|    if (signature->verify == NULL) {
  ------------------
  |  Branch (1174:9): [True: 0, False: 119]
  ------------------
 1175|      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
  ------------------
 1176|      0|                       "%s verify:%s", signature->type_name, desc);
 1177|      0|        return -2;
 1178|      0|    }
 1179|       |
 1180|    119|    ret = ctx->op.sig.signature->verify(ctx->op.sig.algctx, sig, siglen,
 1181|    119|                                        tbs, tbslen);
 1182|    119|    if (ret <= 0)
  ------------------
  |  Branch (1182:9): [True: 0, False: 119]
  ------------------
 1183|      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
  ------------------
 1184|      0|                       "%s verify:%s", signature->type_name, desc);
 1185|       |
 1186|    119|    return ret;
 1187|      0| legacy:
 1188|      0|    if (ctx->pmeth == NULL || ctx->pmeth->verify == NULL) {
  ------------------
  |  Branch (1188:9): [True: 0, False: 0]
  |  Branch (1188:31): [True: 0, False: 0]
  ------------------
 1189|      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)
  |  |  ------------------
  ------------------
 1190|      0|        return -2;
 1191|      0|    }
 1192|       |
 1193|      0|    return ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen);
 1194|      0|}
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|    326|{
   30|    326|    return EVP_SIGNATURE_up_ref(data);
   31|    326|}
signature.c:evp_signature_free:
   24|    124|{
   25|    124|    EVP_SIGNATURE_free(data);
   26|    124|}
signature.c:evp_pkey_signature_init:
  575|    238|{
  576|    238|    const char *desc;
  577|    238|    int ret = 0;
  578|    238|    void *provkey = NULL;
  579|    238|    EVP_KEYMGMT *tmp_keymgmt = NULL;
  580|    238|    const OSSL_PROVIDER *tmp_prov = NULL;
  581|    238|    const char *supported_sig = NULL;
  582|    238|    int iter;
  583|       |
  584|    238|    if (ctx == NULL) {
  ------------------
  |  Branch (584:9): [True: 0, False: 238]
  ------------------
  585|      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)
  |  |  ------------------
  ------------------
  586|      0|        return -1;
  587|      0|    }
  588|       |
  589|    238|    evp_pkey_ctx_free_old_ops(ctx);
  590|    238|    ctx->operation = operation;
  591|       |
  592|    238|    if (signature != NULL) {
  ------------------
  |  Branch (592:9): [True: 238, False: 0]
  ------------------
  593|       |        /*
  594|       |         * It's important to figure out what the key type should be, and if
  595|       |         * that is what we have in ctx.
  596|       |         */
  597|       |
  598|    238|        EVP_KEYMGMT *tmp_keymgmt_tofree = NULL;
  599|       |
  600|    238|        if (ctx->pkey == NULL) {
  ------------------
  |  Branch (600:13): [True: 0, False: 238]
  ------------------
  601|      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)
  |  |  ------------------
  ------------------
  602|      0|            goto err;
  603|      0|        }
  604|       |
  605|       |        /*
  606|       |         * Ensure that the key is provided, either natively, or as a
  607|       |         * cached export.  We start by fetching the keymgmt with the same
  608|       |         * name as |ctx->pkey|, but from the provider of the signature
  609|       |         * method, using the same property query as when fetching the
  610|       |         * signature method.  With the keymgmt we found (if we did), we
  611|       |         * try to export |ctx->pkey| to it (evp_pkey_export_to_provider()
  612|       |         * is smart enough to only actually export it if |tmp_keymgmt|
  613|       |         * is different from |ctx->pkey|'s keymgmt)
  614|       |         */
  615|    238|        tmp_prov = EVP_SIGNATURE_get0_provider(signature);
  616|    238|        tmp_keymgmt_tofree = tmp_keymgmt =
  617|    238|            evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  618|    238|                                        EVP_KEYMGMT_get0_name(ctx->keymgmt),
  619|    238|                                        ctx->propquery);
  620|    238|        if (tmp_keymgmt != NULL)
  ------------------
  |  Branch (620:13): [True: 238, False: 0]
  ------------------
  621|    238|            provkey = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  622|    238|                                                  &tmp_keymgmt, ctx->propquery);
  623|    238|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (623:13): [True: 0, False: 238]
  ------------------
  624|      0|            EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  625|       |
  626|    238|        if (provkey == NULL)
  ------------------
  |  Branch (626:13): [True: 0, False: 238]
  ------------------
  627|      0|            goto end;
  628|       |
  629|       |        /*
  630|       |         * Check that the signature matches the given key.  This is not
  631|       |         * designed to work with legacy keys, so has to be done after we've
  632|       |         * ensured that the key is at least exported to a provider (above).
  633|       |         */
  634|    238|        if (signature->query_key_types != NULL) {
  ------------------
  |  Branch (634:13): [True: 0, False: 238]
  ------------------
  635|       |            /* This is expected to be a NULL-terminated array */
  636|      0|            const char **keytypes;
  637|       |
  638|      0|            keytypes = signature->query_key_types();
  639|      0|            for (; *keytypes != NULL; keytypes++)
  ------------------
  |  Branch (639:20): [True: 0, False: 0]
  ------------------
  640|      0|                if (EVP_PKEY_CTX_is_a(ctx, *keytypes))
  ------------------
  |  Branch (640:21): [True: 0, False: 0]
  ------------------
  641|      0|                    break;
  642|      0|            if (*keytypes == NULL) {
  ------------------
  |  Branch (642:17): [True: 0, False: 0]
  ------------------
  643|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|      0|                return -2;
  645|      0|            }
  646|    238|        } else {
  647|       |            /*
  648|       |             * Fallback 1:
  649|       |             * check if the keytype is the same as the signature algorithm name
  650|       |             */
  651|    238|            const char *keytype = EVP_KEYMGMT_get0_name(ctx->keymgmt);
  652|    238|            int ok = EVP_SIGNATURE_is_a(signature, keytype);
  653|       |
  654|       |            /*
  655|       |             * Fallback 2:
  656|       |             * query the pkey for a default signature algorithm name, and check
  657|       |             * if it matches the signature implementation
  658|       |             */
  659|    238|            if (!ok) {
  ------------------
  |  Branch (659:17): [True: 0, False: 238]
  ------------------
  660|      0|                const char *signame
  661|      0|                    = evp_keymgmt_util_query_operation_name(ctx->keymgmt,
  662|      0|                                                            OSSL_OP_SIGNATURE);
  ------------------
  |  |  317|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  663|       |
  664|      0|                ok = EVP_SIGNATURE_is_a(signature, signame);
  665|      0|            }
  666|       |
  667|       |            /* If none of the fallbacks helped, we're lost */
  668|    238|            if (!ok) {
  ------------------
  |  Branch (668:17): [True: 0, False: 238]
  ------------------
  669|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|                return -2;
  671|      0|            }
  672|    238|        }
  673|       |
  674|    238|        if (!EVP_SIGNATURE_up_ref(signature))
  ------------------
  |  Branch (674:13): [True: 0, False: 238]
  ------------------
  675|      0|            return 0;
  676|    238|    } else {
  677|       |        /* Without a pre-fetched signature, it must be figured out somehow */
  678|      0|        ERR_set_mark();
  679|       |
  680|      0|        if (evp_pkey_ctx_is_legacy(ctx))
  ------------------
  |  |   36|      0|    ((ctx)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  681|      0|            goto legacy;
  682|       |
  683|      0|        if (ctx->pkey == NULL) {
  ------------------
  |  Branch (683:13): [True: 0, False: 0]
  ------------------
  684|      0|            ERR_clear_last_mark();
  685|      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)
  |  |  ------------------
  ------------------
  686|      0|            goto err;
  687|      0|        }
  688|       |
  689|       |        /*
  690|       |         * Try to derive the supported signature from |ctx->keymgmt|.
  691|       |         */
  692|      0|        if (!ossl_assert(ctx->pkey->keymgmt == NULL
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (692:13): [True: 0, False: 0]
  ------------------
  693|      0|                         || ctx->pkey->keymgmt == ctx->keymgmt)) {
  694|      0|            ERR_clear_last_mark();
  695|      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)
  |  |  ------------------
  ------------------
  696|      0|            goto err;
  697|      0|        }
  698|      0|        supported_sig
  699|      0|            = evp_keymgmt_util_query_operation_name(ctx->keymgmt,
  700|      0|                                                    OSSL_OP_SIGNATURE);
  ------------------
  |  |  317|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  701|      0|        if (supported_sig == NULL) {
  ------------------
  |  Branch (701:13): [True: 0, False: 0]
  ------------------
  702|      0|            ERR_clear_last_mark();
  703|      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)
  |  |  ------------------
  ------------------
  704|      0|            goto err;
  705|      0|        }
  706|       |
  707|       |        /*
  708|       |         * We perform two iterations:
  709|       |         *
  710|       |         * 1.  Do the normal signature fetch, using the fetching data given by
  711|       |         *     the EVP_PKEY_CTX.
  712|       |         * 2.  Do the provider specific signature fetch, from the same provider
  713|       |         *     as |ctx->keymgmt|
  714|       |         *
  715|       |         * We then try to fetch the keymgmt from the same provider as the
  716|       |         * signature, and try to export |ctx->pkey| to that keymgmt (when
  717|       |         * this keymgmt happens to be the same as |ctx->keymgmt|, the export
  718|       |         * is a no-op, but we call it anyway to not complicate the code even
  719|       |         * more).
  720|       |         * If the export call succeeds (returns a non-NULL provider key pointer),
  721|       |         * we're done and can perform the operation itself.  If not, we perform
  722|       |         * the second iteration, or jump to legacy.
  723|       |         */
  724|      0|        for (iter = 1; iter < 3 && provkey == NULL; iter++) {
  ------------------
  |  Branch (724:24): [True: 0, False: 0]
  |  Branch (724:36): [True: 0, False: 0]
  ------------------
  725|      0|            EVP_KEYMGMT *tmp_keymgmt_tofree = NULL;
  726|       |
  727|       |            /*
  728|       |             * If we're on the second iteration, free the results from the first.
  729|       |             * They are NULL on the first iteration, so no need to check what
  730|       |             * iteration we're on.
  731|       |             */
  732|      0|            EVP_SIGNATURE_free(signature);
  733|      0|            EVP_KEYMGMT_free(tmp_keymgmt);
  734|       |
  735|      0|            switch (iter) {
  ------------------
  |  Branch (735:21): [True: 0, False: 0]
  ------------------
  736|      0|            case 1:
  ------------------
  |  Branch (736:13): [True: 0, False: 0]
  ------------------
  737|      0|                signature =
  738|      0|                    EVP_SIGNATURE_fetch(ctx->libctx, supported_sig, ctx->propquery);
  739|      0|                if (signature != NULL)
  ------------------
  |  Branch (739:21): [True: 0, False: 0]
  ------------------
  740|      0|                    tmp_prov = EVP_SIGNATURE_get0_provider(signature);
  741|      0|                break;
  742|      0|            case 2:
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      0|                tmp_prov = EVP_KEYMGMT_get0_provider(ctx->keymgmt);
  744|      0|                signature =
  745|      0|                    evp_signature_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  746|      0|                                                  supported_sig, ctx->propquery);
  747|      0|                if (signature == NULL)
  ------------------
  |  Branch (747:21): [True: 0, False: 0]
  ------------------
  748|      0|                    goto legacy;
  749|      0|                break;
  750|      0|            }
  751|      0|            if (signature == NULL)
  ------------------
  |  Branch (751:17): [True: 0, False: 0]
  ------------------
  752|      0|                continue;
  753|       |
  754|       |            /*
  755|       |             * Ensure that the key is provided, either natively, or as a
  756|       |             * cached export.  We start by fetching the keymgmt with the same
  757|       |             * name as |ctx->pkey|, but from the provider of the signature
  758|       |             * method, using the same property query as when fetching the
  759|       |             * signature method.  With the keymgmt we found (if we did), we
  760|       |             * try to export |ctx->pkey| to it (evp_pkey_export_to_provider()
  761|       |             * is smart enough to only actually export it if |tmp_keymgmt|
  762|       |             * is different from |ctx->pkey|'s keymgmt)
  763|       |             */
  764|      0|            tmp_keymgmt_tofree = tmp_keymgmt =
  765|      0|                evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  766|      0|                                            EVP_KEYMGMT_get0_name(ctx->keymgmt),
  767|      0|                                            ctx->propquery);
  768|      0|            if (tmp_keymgmt != NULL)
  ------------------
  |  Branch (768:17): [True: 0, False: 0]
  ------------------
  769|      0|                provkey = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  770|      0|                                                      &tmp_keymgmt, ctx->propquery);
  771|      0|            if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (771:17): [True: 0, False: 0]
  ------------------
  772|      0|                EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  773|      0|        }
  774|       |
  775|      0|        if (provkey == NULL) {
  ------------------
  |  Branch (775:13): [True: 0, False: 0]
  ------------------
  776|      0|            EVP_SIGNATURE_free(signature);
  777|      0|            goto legacy;
  778|      0|        }
  779|       |
  780|      0|        ERR_pop_to_mark();
  781|      0|    }
  782|       |
  783|       |    /* No more legacy from here down to legacy: */
  784|       |
  785|    238|    ctx->op.sig.signature = signature;
  786|    238|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (786:12): [True: 0, False: 238]
  ------------------
  787|       |
  788|    238|    ctx->op.sig.algctx =
  789|    238|        signature->newctx(ossl_provider_ctx(signature->prov), ctx->propquery);
  790|    238|    if (ctx->op.sig.algctx == NULL) {
  ------------------
  |  Branch (790:9): [True: 0, False: 238]
  ------------------
  791|       |        /* The provider key can stay in the cache */
  792|      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)
  |  |  ------------------
  ------------------
  793|      0|        goto err;
  794|      0|    }
  795|       |
  796|    238|    switch (operation) {
  797|      0|    case EVP_PKEY_OP_SIGN:
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (797:5): [True: 0, False: 238]
  ------------------
  798|      0|        if (signature->sign_init == NULL) {
  ------------------
  |  Branch (798:13): [True: 0, False: 0]
  ------------------
  799|      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
  ------------------
  800|      0|                           "%s sign_init:%s", signature->type_name, desc);
  801|      0|            ret = -2;
  802|      0|            goto err;
  803|      0|        }
  804|      0|        ret = signature->sign_init(ctx->op.sig.algctx, provkey, params);
  805|      0|        break;
  806|    119|    case EVP_PKEY_OP_SIGNMSG:
  ------------------
  |  | 1758|    119|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  |  Branch (806:5): [True: 119, False: 119]
  ------------------
  807|    119|        if (signature->sign_message_init == NULL) {
  ------------------
  |  Branch (807:13): [True: 0, False: 119]
  ------------------
  808|      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
  ------------------
  809|      0|                           "%s sign_message_init:%s", signature->type_name, desc);
  810|      0|            ret = -2;
  811|      0|            goto err;
  812|      0|        }
  813|    119|        ret = signature->sign_message_init(ctx->op.sig.algctx, provkey, params);
  814|    119|        break;
  815|      0|    case EVP_PKEY_OP_VERIFY:
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (815:5): [True: 0, False: 238]
  ------------------
  816|      0|        if (signature->verify_init == NULL) {
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      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
  ------------------
  818|      0|                           "%s verify_init:%s", signature->type_name, desc);
  819|      0|            ret = -2;
  820|      0|            goto err;
  821|      0|        }
  822|      0|        ret = signature->verify_init(ctx->op.sig.algctx, provkey, params);
  823|      0|        break;
  824|    119|    case EVP_PKEY_OP_VERIFYMSG:
  ------------------
  |  | 1759|    119|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (824:5): [True: 119, False: 119]
  ------------------
  825|    119|        if (signature->verify_message_init == NULL) {
  ------------------
  |  Branch (825:13): [True: 0, False: 119]
  ------------------
  826|      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
  ------------------
  827|      0|                           "%s verify_message_init:%s", signature->type_name, desc);
  828|      0|            ret = -2;
  829|      0|            goto err;
  830|      0|        }
  831|    119|        ret = signature->verify_message_init(ctx->op.sig.algctx, provkey, params);
  832|    119|        break;
  833|      0|    case EVP_PKEY_OP_VERIFYRECOVER:
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (833:5): [True: 0, False: 238]
  ------------------
  834|      0|        if (signature->verify_recover_init == NULL) {
  ------------------
  |  Branch (834:13): [True: 0, False: 0]
  ------------------
  835|      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
  ------------------
  836|      0|                           "%s verify_recover_init:%s", signature->type_name, desc);
  837|      0|            ret = -2;
  838|      0|            goto err;
  839|      0|        }
  840|      0|        ret = signature->verify_recover_init(ctx->op.sig.algctx, provkey, params);
  841|      0|        break;
  842|      0|    default:
  ------------------
  |  Branch (842:5): [True: 0, False: 238]
  ------------------
  843|      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)
  |  |  ------------------
  ------------------
  844|      0|        goto err;
  845|    238|    }
  846|       |
  847|    238|    if (ret <= 0) {
  ------------------
  |  Branch (847:9): [True: 0, False: 238]
  ------------------
  848|      0|        signature->freectx(ctx->op.sig.algctx);
  849|      0|        ctx->op.sig.algctx = NULL;
  850|      0|        goto err;
  851|      0|    }
  852|    238|    goto end;
  853|       |
  854|    238| legacy:
  855|       |    /*
  856|       |     * If we don't have the full support we need with provided methods,
  857|       |     * let's go see if legacy does.
  858|       |     */
  859|      0|    ERR_pop_to_mark();
  860|      0|    EVP_KEYMGMT_free(tmp_keymgmt);
  861|      0|    tmp_keymgmt = NULL;
  862|       |
  863|      0|    if (ctx->pmeth == NULL
  ------------------
  |  Branch (863:9): [True: 0, False: 0]
  ------------------
  864|      0|            || (operation == EVP_PKEY_OP_SIGN && ctx->pmeth->sign == NULL)
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  |  Branch (864:50): [True: 0, False: 0]
  ------------------
  865|      0|            || (operation == EVP_PKEY_OP_VERIFY && ctx->pmeth->verify == NULL)
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (865:17): [True: 0, False: 0]
  |  Branch (865:52): [True: 0, False: 0]
  ------------------
  866|      0|            || (operation == EVP_PKEY_OP_VERIFYRECOVER
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (866:17): [True: 0, False: 0]
  ------------------
  867|      0|                && ctx->pmeth->verify_recover == NULL)) {
  ------------------
  |  Branch (867:20): [True: 0, False: 0]
  ------------------
  868|      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)
  |  |  ------------------
  ------------------
  869|      0|        return -2;
  870|      0|    }
  871|       |
  872|      0|    switch (operation) {
  873|      0|    case EVP_PKEY_OP_SIGN:
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (873:5): [True: 0, False: 0]
  ------------------
  874|      0|        if (ctx->pmeth->sign_init == NULL)
  ------------------
  |  Branch (874:13): [True: 0, False: 0]
  ------------------
  875|      0|            return 1;
  876|      0|        ret = ctx->pmeth->sign_init(ctx);
  877|      0|        break;
  878|      0|    case EVP_PKEY_OP_VERIFY:
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (878:5): [True: 0, False: 0]
  ------------------
  879|      0|        if (ctx->pmeth->verify_init == NULL)
  ------------------
  |  Branch (879:13): [True: 0, False: 0]
  ------------------
  880|      0|            return 1;
  881|      0|        ret = ctx->pmeth->verify_init(ctx);
  882|      0|        break;
  883|      0|    case EVP_PKEY_OP_VERIFYRECOVER:
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (883:5): [True: 0, False: 0]
  ------------------
  884|      0|        if (ctx->pmeth->verify_recover_init == NULL)
  ------------------
  |  Branch (884:13): [True: 0, False: 0]
  ------------------
  885|      0|            return 1;
  886|      0|        ret = ctx->pmeth->verify_recover_init(ctx);
  887|      0|        break;
  888|      0|    default:
  ------------------
  |  Branch (888:5): [True: 0, False: 0]
  ------------------
  889|      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)
  |  |  ------------------
  ------------------
  890|      0|        goto err;
  891|      0|    }
  892|      0|    if (ret <= 0)
  ------------------
  |  Branch (892:9): [True: 0, False: 0]
  ------------------
  893|      0|        goto err;
  894|    238| end:
  895|    238|#ifndef FIPS_MODULE
  896|    238|    if (ret > 0)
  ------------------
  |  Branch (896:9): [True: 238, False: 0]
  ------------------
  897|    238|        ret = evp_pkey_ctx_use_cached_data(ctx);
  898|    238|#endif
  899|       |
  900|    238|    EVP_KEYMGMT_free(tmp_keymgmt);
  901|    238|    return ret;
  902|      0| err:
  903|      0|    evp_pkey_ctx_free_old_ops(ctx);
  904|      0|    ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  905|      0|    EVP_KEYMGMT_free(tmp_keymgmt);
  906|      0|    return ret;
  907|      0|}

ossl_do_ex_data_init:
   15|      1|{
   16|      1|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      1|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 1]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      1|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      1|    return global->ex_data_lock != NULL;
   23|      1|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      1|{
   74|      1|    int i;
   75|      1|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      1|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1]
  ------------------
   78|      0|        return;
   79|       |
   80|     19|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  248|     19|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (80:17): [True: 18, False: 1]
  ------------------
   81|     18|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|     18|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|     18|        ip->meth = NULL;
   85|     18|    }
   86|       |
   87|      1|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|      1|    global->ex_data_lock = NULL;
   89|      1|}
ossl_crypto_new_ex_data_ex:
  221|    474|{
  222|    474|    int mx, i;
  223|    474|    void *ptr;
  224|    474|    EX_CALLBACK **storage = NULL;
  225|    474|    EX_CALLBACK *stack[10];
  226|    474|    EX_CALLBACKS *ip;
  227|    474|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|    474|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 474]
  ------------------
  230|      0|        return 0;
  231|       |
  232|    474|    ip = get_and_lock(global, class_index, 1);
  233|    474|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 474]
  ------------------
  234|      0|        return 0;
  235|       |
  236|    474|    ad->ctx = ctx;
  237|    474|    ad->sk = NULL;
  238|    474|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|    474|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 474]
  ------------------
  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|    474|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|    474|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 474]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|    474|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 474]
  ------------------
  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|    474|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 474, False: 0]
  ------------------
  260|    474|        OPENSSL_free(storage);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|    474|    return 1;
  262|    474|}
CRYPTO_new_ex_data:
  265|    474|{
  266|    474|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|    474|}
CRYPTO_free_ex_data:
  368|    474|{
  369|    474|    int mx, i;
  370|    474|    EX_CALLBACKS *ip;
  371|    474|    void *ptr;
  372|    474|    const EX_CALLBACK *f;
  373|    474|    struct ex_callback_entry stack[10];
  374|    474|    struct ex_callback_entry *storage = NULL;
  375|    474|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|    474|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 474]
  ------------------
  378|      0|        goto err;
  379|       |
  380|    474|    ip = get_and_lock(global, class_index, 1);
  381|    474|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 474]
  ------------------
  382|      0|        goto err;
  383|       |
  384|    474|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|    474|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 474]
  ------------------
  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|    474|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|    474|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 474]
  ------------------
  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|    474|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 474, False: 0]
  ------------------
  412|    474|        OPENSSL_free(storage);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|    474| err:
  414|    474|    sk_void_free(ad->sk);
  ------------------
  |  |  204|    474|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|    474|    ad->sk = NULL;
  416|    474|    ad->ctx = NULL;
  417|    474|}
ex_data.c:get_and_lock:
   33|    948|{
   34|    948|    EX_CALLBACKS *ip;
   35|       |
   36|    948|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  248|    948|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 948]
  |  Branch (36:28): [True: 0, False: 948]
  ------------------
   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|    948|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 948]
  ------------------
   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|    948|    if (read) {
  ------------------
  |  Branch (49:9): [True: 948, False: 0]
  ------------------
   50|    948|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 948]
  ------------------
   51|      0|            return NULL;
   52|    948|    } else {
   53|      0|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  ------------------
   54|      0|            return NULL;
   55|      0|    }
   56|       |
   57|    948|    ip = &global->ex_data[class_index];
   58|    948|    return ip;
   59|    948|}

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

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

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

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

ossl_indicator_set_callback_new:
   22|      1|{
   23|      1|    INDICATOR_CB *cb;
   24|       |
   25|      1|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   26|      1|    return cb;
   27|      1|}
ossl_indicator_set_callback_free:
   30|      1|{
   31|      1|    OPENSSL_free(cb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   32|      1|}

OPENSSL_cleanup:
  378|      1|{
  379|      1|    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|      1|    if (!base_inited)
  ------------------
  |  Branch (387:9): [True: 0, False: 1]
  ------------------
  388|      0|        return;
  389|       |
  390|       |    /* Might be explicitly called and also by atexit */
  391|      1|    if (stopped)
  ------------------
  |  Branch (391:9): [True: 0, False: 1]
  ------------------
  392|      0|        return;
  393|      1|    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|      1|    OPENSSL_thread_stop();
  400|       |
  401|      1|    currhandler = stop_handlers;
  402|      1|    while (currhandler != NULL) {
  ------------------
  |  Branch (402:12): [True: 0, False: 1]
  ------------------
  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|      1|    stop_handlers = NULL;
  409|       |
  410|      1|    CRYPTO_THREAD_lock_free(optsdone_lock);
  411|      1|    optsdone_lock = NULL;
  412|      1|    CRYPTO_THREAD_lock_free(init_lock);
  413|      1|    init_lock = NULL;
  414|       |
  415|      1|    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|      1|#ifndef OPENSSL_NO_COMP
  423|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  424|      1|    ossl_comp_zlib_cleanup();
  425|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  426|      1|    ossl_comp_brotli_cleanup();
  427|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  428|      1|    ossl_comp_zstd_cleanup();
  429|      1|#endif
  430|       |
  431|      1|    if (async_inited) {
  ------------------
  |  Branch (431:9): [True: 0, False: 1]
  ------------------
  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|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      1|    ossl_rand_cleanup_int();
  449|       |
  450|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  451|      1|    ossl_config_modules_free();
  452|       |
  453|      1|#ifndef OPENSSL_NO_ENGINE
  454|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  455|      1|    engine_cleanup_int();
  456|      1|#endif
  457|       |
  458|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  459|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  460|      1|    ossl_store_cleanup_int();
  461|      1|#endif
  462|       |
  463|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  464|      1|    ossl_lib_ctx_default_deinit();
  465|       |
  466|      1|    ossl_cleanup_thread();
  467|       |
  468|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  469|      1|    bio_cleanup();
  470|       |
  471|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  472|      1|    evp_cleanup_int();
  473|       |
  474|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  475|      1|    ossl_obj_cleanup_int();
  476|       |
  477|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  478|      1|    err_cleanup();
  479|       |
  480|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  481|      1|    CRYPTO_secure_malloc_done();
  482|       |
  483|      1|#ifndef OPENSSL_NO_CMP
  484|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  485|      1|    OSSL_CMP_log_close();
  486|      1|#endif
  487|       |
  488|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  489|      1|    ossl_trace_cleanup();
  490|       |
  491|      1|    base_inited = 0;
  492|      1|}
OPENSSL_init_crypto:
  500|  52.0k|{
  501|  52.0k|    uint64_t tmp;
  502|  52.0k|    int aloaddone = 0;
  503|       |
  504|       |   /* Applications depend on 0 being returned when cleanup was already done */
  505|  52.0k|    if (stopped) {
  ------------------
  |  Branch (505:9): [True: 0, False: 52.0k]
  ------------------
  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|  52.0k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (524:9): [True: 52.0k, False: 0]
  ------------------
  525|  52.0k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (525:13): [True: 42.5k, False: 9.49k]
  ------------------
  526|  42.5k|            return 1;
  527|  9.49k|        aloaddone = 1;
  528|  9.49k|    }
  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|  9.49k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  9.49k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 9.49k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (544:9): [True: 0, False: 9.49k]
  ------------------
  545|      0|        return 0;
  546|       |
  547|  9.49k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  9.49k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (547:9): [True: 9.49k, False: 3]
  ------------------
  548|  9.49k|        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|      3|    if (!aloaddone) {
  ------------------
  |  Branch (555:9): [True: 0, False: 3]
  ------------------
  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|      3|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  485|      3|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (568:9): [True: 0, False: 3]
  ------------------
  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|      3|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (572:16): [True: 0, False: 3]
  ------------------
  573|      0|        return 0;
  574|      0|    }
  575|       |
  576|      3|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (576:9): [True: 0, False: 3]
  ------------------
  577|      0|        return 0;
  578|       |
  579|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  466|      3|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (579:9): [True: 0, False: 3]
  ------------------
  580|      3|            && !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|      3|                             ossl_init_no_load_crypto_strings,
  582|      3|                             ossl_init_load_crypto_strings))
  583|      0|        return 0;
  584|       |
  585|      3|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  467|      3|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (585:9): [True: 1, False: 2]
  ------------------
  586|      3|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (586:16): [True: 0, False: 1]
  ------------------
  587|      0|        return 0;
  588|       |
  589|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2806|      3|# define OPENSSL_INIT_NO_LOAD_SSL_STRINGS    0x00100000L
  ------------------
  |  Branch (589:9): [True: 0, False: 3]
  ------------------
  590|      3|        && !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|      3|                         ossl_init_load_ssl_strings))
  592|      0|        return 0;
  593|       |
  594|      3|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2807|      3|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (594:9): [True: 0, False: 3]
  ------------------
  595|      3|        && !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|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  470|      3|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (598:9): [True: 0, False: 3]
  ------------------
  599|      3|            && !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|      3|                             ossl_init_add_all_ciphers))
  601|      0|        return 0;
  602|       |
  603|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  468|      3|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (603:9): [True: 1, False: 2]
  ------------------
  604|      3|            && !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|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  471|      3|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (607:9): [True: 0, False: 3]
  ------------------
  608|      3|            && !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|      3|                             ossl_init_add_all_digests))
  610|      0|        return 0;
  611|       |
  612|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  469|      3|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (612:9): [True: 1, False: 2]
  ------------------
  613|      3|            && !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|      3|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  483|      3|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (616:9): [True: 0, False: 3]
  ------------------
  617|      3|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (617:16): [True: 0, False: 0]
  ------------------
  618|      0|        return 0;
  619|       |
  620|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  473|      3|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (620:9): [True: 0, False: 3]
  ------------------
  621|      3|            && !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|      3|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  472|      3|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (624:9): [True: 1, False: 2]
  ------------------
  625|      1|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  626|       |
  627|       |        /* If called recursively from OBJ_ calls, just skip it. */
  628|      1|        if (!loading) {
  ------------------
  |  Branch (628:13): [True: 1, False: 0]
  ------------------
  629|      1|            int ret;
  630|       |
  631|      1|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (631:17): [True: 0, False: 1]
  ------------------
  632|      0|                return 0;
  633|      1|            if (settings == NULL) {
  ------------------
  |  Branch (633:17): [True: 1, False: 0]
  ------------------
  634|      1|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  635|      1|            } 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|      1|            if (ret <= 0)
  ------------------
  |  Branch (645:17): [True: 0, False: 1]
  ------------------
  646|      0|                return 0;
  647|      1|        }
  648|      1|    }
  649|       |
  650|      3|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  474|      3|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (650:9): [True: 0, False: 3]
  ------------------
  651|      3|            && !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|      3|#ifndef OPENSSL_NO_ENGINE
  655|      3|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  477|      3|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (655:9): [True: 0, False: 3]
  ------------------
  656|      3|            && !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|      3|# ifndef OPENSSL_NO_RDRAND
  659|      3|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  475|      3|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (659:9): [True: 0, False: 3]
  ------------------
  660|      3|            && !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|      3|# endif
  663|      3|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  476|      3|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (663:9): [True: 0, False: 3]
  ------------------
  664|      3|            && !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|      3|# 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|      3|#  if !defined(OPENSSL_NO_PADLOCKENG)
  673|      3|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  480|      3|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (673:9): [True: 0, False: 3]
  ------------------
  674|      3|            && !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|      3|#  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|      3|#  if !defined(OPENSSL_NO_AFALGENG)
  683|      3|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  481|      3|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (683:9): [True: 0, False: 3]
  ------------------
  684|      3|            && !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|      3|#  endif
  687|      3|# endif
  688|      3|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  497|      3|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  475|      3|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  476|      3|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  498|      3|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  478|      3|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  479|      3|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  499|      3|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  480|      3|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (688:9): [True: 0, False: 3]
  ------------------
  689|      3|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  477|      3|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  690|      3|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  481|      3|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  691|      0|        ENGINE_register_all_complete();
  692|      0|    }
  693|      3|#endif
  694|       |
  695|      3|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (695:9): [True: 0, False: 3]
  ------------------
  696|      0|        return 0;
  697|       |
  698|      3|    return 1;
  699|      3|}
init.c:ossl_init_base:
   58|      1|{
   59|       |    /* no need to init trace */
   60|       |
   61|      1|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   62|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   63|       |    ossl_malloc_setup_failures();
   64|       |#endif
   65|       |
   66|      1|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 1]
  ------------------
   67|      1|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 1]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      1|    OPENSSL_cpuid_setup();
   71|       |
   72|      1|    if (!ossl_init_thread())
  ------------------
  |  Branch (72:9): [True: 0, False: 1]
  ------------------
   73|      0|        goto err;
   74|       |
   75|      1|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (75:9): [True: 0, False: 1]
  ------------------
   76|      0|        goto err;
   77|       |
   78|      1|    base_inited = 1;
   79|      1|    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|      1|}
init.c:ossl_init_register_atexit:
  101|      1|{
  102|      1|#ifndef OPENSSL_NO_ATEXIT
  103|       |# ifdef OPENSSL_INIT_DEBUG
  104|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  105|       |# endif
  106|      1|# 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|      1|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (112:9): [True: 0, False: 1]
  ------------------
  113|      0|        return 0;
  114|      1|#  endif
  115|      1|# endif
  116|      1|#endif
  117|       |
  118|      1|    return 1;
  119|      1|}
init.c:ossl_init_load_crypto_nodelete:
  133|      1|{
  134|      1|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  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|      1|    return 1;
  181|      1|}
init.c:ossl_init_load_crypto_strings:
  186|      1|{
  187|      1|    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|      1|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  193|      1|    void *err;
  194|       |
  195|      1|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (195:9): [True: 0, False: 1]
  ------------------
  196|      0|        return 0;
  197|       |
  198|      1|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|      1|    ret = ossl_err_load_crypto_strings();
  200|       |
  201|      1|    err_unshelve_state(err);
  202|      1|#endif
  203|      1|    return ret;
  204|      1|}
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|      1|{
  282|      1|    int ret = ossl_config_int(NULL);
  283|       |
  284|      1|    config_inited = 1;
  285|      1|    return ret;
  286|      1|}

ossl_init_thread:
  203|      1|{
  204|      1|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (204:9): [True: 0, False: 1]
  ------------------
  205|      1|                                  init_thread_destructor))
  206|      0|        return 0;
  207|       |
  208|      1|    return 1;
  209|      1|}
ossl_cleanup_thread:
  212|      1|{
  213|      1|    init_thread_deregister(NULL, 1);
  214|      1|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  215|      1|    destructor_key.sane = -1;
  216|      1|}
OPENSSL_thread_stop:
  230|      1|{
  231|      1|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (231:9): [True: 1, False: 0]
  ------------------
  232|      1|        THREAD_EVENT_HANDLER **hands
  233|      1|            = init_get_thread_local(&destructor_key.value, 0, 0);
  234|      1|        init_thread_stop(NULL, hands);
  235|       |
  236|      1|        init_thread_remove_handlers(hands);
  237|      1|        OPENSSL_free(hands);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  238|      1|    }
  239|      1|}
ossl_ctx_thread_stop:
  242|      1|{
  243|      1|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (243:9): [True: 1, False: 0]
  ------------------
  244|      1|        THREAD_EVENT_HANDLER **hands
  245|      1|            = init_get_thread_local(&destructor_key.value, 0, 1);
  246|      1|        init_thread_stop(ctx, hands);
  247|      1|    }
  248|      1|}
ossl_init_thread_start:
  369|      2|{
  370|      2|    THREAD_EVENT_HANDLER **hands;
  371|      2|    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|      2|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  390|      2|#endif
  391|       |
  392|      2|    hands = init_get_thread_local(local, 1, 0);
  393|      2|    if (hands == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 2]
  ------------------
  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|      2|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  409|      2|    if (hand == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 2]
  ------------------
  410|      0|        return 0;
  411|       |
  412|      2|    hand->handfn = handfn;
  413|      2|    hand->arg = arg;
  414|      2|#ifndef FIPS_MODULE
  415|      2|    hand->index = index;
  416|      2|#endif
  417|      2|    hand->next = *hands;
  418|      2|    *hands = hand;
  419|       |
  420|      2|    return 1;
  421|      2|}
ossl_init_thread_deregister:
  477|      1|{
  478|      1|    return init_thread_deregister(index, 0);
  479|      1|}
initthread.c:init_get_thread_local:
   95|      4|{
   96|      4|    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
   97|       |
   98|      4|    if (alloc) {
  ------------------
  |  Branch (98:9): [True: 2, False: 2]
  ------------------
   99|      2|        if (hands == NULL) {
  ------------------
  |  Branch (99:13): [True: 1, False: 1]
  ------------------
  100|       |
  101|      1|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  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 (101:17): [True: 0, False: 1]
  ------------------
  102|      0|                return NULL;
  103|       |
  104|      1|            if (!CRYPTO_THREAD_set_local(local, hands)) {
  ------------------
  |  Branch (104:17): [True: 0, False: 1]
  ------------------
  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|      1|#ifndef FIPS_MODULE
  110|      1|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (110:17): [True: 0, False: 1]
  ------------------
  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|      1|#endif
  116|      1|        }
  117|      2|    } else if (!keep) {
  ------------------
  |  Branch (117:16): [True: 1, False: 1]
  ------------------
  118|      1|        CRYPTO_THREAD_set_local(local, NULL);
  119|      1|    }
  120|       |
  121|      4|    return hands;
  122|      4|}
initthread.c:init_thread_push_handlers:
  155|      1|{
  156|      1|    int ret;
  157|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  158|       |
  159|      1|    gtr = get_global_tevent_register();
  160|      1|    if (gtr == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 1]
  ------------------
  161|      0|        return 0;
  162|       |
  163|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        return 0;
  165|      1|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  166|      1|    CRYPTO_THREAD_unlock(gtr->lock);
  167|       |
  168|      1|    return ret;
  169|      1|}
initthread.c:get_global_tevent_register:
   78|      5|{
   79|      5|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      5|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 5, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (79:9): [True: 0, False: 5]
  ------------------
   80|      0|        return NULL;
   81|      5|    return glob_tevent_reg;
   82|      5|}
initthread.c:create_global_tevent_register:
   59|      1|{
   60|      1|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   61|      1|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|       |
   64|      1|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   65|      1|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   66|      1|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 1]
  |  Branch (66:45): [True: 0, False: 1]
  ------------------
   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|      1|    return 1;
   75|      1|}
initthread.c:init_thread_remove_handlers:
  172|      1|{
  173|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  174|      1|    int i;
  175|       |
  176|      1|    gtr = get_global_tevent_register();
  177|      1|    if (gtr == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        return;
  179|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        return;
  181|      1|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (181:17): [True: 1, False: 0]
  ------------------
  182|      1|        THREAD_EVENT_HANDLER **hands
  183|      1|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  184|       |
  185|      1|        if (hands == handsin) {
  ------------------
  |  Branch (185:13): [True: 1, False: 0]
  ------------------
  186|      1|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  187|      1|            CRYPTO_THREAD_unlock(gtr->lock);
  188|      1|            return;
  189|      1|        }
  190|      1|    }
  191|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  192|      0|    return;
  193|      1|}
initthread.c:init_thread_stop:
  325|      2|{
  326|      2|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  327|      2|#ifndef FIPS_MODULE
  328|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  329|      2|#endif
  330|       |
  331|       |    /* Can't do much about this */
  332|      2|    if (hands == NULL)
  ------------------
  |  Branch (332:9): [True: 1, False: 1]
  ------------------
  333|      1|        return;
  334|       |
  335|      1|#ifndef FIPS_MODULE
  336|      1|    gtr = get_global_tevent_register();
  337|      1|    if (gtr == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 1]
  ------------------
  338|      0|        return;
  339|       |
  340|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (340:9): [True: 0, False: 1]
  ------------------
  341|      0|        return;
  342|      1|#endif
  343|       |
  344|      1|    curr = *hands;
  345|      3|    while (curr != NULL) {
  ------------------
  |  Branch (345:12): [True: 2, False: 1]
  ------------------
  346|      2|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (346:13): [True: 0, False: 2]
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|            prev = curr;
  348|      0|            curr = curr->next;
  349|      0|            continue;
  350|      0|        }
  351|      2|        curr->handfn(curr->arg);
  352|      2|        if (prev == NULL)
  ------------------
  |  Branch (352:13): [True: 2, False: 0]
  ------------------
  353|      2|            *hands = curr->next;
  354|      0|        else
  355|      0|            prev->next = curr->next;
  356|       |
  357|      2|        tmp = curr;
  358|      2|        curr = curr->next;
  359|       |
  360|      2|        OPENSSL_free(tmp);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  361|      2|    }
  362|      1|#ifndef FIPS_MODULE
  363|      1|    CRYPTO_THREAD_unlock(gtr->lock);
  364|      1|#endif
  365|      1|}
initthread.c:init_thread_deregister:
  425|      2|{
  426|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  427|      2|    int i;
  428|       |
  429|      2|    gtr = get_global_tevent_register();
  430|      2|    if (gtr == NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 2]
  ------------------
  431|      0|        return 0;
  432|      2|    if (!all) {
  ------------------
  |  Branch (432:9): [True: 1, False: 1]
  ------------------
  433|      1|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (433:13): [True: 0, False: 1]
  ------------------
  434|      0|            return 0;
  435|      1|    } else {
  436|      1|        glob_tevent_reg = NULL;
  437|      1|    }
  438|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (438:17): [True: 0, False: 2]
  ------------------
  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|      2|    if (all) {
  ------------------
  |  Branch (466:9): [True: 1, False: 1]
  ------------------
  467|      1|        CRYPTO_THREAD_lock_free(gtr->lock);
  468|      1|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  469|      1|        OPENSSL_free(gtr);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  470|      1|    } else {
  471|      1|        CRYPTO_THREAD_unlock(gtr->lock);
  472|      1|    }
  473|      2|    return 1;
  474|      2|}

OPENSSL_LH_set_thunks:
   52|    267|{
   53|       |
   54|    267|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 267]
  ------------------
   55|      0|        return NULL;
   56|    267|    lh->compw = cw;
   57|    267|    lh->hashw = hw;
   58|    267|    lh->daw = daw;
   59|    267|    lh->daaw = daaw;
   60|    267|    return lh;
   61|    267|}
OPENSSL_LH_new:
   64|    267|{
   65|    267|    OPENSSL_LHASH *ret;
   66|       |
   67|    267|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|    267|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    267|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    267|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 267]
  ------------------
   68|      0|        return NULL;
   69|    267|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|    267|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    267|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    267|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 267]
  ------------------
   70|      0|        goto err;
   71|    267|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 267]
  ------------------
   72|    267|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 267]
  ------------------
   73|    267|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|    267|#define MIN_NODES       16
  ------------------
   74|    267|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|    267|#define MIN_NODES       16
  ------------------
   75|    267|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|    267|#define MIN_NODES       16
  ------------------
   76|    267|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|    267|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|    267|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|    267|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|    267|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|    267|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|    267|    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|    267|}
OPENSSL_LH_free:
   87|    268|{
   88|    268|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 1, False: 267]
  ------------------
   89|      1|        return;
   90|       |
   91|    267|    OPENSSL_LH_flush(lh);
   92|    267|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|    267|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    267|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    267|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|    267|    OPENSSL_free(lh);
  ------------------
  |  |  115|    267|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    267|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    267|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|    267|}
OPENSSL_LH_flush:
   97|    267|{
   98|    267|    unsigned int i;
   99|    267|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|    267|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 267]
  ------------------
  102|      0|        return;
  103|       |
  104|  3.26k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 3.00k, False: 267]
  ------------------
  105|  3.00k|        n = lh->b[i];
  106|  4.55k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 1.55k, False: 3.00k]
  ------------------
  107|  1.55k|            nn = n->next;
  108|  1.55k|            OPENSSL_free(n);
  ------------------
  |  |  115|  1.55k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.55k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.55k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  1.55k|            n = nn;
  110|  1.55k|        }
  111|  3.00k|        lh->b[i] = NULL;
  112|  3.00k|    }
  113|       |
  114|    267|    lh->num_items = 0;
  115|    267|}
OPENSSL_LH_insert:
  118|  4.76k|{
  119|  4.76k|    unsigned long hash;
  120|  4.76k|    OPENSSL_LH_NODE *nn, **rn;
  121|  4.76k|    void *ret;
  122|       |
  123|  4.76k|    lh->error = 0;
  124|  4.76k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  4.76k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 867, False: 3.89k]
  |  Branch (124:76): [True: 0, False: 867]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  4.76k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  4.76k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 1.79k, False: 2.97k]
  ------------------
  130|  1.79k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  1.79k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.79k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.79k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 1.79k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  1.79k|        nn->data = data;
  135|  1.79k|        nn->next = NULL;
  136|  1.79k|        nn->hash = hash;
  137|  1.79k|        *rn = nn;
  138|  1.79k|        ret = NULL;
  139|  1.79k|        lh->num_items++;
  140|  2.97k|    } else {                    /* replace same key */
  141|  2.97k|        ret = (*rn)->data;
  142|  2.97k|        (*rn)->data = data;
  143|  2.97k|    }
  144|  4.76k|    return ret;
  145|  4.76k|}
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|  3.08k|{
  175|  3.08k|    unsigned long hash;
  176|  3.08k|    OPENSSL_LH_NODE **rn;
  177|       |
  178|  3.08k|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 3.08k]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|  3.08k|    rn = getrn(lh, data, &hash);
  182|       |
  183|  3.08k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 264, False: 2.81k]
  ------------------
  184|  3.08k|}
OPENSSL_LH_doall:
  217|    269|{
  218|    269|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 269]
  ------------------
  219|      0|        return;
  220|       |
  221|    269|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|    269|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|    269|}
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|  2.38k|{
  363|  2.38k|    unsigned long ret = 0;
  364|  2.38k|    long n;
  365|  2.38k|    unsigned long v;
  366|  2.38k|    int r;
  367|       |
  368|  2.38k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 2.38k]
  |  Branch (368:24): [True: 1.79k, False: 592]
  ------------------
  369|  1.79k|        return ret;
  370|       |
  371|    592|    n = 0x100;
  372|  7.89k|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 7.30k, False: 592]
  ------------------
  373|  7.30k|        v = n | (*c);
  374|  7.30k|        n += 0x100;
  375|  7.30k|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|  7.30k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|  7.30k|        ret &= 0xFFFFFFFFL;
  379|  7.30k|        ret ^= v * v;
  380|  7.30k|        c++;
  381|  7.30k|    }
  382|    592|    return (ret >> 16) ^ ret;
  383|  2.38k|}
ossl_lh_strcasehash:
  400|  1.31k|{
  401|  1.31k|    unsigned long ret = 0;
  402|  1.31k|    long n;
  403|  1.31k|    unsigned long v;
  404|  1.31k|    int r;
  405|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  406|       |    const long int case_adjust = ~0x40;
  407|       |#else
  408|  1.31k|    const long int case_adjust = ~0x20;
  409|  1.31k|#endif
  410|       |
  411|  1.31k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (411:9): [True: 0, False: 1.31k]
  |  Branch (411:22): [True: 0, False: 1.31k]
  ------------------
  412|      0|        return ret;
  413|       |
  414|  16.9k|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (414:21): [True: 15.6k, False: 1.31k]
  ------------------
  415|  15.6k|        v = n | (case_adjust & *c);
  416|  15.6k|        r = (int)((v >> 2) ^ v) & 0x0f;
  417|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  418|  15.6k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  419|  15.6k|        ret &= 0xFFFFFFFFL;
  420|  15.6k|        ret ^= v * v;
  421|  15.6k|        c++;
  422|  15.6k|    }
  423|  1.31k|    return (ret >> 16) ^ ret;
  424|  1.31k|}
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|    270|{
  443|    270|    return lh->error;
  444|    270|}
lhash.c:doall_util_fn:
  192|    271|{
  193|    271|    int i;
  194|    271|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|    271|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 271]
  ------------------
  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.12k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 2.85k, False: 271]
  ------------------
  204|  2.85k|        a = lh->b[i];
  205|  3.90k|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 1.05k, False: 2.85k]
  ------------------
  206|  1.05k|            n = a->next;
  207|  1.05k|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 484, False: 571]
  ------------------
  208|    484|                wfunc_arg(a->data, arg, func_arg);
  209|    571|            else
  210|    571|                wfunc(a->data, func);
  211|  1.05k|            a = n;
  212|  1.05k|        }
  213|  2.85k|    }
  214|    271|}
lhash.c:expand:
  244|    867|{
  245|    867|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|    867|    unsigned int p, pmax, nni, j;
  247|    867|    unsigned long hash;
  248|       |
  249|    867|    nni = lh->num_alloc_nodes;
  250|    867|    p = lh->p;
  251|    867|    pmax = lh->pmax;
  252|    867|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 9, False: 858]
  ------------------
  253|      9|        j = nni * 2;
  254|      9|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|      9|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|      9|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 9]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|      9|        lh->b = n;
  260|      9|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|      9|        lh->pmax = nni;
  262|      9|        lh->num_alloc_nodes = j;
  263|      9|        lh->p = 0;
  264|    858|    } else {
  265|    858|        lh->p++;
  266|    858|    }
  267|       |
  268|    867|    lh->num_nodes++;
  269|    867|    n1 = &(lh->b[p]);
  270|    867|    n2 = &(lh->b[p + pmax]);
  271|    867|    *n2 = NULL;
  272|       |
  273|  3.93k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 3.06k, False: 867]
  ------------------
  274|  3.06k|        hash = np->hash;
  275|  3.06k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 551, False: 2.51k]
  ------------------
  276|    551|            *n1 = (*n1)->next;
  277|    551|            np->next = *n2;
  278|    551|            *n2 = np;
  279|    551|        } else
  280|  2.51k|            n1 = &((*n1)->next);
  281|  3.06k|        np = *n1;
  282|  3.06k|    }
  283|       |
  284|    867|    return 1;
  285|    867|}
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|  8.08k|{
  323|  8.08k|    OPENSSL_LH_NODE **ret, *n1;
  324|  8.08k|    unsigned long hash, nn;
  325|       |
  326|  8.08k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 8.08k, False: 0]
  ------------------
  327|  8.08k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|  8.08k|    *rhash = hash;
  332|       |
  333|  8.08k|    nn = hash % lh->pmax;
  334|  8.08k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 3.03k, False: 5.04k]
  ------------------
  335|  3.03k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|  8.08k|    ret = &(lh->b[(int)nn]);
  338|  16.6k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 14.5k, False: 2.05k]
  ------------------
  339|  14.5k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 8.39k, False: 6.18k]
  ------------------
  340|  8.39k|            ret = &(n1->next);
  341|  8.39k|            continue;
  342|  8.39k|        }
  343|       |
  344|  6.18k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 6.18k, False: 0]
  ------------------
  345|  6.18k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 6.02k, False: 158]
  ------------------
  346|  6.02k|                break;
  347|  6.18k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    158|        ret = &(n1->next);
  352|    158|    }
  353|  8.08k|    return ret;
  354|  8.08k|}

CRYPTO_malloc:
  187|  25.3k|{
  188|  25.3k|    void *ptr;
  189|       |
  190|  25.3k|    INCREMENT(malloc_count);
  191|  25.3k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (191:9): [True: 0, False: 25.3k]
  ------------------
  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|  25.3k|    if (num == 0)
  ------------------
  |  Branch (198:9): [True: 0, False: 25.3k]
  ------------------
  199|      0|        return NULL;
  200|       |
  201|  25.3k|    FAILTEST();
  202|  25.3k|    if (allow_customize) {
  ------------------
  |  Branch (202:9): [True: 1, False: 25.3k]
  ------------------
  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|      1|        allow_customize = 0;
  209|      1|    }
  210|       |
  211|  25.3k|    ptr = malloc(num);
  212|  25.3k|    if (ptr != NULL)
  ------------------
  |  Branch (212:9): [True: 25.3k, False: 0]
  ------------------
  213|  25.3k|        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|  25.3k|}
CRYPTO_zalloc:
  228|  12.6k|{
  229|  12.6k|    void *ret;
  230|       |
  231|  12.6k|    ret = CRYPTO_malloc(num, file, line);
  232|  12.6k|    if (ret != NULL)
  ------------------
  |  Branch (232:9): [True: 12.6k, False: 0]
  ------------------
  233|  12.6k|        memset(ret, 0, num);
  234|       |
  235|  12.6k|    return ret;
  236|  12.6k|}
CRYPTO_aligned_alloc:
  240|      2|{
  241|      2|    void *ret;
  242|       |
  243|      2|    *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|      2|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (251:9): [True: 2, False: 0]
  ------------------
  252|      2|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  253|      2|        if (posix_memalign(&ret, alignment, num))
  ------------------
  |  Branch (253:13): [True: 0, False: 2]
  ------------------
  254|      0|            return NULL;
  255|      2|        *freeptr = ret;
  256|      2|        return ret;
  257|       |#elif defined(_ISOC11_SOURCE)
  258|       |        ret = *freeptr = aligned_alloc(alignment, num);
  259|       |        return ret;
  260|       |#endif
  261|      2|    }
  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|     60|{
  302|     60|    INCREMENT(realloc_count);
  303|     60|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (303:9): [True: 0, False: 60]
  ------------------
  304|      0|        return realloc_impl(str, num, file, line);
  305|       |
  306|     60|    if (str == NULL)
  ------------------
  |  Branch (306:9): [True: 11, False: 49]
  ------------------
  307|     11|        return CRYPTO_malloc(num, file, line);
  308|       |
  309|     49|    if (num == 0) {
  ------------------
  |  Branch (309:9): [True: 0, False: 49]
  ------------------
  310|      0|        CRYPTO_free(str, file, line);
  311|      0|        return NULL;
  312|      0|    }
  313|       |
  314|     49|    FAILTEST();
  315|     49|    return realloc(str, num);
  316|     49|}
CRYPTO_free:
  346|  39.8k|{
  347|  39.8k|    INCREMENT(free_count);
  348|  39.8k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (348:9): [True: 0, False: 39.8k]
  ------------------
  349|      0|        free_impl(str, file, line);
  350|      0|        return;
  351|      0|    }
  352|       |
  353|  39.8k|    free(str);
  354|  39.8k|}
CRYPTO_clear_free:
  357|  4.02k|{
  358|  4.02k|    if (str == NULL)
  ------------------
  |  Branch (358:9): [True: 456, False: 3.56k]
  ------------------
  359|    456|        return;
  360|  3.56k|    if (num)
  ------------------
  |  Branch (360:9): [True: 3.56k, False: 0]
  ------------------
  361|  3.56k|        OPENSSL_cleanse(str, num);
  362|  3.56k|    CRYPTO_free(str, file, line);
  363|  3.56k|}

CRYPTO_secure_malloc_done:
  132|      1|{
  133|      1|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      1|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 1, False: 0]
  ------------------
  135|      1|        sh_done();
  136|      1|        secure_mem_initialized = 0;
  137|      1|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      1|        sec_malloc_lock = NULL;
  139|      1|        return 1;
  140|      1|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      1|}
CRYPTO_secure_malloc:
  155|      4|{
  156|      4|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|      4|    void *ret = NULL;
  158|      4|    size_t actual_size;
  159|      4|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|      4|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|      4|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 4, False: 0]
  ------------------
  162|      4|        return CRYPTO_malloc(num, file, line);
  163|      4|    }
  164|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  327|      0|# define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  |  |  ------------------
  |  |               # define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|      0|        goto err;
  167|      0|    }
  168|      0|    ret = sh_malloc(num);
  169|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (169:19): [True: 0, False: 0]
  ------------------
  170|      0|    secure_mem_used += actual_size;
  171|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  172|      0| err:
  173|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  |  Branch (173:25): [True: 0, False: 0]
  |  Branch (173:41): [True: 0, False: 0]
  ------------------
  174|      0|        ERR_new();
  175|      0|        ERR_set_debug(file, line, NULL);
  176|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
  177|      0|    }
  178|      0|    return ret;
  179|       |#else
  180|       |    return CRYPTO_malloc(num, file, line);
  181|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  182|      0|}
CRYPTO_secure_zalloc:
  185|      4|{
  186|      4|#ifndef OPENSSL_NO_SECURE_MEMORY
  187|      4|    if (secure_mem_initialized)
  ------------------
  |  Branch (187:9): [True: 0, False: 4]
  ------------------
  188|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  189|      0|        return CRYPTO_secure_malloc(num, file, line);
  190|      4|#endif
  191|      4|    return CRYPTO_zalloc(num, file, line);
  192|      4|}
CRYPTO_secure_clear_free:
  219|     13|{
  220|     13|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|     13|    size_t actual_size;
  222|       |
  223|     13|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 5, False: 8]
  ------------------
  224|      5|        return;
  225|      8|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 8, False: 0]
  ------------------
  226|      8|        OPENSSL_cleanse(ptr, num);
  227|      8|        CRYPTO_free(ptr, file, line);
  228|      8|        return;
  229|      8|    }
  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|     32|{
  247|     32|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|     32|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 32, False: 0]
  ------------------
  249|     32|        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|     32|}
mem_sec.c:sh_done:
  599|      1|{
  600|      1|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  601|      1|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  602|      1|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  603|      1|#if !defined(_WIN32)
  604|      1|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 1, False: 0]
  |  Branch (604:40): [True: 0, False: 1]
  ------------------
  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|      1|    memset(&sh, 0, sizeof(sh));
  611|      1|}

ossl_ml_dsa_pk_encode:
  623|    444|{
  624|    444|    int ret = 0;
  625|    444|    size_t i, written = 0;
  626|    444|    const POLY *t1 = key->t1.poly;
  627|    444|    size_t t1_len = key->t1.num_poly;
  628|    444|    size_t enc_len = key->params->pk_len;
  629|    444|    uint8_t *enc = OPENSSL_malloc(enc_len);
  ------------------
  |  |  102|    444|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  630|    444|    WPACKET pkt;
  631|       |
  632|    444|    if (enc == NULL)
  ------------------
  |  Branch (632:9): [True: 0, False: 444]
  ------------------
  633|      0|        return 0;
  634|       |
  635|    444|    if (!WPACKET_init_static_len(&pkt, enc, enc_len, 0)
  ------------------
  |  Branch (635:9): [True: 0, False: 444]
  ------------------
  636|    444|            || !WPACKET_memcpy(&pkt, key->rho, sizeof(key->rho)))
  ------------------
  |  Branch (636:16): [True: 0, False: 444]
  ------------------
  637|      0|        goto err;
  638|  3.04k|    for (i = 0; i < t1_len; i++)
  ------------------
  |  Branch (638:17): [True: 2.59k, False: 444]
  ------------------
  639|  2.59k|        if (!poly_encode_10_bits(t1 + i, &pkt))
  ------------------
  |  Branch (639:13): [True: 0, False: 2.59k]
  ------------------
  640|      0|            goto err;
  641|    444|    if (!WPACKET_get_total_written(&pkt, &written)
  ------------------
  |  Branch (641:9): [True: 0, False: 444]
  ------------------
  642|    444|            || written != enc_len)
  ------------------
  |  Branch (642:16): [True: 0, False: 444]
  ------------------
  643|      0|        goto err;
  644|    444|    OPENSSL_free(key->pub_encoding);
  ------------------
  |  |  115|    444|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  645|    444|    key->pub_encoding = enc;
  646|    444|    ret = 1;
  647|    444|err:
  648|    444|    WPACKET_finish(&pkt);
  649|    444|    if (ret == 0)
  ------------------
  |  Branch (649:9): [True: 0, False: 444]
  ------------------
  650|      0|        OPENSSL_free(enc);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  651|    444|    return ret;
  652|    444|}
ossl_ml_dsa_pk_decode:
  665|      5|{
  666|      5|    int ret = 0;
  667|      5|    size_t i;
  668|      5|    PACKET pkt;
  669|      5|    EVP_MD_CTX *ctx;
  670|       |
  671|      5|    if (key->priv_encoding != NULL || key->pub_encoding != NULL)
  ------------------
  |  Branch (671:9): [True: 0, False: 5]
  |  Branch (671:39): [True: 0, False: 5]
  ------------------
  672|      0|        return 0; /* Do not allow key mutation */
  673|      5|    if (in_len != key->params->pk_len)
  ------------------
  |  Branch (673:9): [True: 0, False: 5]
  ------------------
  674|      0|        return 0;
  675|       |
  676|      5|    if (!ossl_ml_dsa_key_pub_alloc(key))
  ------------------
  |  Branch (676:9): [True: 0, False: 5]
  ------------------
  677|      0|        return 0;
  678|      5|    ctx = EVP_MD_CTX_new();
  679|      5|    if (ctx == NULL)
  ------------------
  |  Branch (679:9): [True: 0, False: 5]
  ------------------
  680|      0|        goto err;
  681|      5|    if (!PACKET_buf_init(&pkt, in, in_len)
  ------------------
  |  Branch (681:9): [True: 0, False: 5]
  ------------------
  682|      5|            || !PACKET_copy_bytes(&pkt, key->rho, sizeof(key->rho)))
  ------------------
  |  Branch (682:16): [True: 0, False: 5]
  ------------------
  683|      0|        goto err;
  684|     37|    for (i = 0; i < key->t1.num_poly; i++)
  ------------------
  |  Branch (684:17): [True: 32, False: 5]
  ------------------
  685|     32|        if (!poly_decode_10_bits(key->t1.poly + i, &pkt))
  ------------------
  |  Branch (685:13): [True: 0, False: 32]
  ------------------
  686|      0|            goto err;
  687|       |
  688|       |    /* cache the hash of the encoded public key */
  689|      5|    if (!shake_xof(ctx, key->shake256_md, in, in_len, key->tr, sizeof(key->tr)))
  ------------------
  |  Branch (689:9): [True: 0, False: 5]
  ------------------
  690|      0|        goto err;
  691|       |
  692|      5|    key->pub_encoding = OPENSSL_memdup(in, in_len);
  ------------------
  |  |  117|      5|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  693|      5|    ret = (key->pub_encoding != NULL);
  694|      5|err:
  695|      5|    EVP_MD_CTX_free(ctx);
  696|      5|    return ret;
  697|      5|}
ossl_ml_dsa_sk_encode:
  708|    444|{
  709|    444|    int ret = 0;
  710|    444|    const ML_DSA_PARAMS *params = key->params;
  711|    444|    size_t i, written = 0, k = params->k, l = params->l;
  712|    444|    ENCODE_FN *encode_fn;
  713|    444|    size_t enc_len = params->sk_len;
  714|    444|    const POLY *t0 = key->t0.poly;
  715|    444|    WPACKET pkt;
  716|    444|    uint8_t *enc = OPENSSL_malloc(enc_len);
  ------------------
  |  |  102|    444|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  717|       |
  718|    444|    if (enc == NULL)
  ------------------
  |  Branch (718:9): [True: 0, False: 444]
  ------------------
  719|      0|        return 0;
  720|       |
  721|       |    /* eta is the range of private key coefficients (-eta...eta) */
  722|    444|    if (params->eta == ML_DSA_ETA_4)
  ------------------
  |  |   42|    444|# define ML_DSA_ETA_4 4
  ------------------
  |  Branch (722:9): [True: 126, False: 318]
  ------------------
  723|    126|        encode_fn = poly_encode_signed_4;
  724|    318|    else
  725|    318|        encode_fn = poly_encode_signed_2;
  726|       |
  727|    444|    if (!WPACKET_init_static_len(&pkt, enc, enc_len, 0)
  ------------------
  |  Branch (727:9): [True: 0, False: 444]
  ------------------
  728|    444|            || !WPACKET_memcpy(&pkt, key->rho, sizeof(key->rho))
  ------------------
  |  Branch (728:16): [True: 0, False: 444]
  ------------------
  729|    444|            || !WPACKET_memcpy(&pkt, key->K, sizeof(key->K))
  ------------------
  |  Branch (729:16): [True: 0, False: 444]
  ------------------
  730|    444|            || !WPACKET_memcpy(&pkt, key->tr, sizeof(key->tr)))
  ------------------
  |  Branch (730:16): [True: 0, False: 444]
  ------------------
  731|      0|        goto err;
  732|  2.77k|    for (i = 0; i < l; ++i)
  ------------------
  |  Branch (732:17): [True: 2.32k, False: 444]
  ------------------
  733|  2.32k|        if (!encode_fn(key->s1.poly + i, &pkt))
  ------------------
  |  Branch (733:13): [True: 0, False: 2.32k]
  ------------------
  734|      0|            goto err;
  735|  3.04k|    for (i = 0; i < k; ++i)
  ------------------
  |  Branch (735:17): [True: 2.59k, False: 444]
  ------------------
  736|  2.59k|        if (!encode_fn(key->s2.poly + i, &pkt))
  ------------------
  |  Branch (736:13): [True: 0, False: 2.59k]
  ------------------
  737|      0|            goto err;
  738|  3.04k|    for (i = 0; i < k; ++i)
  ------------------
  |  Branch (738:17): [True: 2.59k, False: 444]
  ------------------
  739|  2.59k|        if (!poly_encode_signed_two_to_power_12(t0++, &pkt))
  ------------------
  |  Branch (739:13): [True: 0, False: 2.59k]
  ------------------
  740|      0|            goto err;
  741|    444|    if (!WPACKET_get_total_written(&pkt, &written)
  ------------------
  |  Branch (741:9): [True: 0, False: 444]
  ------------------
  742|    444|            || written != enc_len)
  ------------------
  |  Branch (742:16): [True: 0, False: 444]
  ------------------
  743|      0|        goto err;
  744|    444|    OPENSSL_clear_free(key->priv_encoding, enc_len);
  ------------------
  |  |  113|    444|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  745|    444|    key->priv_encoding = enc;
  746|    444|    ret = 1;
  747|    444|err:
  748|    444|    WPACKET_finish(&pkt);
  749|    444|    if (ret == 0)
  ------------------
  |  Branch (749:9): [True: 0, False: 444]
  ------------------
  750|      0|        OPENSSL_clear_free(enc, enc_len);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  751|    444|    return ret;
  752|    444|}
ossl_ml_dsa_sk_decode:
  765|     12|{
  766|     12|    DECODE_FN *decode_fn;
  767|     12|    const ML_DSA_PARAMS *params = key->params;
  768|     12|    size_t i, k = params->k, l = params->l;
  769|     12|    uint8_t input_tr[ML_DSA_TR_BYTES];
  770|     12|    PACKET pkt;
  771|       |
  772|       |    /* When loading from an explicit key, drop the seed. */
  773|     12|    OPENSSL_clear_free(key->seed, ML_DSA_SEED_BYTES);
  ------------------
  |  |  113|     12|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  774|     12|    key->seed = NULL;
  775|       |
  776|       |    /* Allow the key encoding to be already set to the provided pointer */
  777|     12|    if ((key->priv_encoding != NULL && key->priv_encoding != in)
  ------------------
  |  Branch (777:10): [True: 0, False: 12]
  |  Branch (777:40): [True: 0, False: 0]
  ------------------
  778|     12|        || key->pub_encoding != NULL)
  ------------------
  |  Branch (778:12): [True: 0, False: 12]
  ------------------
  779|      0|        return 0; /* Do not allow key mutation */
  780|     12|    if (in_len != key->params->sk_len)
  ------------------
  |  Branch (780:9): [True: 0, False: 12]
  ------------------
  781|      0|        return 0;
  782|     12|    if (!ossl_ml_dsa_key_priv_alloc(key))
  ------------------
  |  Branch (782:9): [True: 0, False: 12]
  ------------------
  783|      0|        return 0;
  784|       |
  785|       |    /* eta is the range of private key coefficients (-eta...eta) */
  786|     12|    if (params->eta == ML_DSA_ETA_4)
  ------------------
  |  |   42|     12|# define ML_DSA_ETA_4 4
  ------------------
  |  Branch (786:9): [True: 8, False: 4]
  ------------------
  787|      8|        decode_fn = poly_decode_signed_4;
  788|      4|    else
  789|      4|        decode_fn = poly_decode_signed_2;
  790|       |
  791|     12|    if (!PACKET_buf_init(&pkt, in, in_len)
  ------------------
  |  Branch (791:9): [True: 0, False: 12]
  ------------------
  792|     12|            || !PACKET_copy_bytes(&pkt, key->rho, sizeof(key->rho))
  ------------------
  |  Branch (792:16): [True: 0, False: 12]
  ------------------
  793|     12|            || !PACKET_copy_bytes(&pkt, key->K, sizeof(key->K))
  ------------------
  |  Branch (793:16): [True: 0, False: 12]
  ------------------
  794|     12|            || !PACKET_copy_bytes(&pkt, input_tr, sizeof(input_tr)))
  ------------------
  |  Branch (794:16): [True: 0, False: 12]
  ------------------
  795|      0|        return 0;
  796|       |
  797|     12|    for (i = 0; i < l; ++i)
  ------------------
  |  Branch (797:17): [True: 12, False: 0]
  ------------------
  798|     12|        if (!decode_fn(key->s1.poly + i, &pkt))
  ------------------
  |  Branch (798:13): [True: 12, False: 0]
  ------------------
  799|     12|            goto err;
  800|      0|    for (i = 0; i < k; ++i)
  ------------------
  |  Branch (800:17): [True: 0, False: 0]
  ------------------
  801|      0|        if (!decode_fn(key->s2.poly + i, &pkt))
  ------------------
  |  Branch (801:13): [True: 0, False: 0]
  ------------------
  802|      0|            goto err;
  803|      0|    for (i = 0; i < k; ++i)
  ------------------
  |  Branch (803:17): [True: 0, False: 0]
  ------------------
  804|      0|        if (!poly_decode_signed_two_to_power_12(key->t0.poly + i, &pkt))
  ------------------
  |  Branch (804:13): [True: 0, False: 0]
  ------------------
  805|      0|            goto err;
  806|      0|    if (PACKET_remaining(&pkt) != 0)
  ------------------
  |  Branch (806:9): [True: 0, False: 0]
  ------------------
  807|      0|        goto err;
  808|      0|    if (key->priv_encoding == NULL
  ------------------
  |  Branch (808:9): [True: 0, False: 0]
  ------------------
  809|      0|        && (key->priv_encoding = OPENSSL_memdup(in, in_len)) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (809:12): [True: 0, False: 0]
  ------------------
  810|      0|        goto err;
  811|       |    /*
  812|       |     * Computing the public key also computes its hash, which must be equal to
  813|       |     * the |tr| value in the private key, else the key was corrupted.
  814|       |     */
  815|      0|    if (!ossl_ml_dsa_key_public_from_private(key)
  ------------------
  |  Branch (815:9): [True: 0, False: 0]
  ------------------
  816|      0|            || memcmp(input_tr, key->tr, sizeof(input_tr)) != 0) {
  ------------------
  |  Branch (816:16): [True: 0, False: 0]
  ------------------
  817|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |   73|      0|# define PROV_R_INVALID_KEY                               158
  ------------------
  818|      0|                       "%s private key does not match its pubkey part",
  819|      0|                       key->params->alg);
  820|      0|        ossl_ml_dsa_key_reset(key);
  821|      0|        goto err;
  822|      0|    }
  823|       |
  824|      0|    return 1;
  825|     12| err:
  826|     12|    return 0;
  827|      0|}
ossl_ml_dsa_sig_encode:
  909|    190|{
  910|    190|    int ret = 0;
  911|    190|    size_t i;
  912|    190|    ENCODE_FN *encode_fn;
  913|    190|    WPACKET pkt;
  914|       |
  915|    190|    if (out == NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 190]
  ------------------
  916|      0|        return 0;
  917|       |
  918|    190|    if (params->gamma1 == ML_DSA_GAMMA1_TWO_POWER_19)
  ------------------
  |  |   48|    190|# define ML_DSA_GAMMA1_TWO_POWER_19 (1 << 19)
  ------------------
  |  Branch (918:9): [True: 123, False: 67]
  ------------------
  919|    123|        encode_fn = poly_encode_signed_two_to_power_19;
  920|     67|    else
  921|     67|        encode_fn = poly_encode_signed_two_to_power_17;
  922|       |
  923|    190|    if (!WPACKET_init_static_len(&pkt, out, params->sig_len, 0)
  ------------------
  |  Branch (923:9): [True: 0, False: 190]
  ------------------
  924|    190|            || !WPACKET_memcpy(&pkt, sig->c_tilde, sig->c_tilde_len))
  ------------------
  |  Branch (924:16): [True: 0, False: 190]
  ------------------
  925|      0|        goto err;
  926|       |
  927|  1.18k|    for (i = 0; i < sig->z.num_poly; ++i)
  ------------------
  |  Branch (927:17): [True: 997, False: 190]
  ------------------
  928|    997|        if (!encode_fn(sig->z.poly + i, &pkt))
  ------------------
  |  Branch (928:13): [True: 0, False: 997]
  ------------------
  929|      0|            goto err;
  930|    190|    if (!hint_bits_encode(&sig->hint, &pkt, params->omega))
  ------------------
  |  Branch (930:9): [True: 0, False: 190]
  ------------------
  931|      0|        goto err;
  932|    190|    ret = 1;
  933|    190|err:
  934|    190|    WPACKET_finish(&pkt);
  935|    190|    return ret;
  936|    190|}
ossl_ml_dsa_sig_decode:
  947|    190|{
  948|    190|    int ret = 0;
  949|    190|    size_t i;
  950|    190|    DECODE_FN *decode_fn;
  951|    190|    PACKET pkt;
  952|       |
  953|    190|    if (params->gamma1 == ML_DSA_GAMMA1_TWO_POWER_19)
  ------------------
  |  |   48|    190|# define ML_DSA_GAMMA1_TWO_POWER_19 (1 << 19)
  ------------------
  |  Branch (953:9): [True: 123, False: 67]
  ------------------
  954|    123|        decode_fn = poly_decode_signed_two_to_power_19;
  955|     67|    else
  956|     67|        decode_fn = poly_decode_signed_two_to_power_17;
  957|       |
  958|    190|    if (!PACKET_buf_init(&pkt, in, in_len)
  ------------------
  |  Branch (958:9): [True: 0, False: 190]
  ------------------
  959|    190|            || !PACKET_copy_bytes(&pkt, sig->c_tilde, sig->c_tilde_len))
  ------------------
  |  Branch (959:16): [True: 0, False: 190]
  ------------------
  960|      0|        goto err;
  961|  1.18k|    for (i = 0; i < sig->z.num_poly; ++i)
  ------------------
  |  Branch (961:17): [True: 997, False: 190]
  ------------------
  962|    997|        if (!decode_fn(sig->z.poly + i, &pkt))
  ------------------
  |  Branch (962:13): [True: 0, False: 997]
  ------------------
  963|      0|            goto err;
  964|       |
  965|    190|    if (!hint_bits_decode(&sig->hint, &pkt, params->omega)
  ------------------
  |  Branch (965:9): [True: 0, False: 190]
  ------------------
  966|    190|            || PACKET_remaining(&pkt) != 0)
  ------------------
  |  Branch (966:16): [True: 0, False: 190]
  ------------------
  967|      0|        goto err;
  968|    190|    ret = 1;
  969|    190|err:
  970|    190|    return ret;
  971|    190|}
ossl_ml_dsa_poly_decode_expand_mask:
  976|  4.20k|{
  977|  4.20k|    PACKET pkt;
  978|       |
  979|  4.20k|    if (!PACKET_buf_init(&pkt, in, in_len))
  ------------------
  |  Branch (979:9): [True: 0, False: 4.20k]
  ------------------
  980|      0|        return 0;
  981|  4.20k|    if (gamma1 == ML_DSA_GAMMA1_TWO_POWER_19)
  ------------------
  |  |   48|  4.20k|# define ML_DSA_GAMMA1_TWO_POWER_19 (1 << 19)
  ------------------
  |  Branch (981:9): [True: 3.03k, False: 1.16k]
  ------------------
  982|  3.03k|        return poly_decode_signed_two_to_power_19(out, &pkt);
  983|  1.16k|    else
  984|  1.16k|        return poly_decode_signed_two_to_power_17(out, &pkt);
  985|  4.20k|}
ossl_ml_dsa_w1_encode:
 1000|  1.00k|{
 1001|  1.00k|    WPACKET pkt;
 1002|  1.00k|    ENCODE_FN *encode_fn;
 1003|  1.00k|    int ret = 0;
 1004|  1.00k|    size_t i;
 1005|       |
 1006|  1.00k|    if (!WPACKET_init_static_len(&pkt, out, out_len, 0))
  ------------------
  |  Branch (1006:9): [True: 0, False: 1.00k]
  ------------------
 1007|      0|        return 0;
 1008|  1.00k|    if (gamma2 == ML_DSA_GAMMA2_Q_MINUS1_DIV32)
  ------------------
  |  |   54|  1.00k|# define ML_DSA_GAMMA2_Q_MINUS1_DIV32 ((ML_DSA_Q - 1) / 32)
  |  |  ------------------
  |  |  |  |   18|  1.00k|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  |  |  ------------------
  ------------------
  |  Branch (1008:9): [True: 648, False: 358]
  ------------------
 1009|    648|        encode_fn = poly_encode_4_bits;
 1010|    358|    else
 1011|    358|        encode_fn = poly_encode_6_bits;
 1012|  6.85k|    for (i = 0; i < w1->num_poly; ++i)
  ------------------
  |  Branch (1012:17): [True: 5.84k, False: 1.00k]
  ------------------
 1013|  5.84k|        if (!encode_fn(w1->poly + i, &pkt))
  ------------------
  |  Branch (1013:13): [True: 0, False: 5.84k]
  ------------------
 1014|      0|            goto err;
 1015|  1.00k|    ret = 1;
 1016|  1.00k|err:
 1017|  1.00k|    WPACKET_finish(&pkt);
 1018|  1.00k|    return ret;
 1019|  1.00k|}
ml_dsa_encoders.c:poly_encode_10_bits:
  131|  2.59k|{
  132|  2.59k|    uint8_t *out;
  133|  2.59k|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  2.59k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  134|       |
  135|  2.59k|    if (!WPACKET_allocate_bytes(pkt, POLY_COEFF_NUM_BYTES(10), &out))
  ------------------
  |  |   19|  2.59k|#define POLY_COEFF_NUM_BYTES(bits)  ((bits) * (ML_DSA_NUM_POLY_COEFFICIENTS / 8))
  |  |  ------------------
  |  |  |  |   11|  2.59k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  |  |  ------------------
  ------------------
  |  Branch (135:9): [True: 0, False: 2.59k]
  ------------------
  136|      0|        return 0;
  137|       |
  138|   166k|    do {
  139|   166k|        uint32_t c0 = *in++;
  140|   166k|        uint32_t c1 = *in++;
  141|   166k|        uint32_t c2 = *in++;
  142|   166k|        uint32_t c3 = *in++;
  143|       |
  144|   166k|        *out++ = (uint8_t)c0;
  145|   166k|        *out++ = (uint8_t)((c0 >> 8) | (c1 << 2));
  146|   166k|        *out++ = (uint8_t)((c1 >> 6) | (c2 << 4));
  147|   166k|        *out++ = (uint8_t)((c2 >> 4) | (c3 << 6));
  148|   166k|        *out++ = (uint8_t)(c3 >> 2);
  149|   166k|    } while (in < end);
  ------------------
  |  Branch (149:14): [True: 163k, False: 2.59k]
  ------------------
  150|  2.59k|    return 1;
  151|  2.59k|}
ml_dsa_encoders.c:poly_decode_10_bits:
  163|     32|{
  164|     32|    const uint8_t *in = NULL;
  165|     32|    uint32_t v, w, mask = 0x3ff; /* 10 bits */
  166|     32|    uint32_t *out = p->coeff, *end = out + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|     32|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  167|       |
  168|  2.04k|    do {
  169|  2.04k|        if (!PACKET_get_bytes(pkt, &in, 5))
  ------------------
  |  Branch (169:13): [True: 0, False: 2.04k]
  ------------------
  170|      0|            return 0;
  171|       |
  172|  2.04k|        in = OPENSSL_load_u32_le(&v, in);
  173|  2.04k|        w = *in;
  174|       |
  175|  2.04k|        *out++ = v & mask;
  176|  2.04k|        *out++ = (v >> 10) & mask;
  177|  2.04k|        *out++ = (v >> 20) & mask;
  178|  2.04k|        *out++ = (v >> 30) | (w << 2);
  179|  2.04k|    } while (out < end);
  ------------------
  |  Branch (179:14): [True: 2.01k, False: 32]
  ------------------
  180|     32|    return 1;
  181|     32|}
ml_dsa_encoders.c:poly_encode_signed_4:
  200|  1.38k|{
  201|  1.38k|    uint8_t *out;
  202|  1.38k|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  1.38k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  203|       |
  204|  1.38k|    if (!WPACKET_allocate_bytes(pkt, 32 * 4, &out))
  ------------------
  |  Branch (204:9): [True: 0, False: 1.38k]
  ------------------
  205|      0|        return 0;
  206|       |
  207|   177k|    do {
  208|   177k|        uint32_t z = mod_sub(4, *in++);
  209|       |
  210|   177k|        *out++ = z | (mod_sub(4, *in++) << 4);
  211|   177k|    } while (in < end);
  ------------------
  |  Branch (211:14): [True: 176k, False: 1.38k]
  ------------------
  212|  1.38k|    return 1;
  213|  1.38k|}
ml_dsa_encoders.c:poly_encode_signed_2:
  288|  3.53k|{
  289|  3.53k|    uint8_t *out;
  290|  3.53k|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  3.53k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  291|       |
  292|  3.53k|    if (!WPACKET_allocate_bytes(pkt, POLY_COEFF_NUM_BYTES(3), &out))
  ------------------
  |  |   19|  3.53k|#define POLY_COEFF_NUM_BYTES(bits)  ((bits) * (ML_DSA_NUM_POLY_COEFFICIENTS / 8))
  |  |  ------------------
  |  |  |  |   11|  3.53k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  |  |  ------------------
  ------------------
  |  Branch (292:9): [True: 0, False: 3.53k]
  ------------------
  293|      0|        return 0;
  294|       |
  295|   113k|    do {
  296|   113k|        uint32_t z;
  297|       |
  298|   113k|        z = mod_sub(2, *in++);
  299|   113k|        z |= mod_sub(2, *in++) << 3;
  300|   113k|        z |= mod_sub(2, *in++) << 6;
  301|   113k|        z |= mod_sub(2, *in++) << 9;
  302|   113k|        z |= mod_sub(2, *in++) << 12;
  303|   113k|        z |= mod_sub(2, *in++) << 15;
  304|   113k|        z |= mod_sub(2, *in++) << 18;
  305|   113k|        z |= mod_sub(2, *in++) << 21;
  306|       |
  307|   113k|        out = OPENSSL_store_u16_le(out, (uint16_t) z);
  308|   113k|        *out++ = (uint8_t) (z >> 16);
  309|   113k|    } while (in < end);
  ------------------
  |  Branch (309:14): [True: 109k, False: 3.53k]
  ------------------
  310|  3.53k|    return 1;
  311|  3.53k|}
ml_dsa_encoders.c:poly_encode_signed_two_to_power_12:
  387|  2.59k|{
  388|  2.59k|    static const uint32_t range = 1u << 12;
  389|  2.59k|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  2.59k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  390|       |
  391|  83.0k|    do {
  392|  83.0k|        uint8_t *out;
  393|  83.0k|        uint64_t a1, a2;
  394|       |
  395|  83.0k|        if (!WPACKET_allocate_bytes(pkt, 13, &out))
  ------------------
  |  Branch (395:13): [True: 0, False: 83.0k]
  ------------------
  396|      0|            return 0;
  397|       |
  398|  83.0k|        a1 = mod_sub_64(range, *in++);
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  399|  83.0k|        a1 |= mod_sub_64(range, *in++) << 13;
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  400|  83.0k|        a1 |= mod_sub_64(range, *in++) << 26;
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  401|  83.0k|        a1 |= mod_sub_64(range, *in++) << 39;
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  402|  83.0k|        a1 |= (a2 = mod_sub_64(range, *in++)) << 52;
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  403|  83.0k|        a2 = (a2 >> 12) | (mod_sub_64(range, *in++) << 1);
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  404|  83.0k|        a2 |= mod_sub_64(range, *in++) << 14;
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  405|  83.0k|        a2 |= mod_sub_64(range, *in++) << 27;
  ------------------
  |  |   21|  83.0k|#define mod_sub_64(a, b) ((uint64_t) mod_sub(a, b))
  ------------------
  406|       |
  407|  83.0k|        out = OPENSSL_store_u64_le(out, a1);
  408|  83.0k|        out = OPENSSL_store_u32_le(out, (uint32_t) a2);
  409|  83.0k|        *out = (uint8_t) (a2 >> 32);
  410|  83.0k|    } while (in < end);
  ------------------
  |  Branch (410:14): [True: 80.4k, False: 2.59k]
  ------------------
  411|  2.59k|    return 1;
  412|  2.59k|}
ml_dsa_encoders.c:poly_decode_signed_4:
  226|      8|{
  227|      8|    int i, ret = 0;
  228|      8|    uint32_t v, *out = p->coeff;
  229|      8|    const uint8_t *in;
  230|      8|    uint32_t msbs, mask;
  231|       |
  232|      8|    for (i = 0; i < (ML_DSA_NUM_POLY_COEFFICIENTS / 8); i++) {
  ------------------
  |  |   11|      8|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (232:17): [True: 8, False: 0]
  ------------------
  233|      8|        if (!PACKET_get_bytes(pkt, &in, 4))
  ------------------
  |  Branch (233:13): [True: 0, False: 8]
  ------------------
  234|      0|            goto err;
  235|      8|        in = OPENSSL_load_u32_le(&v, in);
  236|       |
  237|       |        /*
  238|       |         * None of the nibbles may be >= 9. So if the MSB of any nibble is set,
  239|       |         * none of the other bits may be set. First, select all the MSBs.
  240|       |         */
  241|      8|        msbs = v & 0x88888888u;
  242|       |        /* For each nibble where the MSB is set, form a mask of all the other bits. */
  243|      8|        mask = (msbs >> 1) | (msbs >> 2) | (msbs >> 3);
  244|       |        /*
  245|       |         * A nibble is only out of range in the case of invalid input, in which case
  246|       |         * it is okay to leak the value.
  247|       |         */
  248|      8|        if (value_barrier_32((mask & v) != 0))
  ------------------
  |  Branch (248:13): [True: 8, False: 0]
  ------------------
  249|      8|            goto err;
  250|       |
  251|      0|        *out++ = mod_sub(4, v & 15);
  252|      0|        *out++ = mod_sub(4, (v >> 4) & 15);
  253|      0|        *out++ = mod_sub(4, (v >> 8) & 15);
  254|      0|        *out++ = mod_sub(4, (v >> 12) & 15);
  255|      0|        *out++ = mod_sub(4, (v >> 16) & 15);
  256|      0|        *out++ = mod_sub(4, (v >> 20) & 15);
  257|      0|        *out++ = mod_sub(4, (v >> 24) & 15);
  258|      0|        *out++ = mod_sub(4, v >> 28);
  259|      0|    }
  260|      0|    ret = 1;
  261|      8| err:
  262|      8|    return ret;
  263|      0|}
ml_dsa_encoders.c:poly_decode_signed_2:
  324|      4|{
  325|      4|    int i, ret = 0;
  326|      4|    uint32_t u = 0, v = 0, *out = p->coeff;
  327|      4|    uint32_t msbs, mask;
  328|      4|    const uint8_t *in;
  329|       |
  330|      4|    for (i = 0; i < (ML_DSA_NUM_POLY_COEFFICIENTS / 8); i++) {
  ------------------
  |  |   11|      4|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (330:17): [True: 4, False: 0]
  ------------------
  331|      4|        if (!PACKET_get_bytes(pkt, &in, 3))
  ------------------
  |  Branch (331:13): [True: 0, False: 4]
  ------------------
  332|      0|            goto err;
  333|      4|        memcpy(&u, in, 3);
  334|      4|        OPENSSL_load_u32_le(&v, (uint8_t *)&u);
  335|       |
  336|       |        /*
  337|       |         * Each octal value (3 bits) must be <= 4, So if the MSB is set then the
  338|       |         * bottom 2 bits must not be set.
  339|       |         * First, select all the MSBs (Use octal representation for the mask)
  340|       |         */
  341|      4|        msbs = v & 044444444;
  342|       |        /* For each octal value where the MSB is set, form a mask of the 2 other bits. */
  343|      4|        mask = (msbs >> 1) | (msbs >> 2);
  344|       |        /*
  345|       |         * A nibble is only out of range in the case of invalid input, in which
  346|       |         * case it is okay to leak the value.
  347|       |         */
  348|      4|        if (value_barrier_32((mask & v) != 0))
  ------------------
  |  Branch (348:13): [True: 4, False: 0]
  ------------------
  349|      4|            goto err;
  350|       |
  351|      0|        *out++ = mod_sub(2, v & 7);
  352|      0|        *out++ = mod_sub(2, (v >> 3) & 7);
  353|      0|        *out++ = mod_sub(2, (v >> 6) & 7);
  354|      0|        *out++ = mod_sub(2, (v >> 9) & 7);
  355|      0|        *out++ = mod_sub(2, (v >> 12) & 7);
  356|      0|        *out++ = mod_sub(2, (v >> 15) & 7);
  357|      0|        *out++ = mod_sub(2, (v >> 18) & 7);
  358|      0|        *out++ = mod_sub(2, (v >> 21) & 7);
  359|      0|    }
  360|      0|    ret = 1;
  361|      4| err:
  362|      4|    return ret;
  363|      0|}
ml_dsa_encoders.c:poly_encode_signed_two_to_power_19:
  476|    729|{
  477|    729|    static const uint32_t range = 1u << 19;
  478|    729|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|    729|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  479|       |
  480|  46.6k|    do {
  481|  46.6k|        uint32_t z0, z1, z2;
  482|  46.6k|        uint8_t *out;
  483|       |
  484|  46.6k|        if (!WPACKET_allocate_bytes(pkt, 10, &out))
  ------------------
  |  Branch (484:13): [True: 0, False: 46.6k]
  ------------------
  485|      0|            return 0;
  486|       |
  487|  46.6k|        z0 = mod_sub(range, *in++);
  488|  46.6k|        z0 |= (z1 = mod_sub(range, *in++)) << 20;
  489|  46.6k|        z1 = (z1 >> 12) | (mod_sub(range, *in++) << 8);
  490|  46.6k|        z1 |= (z2 = mod_sub(range, *in++)) << 28;
  491|       |
  492|  46.6k|        out = OPENSSL_store_u32_le(out, z0);
  493|  46.6k|        out = OPENSSL_store_u32_le(out, z1);
  494|  46.6k|        out = OPENSSL_store_u16_le(out, (uint16_t) (z2 >> 4));
  495|  46.6k|    } while (in < end);
  ------------------
  |  Branch (495:14): [True: 45.9k, False: 729]
  ------------------
  496|    729|    return 1;
  497|    729|}
ml_dsa_encoders.c:poly_encode_signed_two_to_power_17:
  557|    268|{
  558|    268|    static const uint32_t range = 1u << 17;
  559|    268|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|    268|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  560|       |
  561|  17.1k|    do {
  562|  17.1k|        uint8_t *out;
  563|  17.1k|        uint32_t z0, z1, z2;
  564|       |
  565|  17.1k|        if (!WPACKET_allocate_bytes(pkt, 9, &out))
  ------------------
  |  Branch (565:13): [True: 0, False: 17.1k]
  ------------------
  566|      0|            return 0;
  567|       |
  568|  17.1k|        z0 = mod_sub(range, *in++);
  569|  17.1k|        z0 |= (z1 = mod_sub(range, *in++)) << 18;
  570|  17.1k|        z1 = (z1 >> 14) | (mod_sub(range, *in++) << 4);
  571|  17.1k|        z1 |= (z2 = mod_sub(range, *in++)) << 22;
  572|       |
  573|  17.1k|        out = OPENSSL_store_u32_le(out, z0);
  574|  17.1k|        out = OPENSSL_store_u32_le(out, z1);
  575|  17.1k|        *out = z2 >> 10;
  576|  17.1k|    } while (in < end);
  ------------------
  |  Branch (576:14): [True: 16.8k, False: 268]
  ------------------
  577|    268|    return 1;
  578|    268|}
ml_dsa_encoders.c:hint_bits_encode:
  838|    190|{
  839|    190|    int i, j, k = hint->num_poly;
  840|    190|    size_t coeff_index = 0;
  841|    190|    POLY *p = hint->poly;
  842|    190|    uint8_t *data;
  843|       |
  844|    190|    if (!WPACKET_allocate_bytes(pkt, omega + k, &data))
  ------------------
  |  Branch (844:9): [True: 0, False: 190]
  ------------------
  845|      0|        return 0;
  846|    190|    memset(data, 0, omega + k);
  847|       |
  848|  1.31k|    for (i = 0; i < k; i++, p++) {
  ------------------
  |  Branch (848:17): [True: 1.12k, False: 190]
  ------------------
  849|   287k|        for (j = 0; j < ML_DSA_NUM_POLY_COEFFICIENTS; j++)
  ------------------
  |  |   11|   287k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (849:21): [True: 286k, False: 1.12k]
  ------------------
  850|   286k|            if (p->coeff[j] != 0)
  ------------------
  |  Branch (850:17): [True: 10.0k, False: 276k]
  ------------------
  851|  10.0k|                data[coeff_index++] = j;
  852|  1.12k|        data[omega + i] = (uint8_t)coeff_index;
  853|  1.12k|    }
  854|    190|    return 1;
  855|    190|}
ml_dsa_encoders.c:poly_decode_signed_two_to_power_19:
  509|  3.76k|{
  510|  3.76k|    int i, ret = 0;
  511|  3.76k|    uint32_t *out = p->coeff;
  512|  3.76k|    const uint8_t *in;
  513|  3.76k|    static const uint32_t range = 1u << 19;
  514|  3.76k|    static const uint32_t mask_20_bits = (1u << 20) - 1;
  515|       |
  516|   244k|    for (i = 0; i < (ML_DSA_NUM_POLY_COEFFICIENTS / 4); i++) {
  ------------------
  |  |   11|   244k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (516:17): [True: 241k, False: 3.76k]
  ------------------
  517|   241k|        uint32_t a1, a2;
  518|   241k|        uint16_t a3;
  519|       |
  520|   241k|        if (!PACKET_get_bytes(pkt, &in, 10))
  ------------------
  |  Branch (520:13): [True: 0, False: 241k]
  ------------------
  521|      0|            goto err;
  522|   241k|        in = OPENSSL_load_u32_le(&a1, in);
  523|   241k|        in = OPENSSL_load_u32_le(&a2, in);
  524|   241k|        in = OPENSSL_load_u16_le(&a3, in);
  525|       |
  526|   241k|        *out++ = mod_sub(range, a1 & mask_20_bits);
  527|   241k|        *out++ = mod_sub(range, (a1 >> 20) | ((a2 & 0xFF) << 12));
  528|   241k|        *out++ = mod_sub(range, (a2 >> 8) & mask_20_bits);
  529|   241k|        *out++ = mod_sub(range, (a2 >> 28) | (a3 << 4));
  530|   241k|    }
  531|  3.76k|    ret = 1;
  532|  3.76k| err:
  533|  3.76k|    return ret;
  534|  3.76k|}
ml_dsa_encoders.c:poly_decode_signed_two_to_power_17:
  590|  1.43k|{
  591|  1.43k|    uint32_t *out = p->coeff;
  592|  1.43k|    const uint32_t *end = out + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  1.43k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  593|  1.43k|    const uint8_t *in;
  594|  1.43k|    static const uint32_t range = 1u << 17;
  595|  1.43k|    static const uint32_t mask_18_bits = (1u << 18) - 1;
  596|       |
  597|  91.6k|    do {
  598|  91.6k|        uint32_t a1, a2, a3;
  599|       |
  600|  91.6k|        if (!PACKET_get_bytes(pkt, &in, 9))
  ------------------
  |  Branch (600:13): [True: 0, False: 91.6k]
  ------------------
  601|      0|            return 0;
  602|  91.6k|        in = OPENSSL_load_u32_le(&a1, in);
  603|  91.6k|        in = OPENSSL_load_u32_le(&a2, in);
  604|  91.6k|        a3 = (uint32_t) *in;
  605|       |
  606|  91.6k|        *out++ = mod_sub(range, a1 & mask_18_bits);
  607|  91.6k|        *out++ = mod_sub(range, (a1 >> 18) | ((a2 & 0xF) << 14));
  608|  91.6k|        *out++ = mod_sub(range, (a2 >> 4) & mask_18_bits);
  609|  91.6k|        *out++ = mod_sub(range, (a2 >> 22) | (a3 << 10));
  610|  91.6k|    } while (out < end);
  ------------------
  |  Branch (610:14): [True: 90.2k, False: 1.43k]
  ------------------
  611|  1.43k|    return 1;
  612|  1.43k|}
ml_dsa_encoders.c:hint_bits_decode:
  865|    190|{
  866|    190|    size_t coeff_index = 0, k = hint->num_poly;
  867|    190|    const uint8_t *in, *limits;
  868|    190|    POLY *p = hint->poly, *end = p + k;
  869|       |
  870|    190|    if (!PACKET_get_bytes(pkt, &in, omega)
  ------------------
  |  Branch (870:9): [True: 0, False: 190]
  ------------------
  871|    190|            || !PACKET_get_bytes(pkt, &limits, k))
  ------------------
  |  Branch (871:16): [True: 0, False: 190]
  ------------------
  872|      0|        return 0;
  873|       |
  874|    190|    vector_zero(hint); /* Set all coefficients to zero */
  875|       |
  876|  1.12k|    do {
  877|  1.12k|        const uint32_t limit = *limits++;
  878|  1.12k|        int last = -1;
  879|       |
  880|  1.12k|        if (limit < coeff_index || limit > omega)
  ------------------
  |  Branch (880:13): [True: 0, False: 1.12k]
  |  Branch (880:36): [True: 0, False: 1.12k]
  ------------------
  881|      0|            return 0;
  882|       |
  883|  11.1k|        while (coeff_index < limit) {
  ------------------
  |  Branch (883:16): [True: 10.0k, False: 1.12k]
  ------------------
  884|  10.0k|            int byte = in[coeff_index++];
  885|       |
  886|  10.0k|            if (last >= 0 && byte <= last)
  ------------------
  |  Branch (886:17): [True: 8.91k, False: 1.11k]
  |  Branch (886:30): [True: 0, False: 8.91k]
  ------------------
  887|      0|                return 0;
  888|  10.0k|            last = byte;
  889|  10.0k|            p->coeff[byte] = 1;
  890|  10.0k|        }
  891|  1.12k|    } while (++p < end);
  ------------------
  |  Branch (891:14): [True: 930, False: 190]
  ------------------
  892|       |
  893|  3.42k|    for (; coeff_index < omega; coeff_index++)
  ------------------
  |  Branch (893:12): [True: 3.23k, False: 190]
  ------------------
  894|  3.23k|        if (in[coeff_index] != 0)
  ------------------
  |  Branch (894:13): [True: 0, False: 3.23k]
  ------------------
  895|      0|            return 0;
  896|    190|    return 1;
  897|    190|}
ml_dsa_encoders.c:poly_encode_4_bits:
   54|  4.41k|{
   55|  4.41k|    uint8_t *out;
   56|  4.41k|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  4.41k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
   57|       |
   58|  4.41k|    if (!WPACKET_allocate_bytes(pkt, POLY_COEFF_NUM_BYTES(4), &out))
  ------------------
  |  |   19|  4.41k|#define POLY_COEFF_NUM_BYTES(bits)  ((bits) * (ML_DSA_NUM_POLY_COEFFICIENTS / 8))
  |  |  ------------------
  |  |  |  |   11|  4.41k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  |  |  ------------------
  ------------------
  |  Branch (58:9): [True: 0, False: 4.41k]
  ------------------
   59|      0|        return 0;
   60|       |
   61|   565k|    do {
   62|   565k|        uint32_t z0 = *in++;
   63|   565k|        uint32_t z1 = *in++;
   64|       |
   65|   565k|        *out++ = z0 | (z1 << 4);
   66|   565k|    } while (in < end);
  ------------------
  |  Branch (66:14): [True: 560k, False: 4.41k]
  ------------------
   67|  4.41k|    return 1;
   68|  4.41k|}
ml_dsa_encoders.c:poly_encode_6_bits:
   91|  1.43k|{
   92|  1.43k|    uint8_t *out;
   93|  1.43k|    const uint32_t *in = p->coeff, *end = in + ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  1.43k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
   94|       |
   95|  1.43k|    if (!WPACKET_allocate_bytes(pkt, POLY_COEFF_NUM_BYTES(6), &out))
  ------------------
  |  |   19|  1.43k|#define POLY_COEFF_NUM_BYTES(bits)  ((bits) * (ML_DSA_NUM_POLY_COEFFICIENTS / 8))
  |  |  ------------------
  |  |  |  |   11|  1.43k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  |  |  ------------------
  ------------------
  |  Branch (95:9): [True: 0, False: 1.43k]
  ------------------
   96|      0|        return 0;
   97|       |
   98|  91.6k|    do {
   99|  91.6k|        uint32_t c0 = *in++;
  100|  91.6k|        uint32_t c1 = *in++;
  101|  91.6k|        uint32_t c2 = *in++;
  102|  91.6k|        uint32_t c3 = *in++;
  103|       |
  104|  91.6k|        *out++ = c0 | (c1 << 6);
  105|  91.6k|        *out++ = (c1 >> 2) | (c2 << 4);
  106|  91.6k|        *out++ = (c2 >> 4) | (c3 << 2);
  107|  91.6k|    } while (in < end);
  ------------------
  |  Branch (107:14): [True: 90.2k, False: 1.43k]
  ------------------
  108|  1.43k|    return 1;
  109|  1.43k|}

ml_dsa_encoders.c:shake_xof:
   15|      5|{
   16|      5|    return (EVP_DigestInit_ex2(ctx, md, NULL) == 1
  ------------------
  |  Branch (16:13): [True: 5, False: 0]
  ------------------
   17|      5|            && EVP_DigestUpdate(ctx, in, in_len) == 1
  ------------------
  |  Branch (17:16): [True: 5, False: 0]
  ------------------
   18|      5|            && EVP_DigestSqueeze(ctx, out, out_len) == 1);
  ------------------
  |  Branch (18:16): [True: 5, False: 0]
  ------------------
   19|      5|}
ml_dsa_key.c:shake_xof:
   15|    888|{
   16|    888|    return (EVP_DigestInit_ex2(ctx, md, NULL) == 1
  ------------------
  |  Branch (16:13): [True: 888, False: 0]
  ------------------
   17|    888|            && EVP_DigestUpdate(ctx, in, in_len) == 1
  ------------------
  |  Branch (17:16): [True: 888, False: 0]
  ------------------
   18|    888|            && EVP_DigestSqueeze(ctx, out, out_len) == 1);
  ------------------
  |  Branch (18:16): [True: 888, False: 0]
  ------------------
   19|    888|}
ml_dsa_sample.c:shake_xof:
   15|  37.1k|{
   16|  37.1k|    return (EVP_DigestInit_ex2(ctx, md, NULL) == 1
  ------------------
  |  Branch (16:13): [True: 37.1k, False: 0]
  ------------------
   17|  37.1k|            && EVP_DigestUpdate(ctx, in, in_len) == 1
  ------------------
  |  Branch (17:16): [True: 37.1k, False: 0]
  ------------------
   18|  37.1k|            && EVP_DigestSqueeze(ctx, out, out_len) == 1);
  ------------------
  |  Branch (18:16): [True: 37.1k, False: 0]
  ------------------
   19|  37.1k|}
ml_dsa_sign.c:shake_xof_3:
   35|    380|{
   36|    380|    return EVP_DigestInit_ex2(ctx, md, NULL)
  ------------------
  |  Branch (36:12): [True: 380, False: 0]
  ------------------
   37|    380|        && EVP_DigestUpdate(ctx, in1, in1_len)
  ------------------
  |  Branch (37:12): [True: 380, False: 0]
  ------------------
   38|    380|        && EVP_DigestUpdate(ctx, in2, in2_len)
  ------------------
  |  Branch (38:12): [True: 380, False: 0]
  ------------------
   39|    380|        && EVP_DigestUpdate(ctx, in3, in3_len)
  ------------------
  |  Branch (39:12): [True: 380, False: 0]
  ------------------
   40|    380|        && EVP_DigestSqueeze(ctx, out, out_len);
  ------------------
  |  Branch (40:12): [True: 380, False: 0]
  ------------------
   41|    380|}
ml_dsa_sign.c:shake_xof_2:
   24|    816|{
   25|    816|    return EVP_DigestInit_ex2(ctx, md, NULL)
  ------------------
  |  Branch (25:12): [True: 816, False: 0]
  ------------------
   26|    816|        && EVP_DigestUpdate(ctx, in1, in1_len)
  ------------------
  |  Branch (26:12): [True: 816, False: 0]
  ------------------
   27|    816|        && EVP_DigestUpdate(ctx, in2, in2_len)
  ------------------
  |  Branch (27:12): [True: 816, False: 0]
  ------------------
   28|    816|        && EVP_DigestSqueeze(ctx, out, out_len);
  ------------------
  |  Branch (28:12): [True: 816, False: 0]
  ------------------
   29|    816|}

ossl_ml_dsa_key_params:
   22|     30|{
   23|     30|    return key->params;
   24|     30|}
ossl_ml_dsa_key_get_seed:
   28|      4|{
   29|      4|    return key->seed;
   30|      4|}
ossl_ml_dsa_set_prekey:
   40|    474|{
   41|    474|    int ret = 0;
   42|       |
   43|    474|    if (key == NULL
  ------------------
  |  Branch (43:9): [True: 0, False: 474]
  ------------------
   44|    474|        || key->pub_encoding != NULL
  ------------------
  |  Branch (44:12): [True: 0, False: 474]
  ------------------
   45|    474|        || key->priv_encoding != NULL
  ------------------
  |  Branch (45:12): [True: 0, False: 474]
  ------------------
   46|    474|        || (sk != NULL && sk_len != key->params->sk_len)
  ------------------
  |  Branch (46:13): [True: 0, False: 474]
  |  Branch (46:27): [True: 0, False: 0]
  ------------------
   47|    474|        || (seed != NULL && seed_len != ML_DSA_SEED_BYTES)
  ------------------
  |  |   21|      0|# define ML_DSA_SEED_BYTES 32
  ------------------
  |  Branch (47:13): [True: 0, False: 474]
  |  Branch (47:29): [True: 0, False: 0]
  ------------------
   48|    474|        || key->seed != NULL)
  ------------------
  |  Branch (48:12): [True: 0, False: 474]
  ------------------
   49|      0|        return 0;
   50|       |
   51|    474|    if (sk != NULL
  ------------------
  |  Branch (51:9): [True: 0, False: 474]
  ------------------
   52|    474|        && (key->priv_encoding = OPENSSL_memdup(sk, sk_len)) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (52:12): [True: 0, False: 0]
  ------------------
   53|      0|        goto end;
   54|    474|    if (seed != NULL
  ------------------
  |  Branch (54:9): [True: 0, False: 474]
  ------------------
   55|    474|        && (key->seed = OPENSSL_memdup(seed, seed_len)) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (55:12): [True: 0, False: 0]
  ------------------
   56|      0|        goto end;
   57|    474|    key->prov_flags |= flags_set;
   58|    474|    key->prov_flags &= ~flags_clr;
   59|    474|    ret = 1;
   60|       |
   61|    474| end:
   62|    474|    if (!ret) {
  ------------------
  |  Branch (62:9): [True: 0, False: 474]
  ------------------
   63|      0|        OPENSSL_free(key->priv_encoding);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   64|      0|        OPENSSL_free(key->seed);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|      0|        key->priv_encoding = key->seed = NULL;
   66|      0|    }
   67|    474|    return ret;
   68|    474|}
ossl_ml_dsa_key_new:
   80|    474|{
   81|    474|    ML_DSA_KEY *ret;
   82|    474|    const ML_DSA_PARAMS *params = ossl_ml_dsa_params_get(evp_type);
   83|       |
   84|    474|    if (params == NULL)
  ------------------
  |  Branch (84:9): [True: 0, False: 474]
  ------------------
   85|      0|        return NULL;
   86|       |
   87|    474|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|    474|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   88|    474|    if (ret != NULL) {
  ------------------
  |  Branch (88:9): [True: 474, False: 0]
  ------------------
   89|    474|        ret->libctx = libctx;
   90|    474|        ret->params = params;
   91|    474|        ret->prov_flags = ML_DSA_KEY_PROV_FLAGS_DEFAULT;
  ------------------
  |  |   51|    474|    (ML_DSA_KEY_PREFER_SEED | ML_DSA_KEY_RETAIN_SEED)
  |  |  ------------------
  |  |  |  |   47|    474|# define ML_DSA_KEY_PREFER_SEED (1 << 0)
  |  |  ------------------
  |  |                   (ML_DSA_KEY_PREFER_SEED | ML_DSA_KEY_RETAIN_SEED)
  |  |  ------------------
  |  |  |  |   48|    474|# define ML_DSA_KEY_RETAIN_SEED (1 << 1)
  |  |  ------------------
  ------------------
   92|    474|        ret->shake128_md = EVP_MD_fetch(libctx, "SHAKE-128", propq);
   93|    474|        ret->shake256_md = EVP_MD_fetch(libctx, "SHAKE-256", propq);
   94|    474|        if (ret->shake128_md == NULL || ret->shake256_md == NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 474]
  |  Branch (94:41): [True: 0, False: 474]
  ------------------
   95|      0|            goto err;
   96|    474|    }
   97|    474|    return ret;
   98|      0|err:
   99|      0|    ossl_ml_dsa_key_free(ret);
  100|      0|    return NULL;
  101|    474|}
ossl_ml_dsa_key_pub_alloc:
  104|    449|{
  105|    449|    if (key->t1.poly != NULL)
  ------------------
  |  Branch (105:9): [True: 0, False: 449]
  ------------------
  106|      0|        return 0;
  107|    449|    return vector_alloc(&key->t1, key->params->k);
  108|    449|}
ossl_ml_dsa_key_priv_alloc:
  111|    456|{
  112|    456|    size_t k = key->params->k, l = key->params->l;
  113|    456|    POLY *poly;
  114|       |
  115|    456|    if (key->s1.poly != NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 456]
  ------------------
  116|      0|        return 0;
  117|    456|    if (!vector_alloc(&key->s1, l + 2 * k))
  ------------------
  |  Branch (117:9): [True: 0, False: 456]
  ------------------
  118|      0|        return 0;
  119|       |
  120|    456|    poly = key->s1.poly;
  121|    456|    key->s1.num_poly = l;
  122|    456|    vector_init(&key->s2, poly + l, k);
  123|    456|    vector_init(&key->t0, poly + l + k, k);
  124|    456|    return 1;
  125|    456|}
ossl_ml_dsa_key_free:
  131|    474|{
  132|    474|    if (key == NULL)
  ------------------
  |  Branch (132:9): [True: 0, False: 474]
  ------------------
  133|      0|        return;
  134|       |
  135|    474|    EVP_MD_free(key->shake128_md);
  136|    474|    EVP_MD_free(key->shake256_md);
  137|    474|    ossl_ml_dsa_key_reset(key);
  138|    474|    OPENSSL_free(key);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|    474|}
ossl_ml_dsa_key_reset:
  145|    474|{
  146|       |    /*
  147|       |     * The allocation for |s1.poly| subsumes those for |s2| and |t0|, which we
  148|       |     * must not access after |s1|'s poly is freed.
  149|       |     */
  150|    474|    if (key->s1.poly != NULL) {
  ------------------
  |  Branch (150:9): [True: 456, False: 18]
  ------------------
  151|    456|        vector_zero(&key->s1);
  152|    456|        vector_zero(&key->s2);
  153|    456|        vector_zero(&key->t0);
  154|    456|        vector_free(&key->s1);
  155|    456|        key->s2.poly = NULL;
  156|    456|        key->t0.poly = NULL;
  157|    456|    }
  158|       |    /* The |t1| vector is public and allocated separately */
  159|    474|    vector_free(&key->t1);
  160|    474|    OPENSSL_cleanse(key->K, sizeof(key->K));
  161|    474|    OPENSSL_free(key->pub_encoding);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  162|    474|    key->pub_encoding = NULL;
  163|    474|    if (key->priv_encoding != NULL)
  ------------------
  |  Branch (163:9): [True: 444, False: 30]
  ------------------
  164|    444|        OPENSSL_clear_free(key->priv_encoding, key->params->sk_len);
  ------------------
  |  |  113|    444|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|    474|    key->priv_encoding = NULL;
  166|    474|    if (key->seed != NULL)
  ------------------
  |  Branch (166:9): [True: 444, False: 30]
  ------------------
  167|    444|        OPENSSL_clear_free(key->seed, ML_DSA_SEED_BYTES);
  ------------------
  |  |  113|    444|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  168|    474|    key->seed = NULL;
  169|    474|}
ossl_ml_dsa_key_equal:
  256|     20|{
  257|     20|    int key_checked = 0;
  258|       |
  259|     20|    if (key1->params != key2->params)
  ------------------
  |  Branch (259:9): [True: 0, False: 20]
  ------------------
  260|      0|        return 0;
  261|       |
  262|     20|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|     20|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|     20|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|     20|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (262:9): [True: 20, False: 0]
  ------------------
  263|     20|        if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|     20|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (263:13): [True: 20, False: 0]
  ------------------
  264|     20|            if (key1->pub_encoding != NULL && key2->pub_encoding != NULL) {
  ------------------
  |  Branch (264:17): [True: 20, False: 0]
  |  Branch (264:47): [True: 20, False: 0]
  ------------------
  265|     20|                if (memcmp(key1->pub_encoding, key2->pub_encoding,
  ------------------
  |  Branch (265:21): [True: 20, False: 0]
  ------------------
  266|     20|                                  key1->params->pk_len) != 0)
  267|     20|                    return 0;
  268|      0|                key_checked = 1;
  269|      0|            }
  270|     20|        }
  271|      0|        if (!key_checked
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      0|                && (selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (272:20): [True: 0, False: 0]
  ------------------
  273|      0|            if (key1->priv_encoding != NULL && key2->priv_encoding != NULL) {
  ------------------
  |  Branch (273:17): [True: 0, False: 0]
  |  Branch (273:48): [True: 0, False: 0]
  ------------------
  274|      0|                if (memcmp(key1->priv_encoding, key2->priv_encoding,
  ------------------
  |  Branch (274:21): [True: 0, False: 0]
  ------------------
  275|      0|                           key1->params->sk_len) != 0)
  276|      0|                    return 0;
  277|      0|                key_checked = 1;
  278|      0|            }
  279|      0|        }
  280|      0|        return key_checked;
  281|      0|    }
  282|      0|    return 1;
  283|     20|}
ossl_ml_dsa_key_has:
  286|     44|{
  287|     44|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|     44|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|     44|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|     44|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (287:9): [True: 44, False: 0]
  ------------------
  288|       |        /* Note that the public key always exists if there is a private key */
  289|     44|        if (ossl_ml_dsa_key_get_pub(key) == NULL)
  ------------------
  |  Branch (289:13): [True: 0, False: 44]
  ------------------
  290|      0|            return 0; /* No public key */
  291|     44|        if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0
  ------------------
  |  |  640|     44|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (291:13): [True: 0, False: 44]
  ------------------
  292|     44|                && ossl_ml_dsa_key_get_priv(key) == NULL)
  ------------------
  |  Branch (292:20): [True: 0, False: 0]
  ------------------
  293|      0|            return 0; /* No private key */
  294|     44|        return 1;
  295|     44|    }
  296|      0|    return 0;
  297|     44|}
ossl_ml_dsa_generate_key:
  458|    444|{
  459|    444|    size_t seed_len = ML_DSA_SEED_BYTES;
  ------------------
  |  |   21|    444|# define ML_DSA_SEED_BYTES 32
  ------------------
  460|    444|    uint8_t *sk;
  461|    444|    int ret;
  462|       |
  463|    444|    if (out->seed == NULL) {
  ------------------
  |  Branch (463:9): [True: 444, False: 0]
  ------------------
  464|    444|        if ((out->seed = OPENSSL_malloc(seed_len)) == NULL)
  ------------------
  |  |  102|    444|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (464:13): [True: 0, False: 444]
  ------------------
  465|      0|            return 0;
  466|    444|        if (RAND_priv_bytes_ex(out->libctx, out->seed, seed_len, 0) <= 0) {
  ------------------
  |  Branch (466:13): [True: 0, False: 444]
  ------------------
  467|      0|            OPENSSL_free(out->seed);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  468|      0|            out->seed = NULL;
  469|      0|            return 0;
  470|      0|        }
  471|    444|    }
  472|       |    /* We're generating from a seed, drop private prekey encoding */
  473|    444|    sk = out->priv_encoding;
  474|    444|    out->priv_encoding = NULL;
  475|    444|    if (sk == NULL) {
  ------------------
  |  Branch (475:9): [True: 444, False: 0]
  ------------------
  476|    444|        ret = keygen_internal(out);
  477|    444|    } else {
  478|      0|        if ((ret = keygen_internal(out)) != 0
  ------------------
  |  Branch (478:13): [True: 0, False: 0]
  ------------------
  479|      0|            && memcmp(out->priv_encoding, sk, out->params->sk_len) != 0) {
  ------------------
  |  Branch (479:16): [True: 0, False: 0]
  ------------------
  480|      0|            ret = 0;
  481|      0|            ossl_ml_dsa_key_reset(out);
  482|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |   73|      0|# define PROV_R_INVALID_KEY                               158
  ------------------
  483|      0|                           "explicit %s private key does not match seed",
  484|      0|                           out->params->alg);
  485|      0|        }
  486|      0|        OPENSSL_free(sk);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  487|      0|    }
  488|    444|    return ret;
  489|    444|}
ossl_ml_dsa_key_matches:
  502|    380|{
  503|    380|    return (key->params->evp_type == evp_type);
  504|    380|}
ossl_ml_dsa_key_get_pub:
  508|    238|{
  509|    238|    return key->pub_encoding;
  510|    238|}
ossl_ml_dsa_key_get_pub_len:
  514|    453|{
  515|    453|    return key->params->pk_len;
  516|    453|}
ossl_ml_dsa_key_get_collision_strength_bits:
  519|    449|{
  520|    449|    return key->params->bit_strength;
  521|    449|}
ossl_ml_dsa_key_get_security_category:
  524|    449|{
  525|    449|    return key->params->security_category;
  526|    449|}
ossl_ml_dsa_key_get_priv:
  530|    384|{
  531|    384|    return key->priv_encoding;
  532|    384|}
ossl_ml_dsa_key_get_priv_len:
  535|      4|{
  536|      4|    return key->params->sk_len;
  537|      4|}
ossl_ml_dsa_key_get_sig_len:
  540|    449|{
  541|    449|    return key->params->sig_len;
  542|    449|}
ossl_ml_dsa_key_get_name:
  550|    380|{
  551|    380|    return key->params->alg;
  552|    380|}
ml_dsa_key.c:public_from_private:
  313|    444|{
  314|    444|    const ML_DSA_PARAMS *params = key->params;
  315|    444|    uint32_t k = params->k, l = params->l;
  316|    444|    POLY *polys;
  317|    444|    MATRIX a_ntt;
  318|    444|    VECTOR s1_ntt;
  319|    444|    VECTOR t;
  320|       |
  321|    444|    polys = OPENSSL_malloc(sizeof(*polys) * (k + l + k * l));
  ------------------
  |  |  102|    444|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  322|    444|    if (polys == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 444]
  ------------------
  323|      0|        return 0;
  324|       |
  325|    444|    vector_init(&t, polys, k);
  326|    444|    vector_init(&s1_ntt, t.poly + k, l);
  327|    444|    matrix_init(&a_ntt, s1_ntt.poly + l, k, l);
  328|       |
  329|       |    /* Using rho generate A' = A in NTT form */
  330|    444|    if (!matrix_expand_A(md_ctx, key->shake128_md, key->rho, &a_ntt))
  ------------------
  |  Branch (330:9): [True: 0, False: 444]
  ------------------
  331|      0|        goto err;
  332|       |
  333|       |    /* t = NTT_inv(A' * NTT(s1)) + s2 */
  334|    444|    vector_copy(&s1_ntt, &key->s1);
  335|    444|    vector_ntt(&s1_ntt);
  336|       |
  337|    444|    matrix_mult_vector(&a_ntt, &s1_ntt, &t);
  338|    444|    vector_ntt_inverse(&t);
  339|    444|    vector_add(&t, &key->s2, &t);
  340|       |
  341|       |    /* Compress t */
  342|    444|    vector_power2_round(&t, t1, t0);
  343|       |
  344|       |    /* Zeroize secret */
  345|    444|    vector_zero(&s1_ntt);
  346|    444|err:
  347|    444|    OPENSSL_free(polys);
  ------------------
  |  |  115|    444|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  348|    444|    return 1;
  349|    444|}
ml_dsa_key.c:keygen_internal:
  411|    444|{
  412|    444|    int ret = 0;
  413|    444|    uint8_t augmented_seed[ML_DSA_SEED_BYTES + 2];
  414|    444|    uint8_t expanded_seed[ML_DSA_RHO_BYTES + ML_DSA_PRIV_SEED_BYTES + ML_DSA_K_BYTES];
  415|    444|    const uint8_t *const rho = expanded_seed; /* p = Public Random Seed */
  416|    444|    const uint8_t *const priv_seed = expanded_seed + ML_DSA_RHO_BYTES;
  ------------------
  |  |   28|    444|# define ML_DSA_RHO_BYTES 32   /* p = Public Random Seed */
  ------------------
  417|    444|    const uint8_t *const K = priv_seed + ML_DSA_PRIV_SEED_BYTES;
  ------------------
  |  |   29|    444|# define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
  ------------------
  418|    444|    const ML_DSA_PARAMS *params = out->params;
  419|    444|    EVP_MD_CTX *md_ctx = NULL;
  420|       |
  421|    444|    if (out->seed == NULL
  ------------------
  |  Branch (421:9): [True: 0, False: 444]
  ------------------
  422|    444|        || (md_ctx = EVP_MD_CTX_new()) == NULL
  ------------------
  |  Branch (422:12): [True: 0, False: 444]
  ------------------
  423|    444|        || !ossl_ml_dsa_key_pub_alloc(out)
  ------------------
  |  Branch (423:12): [True: 0, False: 444]
  ------------------
  424|    444|        || !ossl_ml_dsa_key_priv_alloc(out))
  ------------------
  |  Branch (424:12): [True: 0, False: 444]
  ------------------
  425|      0|        goto err;
  426|       |
  427|       |    /* augmented_seed = seed || k || l */
  428|    444|    memcpy(augmented_seed, out->seed, ML_DSA_SEED_BYTES);
  ------------------
  |  |   21|    444|# define ML_DSA_SEED_BYTES 32
  ------------------
  429|    444|    augmented_seed[ML_DSA_SEED_BYTES] = (uint8_t)params->k;
  ------------------
  |  |   21|    444|# define ML_DSA_SEED_BYTES 32
  ------------------
  430|    444|    augmented_seed[ML_DSA_SEED_BYTES + 1] = (uint8_t)params->l;
  ------------------
  |  |   21|    444|# define ML_DSA_SEED_BYTES 32
  ------------------
  431|       |    /* Expand the seed into p[32], p'[64], K[32] */
  432|    444|    if (!shake_xof(md_ctx, out->shake256_md, augmented_seed, sizeof(augmented_seed),
  ------------------
  |  Branch (432:9): [True: 0, False: 444]
  ------------------
  433|    444|                   expanded_seed, sizeof(expanded_seed)))
  434|      0|        goto err;
  435|       |
  436|    444|    memcpy(out->rho, rho, sizeof(out->rho));
  437|    444|    memcpy(out->K, K, sizeof(out->K));
  438|       |
  439|    444|    ret = vector_expand_S(md_ctx, out->shake256_md, params->eta, priv_seed, &out->s1, &out->s2)
  ------------------
  |  Branch (439:11): [True: 444, False: 0]
  ------------------
  440|    444|        && public_from_private(out, md_ctx, &out->t1, &out->t0)
  ------------------
  |  Branch (440:12): [True: 444, False: 0]
  ------------------
  441|    444|        && ossl_ml_dsa_pk_encode(out)
  ------------------
  |  Branch (441:12): [True: 444, False: 0]
  ------------------
  442|    444|        && shake_xof(md_ctx, out->shake256_md, out->pub_encoding, out->params->pk_len,
  ------------------
  |  Branch (442:12): [True: 444, False: 0]
  ------------------
  443|    444|                     out->tr, sizeof(out->tr))
  444|    444|        && ossl_ml_dsa_sk_encode(out);
  ------------------
  |  Branch (444:12): [True: 444, False: 0]
  ------------------
  445|       |
  446|    444|err:
  447|    444|    if (out->seed != NULL && (out->prov_flags & ML_DSA_KEY_RETAIN_SEED) == 0) {
  ------------------
  |  |   48|    444|# define ML_DSA_KEY_RETAIN_SEED (1 << 1)
  ------------------
  |  Branch (447:9): [True: 444, False: 0]
  |  Branch (447:30): [True: 0, False: 444]
  ------------------
  448|      0|        OPENSSL_clear_free(out->seed, ML_DSA_SEED_BYTES);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  449|      0|        out->seed = NULL;
  450|      0|    }
  451|    444|    EVP_MD_CTX_free(md_ctx);
  452|    444|    OPENSSL_cleanse(augmented_seed, sizeof(augmented_seed));
  453|    444|    OPENSSL_cleanse(expanded_seed, sizeof(expanded_seed));
  454|    444|    return ret;
  455|    444|}

ossl_ml_dsa_key_compress_power2_round:
   35|   664k|{
   36|   664k|    unsigned int mask;
   37|   664k|    uint32_t r0_adjusted, r1_adjusted;
   38|       |
   39|   664k|    *r1 = r >> ML_DSA_D_BITS;         /* top 13 bits */
  ------------------
  |  |   26|   664k|# define ML_DSA_D_BITS 13   /* The number of bits dropped from the public vector t */
  ------------------
   40|   664k|    *r0 = r - (*r1 << ML_DSA_D_BITS); /* The remainder mod q */
  ------------------
  |  |   26|   664k|# define ML_DSA_D_BITS 13   /* The number of bits dropped from the public vector t */
  ------------------
   41|       |
   42|   664k|    r0_adjusted = mod_sub(*r0, 1 << ML_DSA_D_BITS);
  ------------------
  |  |   26|   664k|# define ML_DSA_D_BITS 13   /* The number of bits dropped from the public vector t */
  ------------------
   43|   664k|    r1_adjusted = *r1 + 1;
   44|       |
   45|       |    /* Mask is set iff r0 > (2^(dropped_bits))/2. */
   46|   664k|    mask = constant_time_lt((uint32_t)(1 << (ML_DSA_D_BITS - 1)), *r0);
  ------------------
  |  |   26|   664k|# define ML_DSA_D_BITS 13   /* The number of bits dropped from the public vector t */
  ------------------
   47|       |    /* r0 = mask ? r0_adjusted : r0 */
   48|   664k|    *r0 = constant_time_select_int(mask, r0_adjusted, *r0);
   49|       |    /* r1 = mask ? r1_adjusted : r1 */
   50|   664k|    *r1 = constant_time_select_int(mask, r1_adjusted, *r1);
   51|   664k|}
ossl_ml_dsa_key_compress_high_bits:
   63|  3.28M|{
   64|  3.28M|    int32_t r1 = (r + 127) >> 7;
   65|       |
   66|  3.28M|    if (gamma2 == ML_DSA_GAMMA2_Q_MINUS1_DIV32) {
  ------------------
  |  |   54|  3.28M|# define ML_DSA_GAMMA2_Q_MINUS1_DIV32 ((ML_DSA_Q - 1) / 32)
  |  |  ------------------
  |  |  |  |   18|  3.28M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  |  |  ------------------
  ------------------
  |  Branch (66:9): [True: 2.47M, False: 803k]
  ------------------
   67|  2.47M|        r1 = (r1 * 1025 + (1 << 21)) >> 22;
   68|  2.47M|        r1 &= 15; /* mod 16 */
   69|  2.47M|        return r1;
   70|  2.47M|    } else {
   71|   803k|        r1 = (r1 * 11275 + (1 << 23)) >> 24;
   72|   803k|        r1 ^= ((43 - r1) >> 31) & r1;
   73|   803k|        return r1;
   74|   803k|    }
   75|  3.28M|}
ossl_ml_dsa_key_compress_decompose:
   88|  1.49M|{
   89|  1.49M|    *r1 = ossl_ml_dsa_key_compress_high_bits(r, gamma2);
   90|       |
   91|  1.49M|    *r0 = r - *r1 * 2 * (int32_t)gamma2;
   92|  1.49M|    *r0 -= (((int32_t)ML_DSA_Q_MINUS1_DIV2 - *r0) >> 31) & (int32_t)ML_DSA_Q;
  ------------------
  |  |   19|  1.49M|# define ML_DSA_Q_MINUS1_DIV2 ((ML_DSA_Q - 1) / 2)
  |  |  ------------------
  |  |  |  |   18|  1.49M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  |  |  ------------------
  ------------------
                  *r0 -= (((int32_t)ML_DSA_Q_MINUS1_DIV2 - *r0) >> 31) & (int32_t)ML_DSA_Q;
  ------------------
  |  |   18|  1.49M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
   93|  1.49M|}
ossl_ml_dsa_key_compress_low_bits:
  105|  1.21M|{
  106|  1.21M|    uint32_t r1;
  107|  1.21M|    int32_t r0;
  108|       |
  109|  1.21M|    ossl_ml_dsa_key_compress_decompose(r, gamma2, &r1, &r0);
  110|  1.21M|    return r0;
  111|  1.21M|}
ossl_ml_dsa_key_compress_make_hint:
  135|   287k|{
  136|   287k|    uint32_t r_plus_z = mod_sub(w, cs2);
  137|   287k|    uint32_t r = reduce_once(r_plus_z + ct0);
  138|       |
  139|   287k|    return  ossl_ml_dsa_key_compress_high_bits(r, gamma2)
  140|   287k|        !=  ossl_ml_dsa_key_compress_high_bits(r_plus_z, gamma2);
  141|   287k|}
ossl_ml_dsa_key_compress_use_hint:
  156|   286k|{
  157|   286k|    uint32_t r1;
  158|   286k|    int32_t r0;
  159|       |
  160|   286k|    ossl_ml_dsa_key_compress_decompose(r, gamma2, &r1, &r0);
  161|       |
  162|   286k|    if (hint == 0)
  ------------------
  |  Branch (162:9): [True: 276k, False: 10.0k]
  ------------------
  163|   276k|        return r1;
  164|       |
  165|  10.0k|    if (gamma2 == ((ML_DSA_Q - 1) / 32)) {
  ------------------
  |  |   18|  10.0k|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  |  Branch (165:9): [True: 5.85k, False: 4.18k]
  ------------------
  166|       |        /* m = 16, thus |mod m| in the spec turns into |& 15| */
  167|  5.85k|        return r0 > 0 ? (r1 + 1) & 15 : (r1 - 1) & 15;
  ------------------
  |  Branch (167:16): [True: 2.86k, False: 2.98k]
  ------------------
  168|  5.85k|    } else {
  169|       |        /* m = 44 if gamma2 = ((q - 1) / 88) */
  170|  4.18k|        if (r0 > 0)
  ------------------
  |  Branch (170:13): [True: 2.03k, False: 2.14k]
  ------------------
  171|  2.03k|            return (r1 == 43) ? 0 : r1 + 1;
  ------------------
  |  Branch (171:20): [True: 55, False: 1.98k]
  ------------------
  172|  2.14k|        else
  173|  2.14k|            return (r1 == 0) ? 43 : r1 - 1;
  ------------------
  |  Branch (173:20): [True: 47, False: 2.09k]
  ------------------
  174|  4.18k|    }
  175|  10.0k|}

ml_dsa_encoders.c:mod_sub:
  128|  3.51M|{
  129|  3.51M|    return reduce_once(ML_DSA_Q + a - b);
  ------------------
  |  |   18|  3.51M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  130|  3.51M|}
ml_dsa_encoders.c:reduce_once:
  112|  3.51M|{
  113|  3.51M|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  3.51M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  3.51M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|  3.51M|}
ml_dsa_key.c:reduce_once:
  112|   664k|{
  113|   664k|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|   664k|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|   664k|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|   664k|}
ml_dsa_key_compress.c:mod_sub:
  128|   952k|{
  129|   952k|    return reduce_once(ML_DSA_Q + a - b);
  ------------------
  |  |   18|   952k|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  130|   952k|}
ml_dsa_key_compress.c:reduce_once:
  112|  1.24M|{
  113|  1.24M|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  1.24M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  1.24M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|  1.24M|}
ml_dsa_matrix.c:reduce_once:
  112|  11.9M|{
  113|  11.9M|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  11.9M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  11.9M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|  11.9M|}
ml_dsa_ntt.c:reduce_once:
  112|  97.0M|{
  113|  97.0M|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  97.0M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  97.0M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|  97.0M|}
ml_dsa_ntt.c:mod_sub:
  128|  13.2M|{
  129|  13.2M|    return reduce_once(ML_DSA_Q + a - b);
  ------------------
  |  |   18|  13.2M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  130|  13.2M|}
ml_dsa_sample.c:mod_sub:
  128|  1.30M|{
  129|  1.30M|    return reduce_once(ML_DSA_Q + a - b);
  ------------------
  |  |   18|  1.30M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  130|  1.30M|}
ml_dsa_sample.c:reduce_once:
  112|  1.30M|{
  113|  1.30M|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  1.30M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  1.30M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|  1.30M|}
ml_dsa_sign.c:reduce_once:
  112|  2.57M|{
  113|  2.57M|    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  2.57M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
                  return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
  ------------------
  |  |   18|  2.57M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  114|  2.57M|}
ml_dsa_sign.c:mod_sub:
  128|  1.49M|{
  129|  1.49M|    return reduce_once(ML_DSA_Q + a - b);
  ------------------
  |  |   18|  1.49M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  130|  1.49M|}
ml_dsa_sign.c:abs_mod_prime:
  146|  1.61M|{
  147|  1.61M|    return constant_time_select_32(constant_time_lt_32(ML_DSA_Q_MINUS1_DIV2, x),
  ------------------
  |  |   19|  1.61M|# define ML_DSA_Q_MINUS1_DIV2 ((ML_DSA_Q - 1) / 2)
  |  |  ------------------
  |  |  |  |   18|  1.61M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  |  |  ------------------
  ------------------
  148|  1.61M|                                                       ML_DSA_Q - x, x);
  ------------------
  |  |   18|  1.61M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  149|  1.61M|}
ml_dsa_sign.c:maximum:
  156|  2.82M|{
  157|  2.82M|    return constant_time_select_int(constant_time_lt(x, y), y, x);
  158|  2.82M|}
ml_dsa_sign.c:abs_signed:
  137|  1.21M|{
  138|  1.21M|    return constant_time_select_32(constant_time_lt_32(x, 0x80000000), x, 0u - x);
  139|  1.21M|}

ossl_ml_dsa_matrix_mult_vector:
   25|  1.45k|{
   26|  1.45k|    size_t i, j;
   27|  1.45k|    POLY *poly = a->m_poly;
   28|       |
   29|  1.45k|    vector_zero(t);
   30|       |
   31|  9.89k|    for (i = 0; i < a->k; i++) {
  ------------------
  |  Branch (31:17): [True: 8.44k, False: 1.45k]
  ------------------
   32|  55.0k|        for (j = 0; j < a->l; j++) {
  ------------------
  |  Branch (32:21): [True: 46.5k, False: 8.44k]
  ------------------
   33|  46.5k|            POLY product;
   34|       |
   35|  46.5k|            ossl_ml_dsa_poly_ntt_mult(poly++, &s->poly[j], &product);
   36|  46.5k|            poly_add(&product, &t->poly[i], &t->poly[i]);
   37|  46.5k|        }
   38|  8.44k|    }
   39|  1.45k|}

ml_dsa_key.c:matrix_init:
   27|    444|{
   28|    444|    m->k = k;
   29|    444|    m->l = l;
   30|    444|    m->m_poly = polys;
   31|    444|}
ml_dsa_key.c:matrix_expand_A:
   42|    444|{
   43|    444|    return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out);
   44|    444|}
ml_dsa_key.c:matrix_mult_vector:
   35|    444|{
   36|    444|    ossl_ml_dsa_matrix_mult_vector(a, s, t);
   37|    444|}
ml_dsa_sign.c:matrix_init:
   27|    380|{
   28|    380|    m->k = k;
   29|    380|    m->l = l;
   30|    380|    m->m_poly = polys;
   31|    380|}
ml_dsa_sign.c:matrix_expand_A:
   42|    380|{
   43|    380|    return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out);
   44|    380|}
ml_dsa_sign.c:matrix_mult_vector:
   35|  1.00k|{
   36|  1.00k|    ossl_ml_dsa_matrix_mult_vector(a, s, t);
   37|  1.00k|}

ossl_ml_dsa_poly_ntt_mult:
  112|  57.7k|{
  113|  57.7k|    int i;
  114|       |
  115|  14.8M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  14.8M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (115:17): [True: 14.7M, False: 57.7k]
  ------------------
  116|  14.7M|        out->coeff[i] =
  117|  14.7M|            reduce_montgomery((uint64_t)lhs->coeff[i] * (uint64_t)rhs->coeff[i]);
  118|  57.7k|}
ossl_ml_dsa_poly_ntt:
  130|  12.8k|{
  131|  12.8k|    int i, j, k;
  132|  12.8k|    int step;
  133|  12.8k|    int offset = ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  12.8k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  134|       |
  135|       |    /* Step: 1, 2, 4, 8, ..., 128 */
  136|   116k|    for (step = 1; step < ML_DSA_NUM_POLY_COEFFICIENTS; step <<= 1) {
  ------------------
  |  |   11|   116k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (136:20): [True: 103k, False: 12.8k]
  ------------------
  137|   103k|        k = 0;
  138|   103k|        offset >>= 1; /* Offset: 128, 64, 32, 16, ..., 1 */
  139|  3.39M|        for (i = 0; i < step; i++) {
  ------------------
  |  Branch (139:21): [True: 3.28M, False: 103k]
  ------------------
  140|  3.28M|            const uint32_t z_step_root = zetas_montgomery[step + i];
  141|       |
  142|  16.4M|            for (j = k; j < k + offset; j++) {
  ------------------
  |  Branch (142:25): [True: 13.2M, False: 3.28M]
  ------------------
  143|  13.2M|                uint32_t w_even = p->coeff[j];
  144|  13.2M|                uint32_t t_odd =
  145|  13.2M|                    reduce_montgomery((uint64_t)z_step_root
  146|  13.2M|                                      * (uint64_t)p->coeff[j + offset]);
  147|       |
  148|  13.2M|                p->coeff[j] = reduce_once(w_even + t_odd);
  149|  13.2M|                p->coeff[j + offset] = mod_sub(w_even, t_odd);
  150|  13.2M|            }
  151|  3.28M|            k += 2 * offset;
  152|  3.28M|        }
  153|   103k|    }
  154|  12.8k|}
ossl_ml_dsa_poly_ntt_inverse:
  164|  18.4k|{
  165|       |    /*
  166|       |     * Step: 128, 64, 32, 16, ..., 1
  167|       |     * Offset: 1, 2, 4, 8, ..., 128
  168|       |     */
  169|  18.4k|    int i, j, k, offset, step = ML_DSA_NUM_POLY_COEFFICIENTS;
  ------------------
  |  |   11|  18.4k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  170|       |    /*
  171|       |     * The multiplicative inverse of 256 mod q, in Montgomery form is
  172|       |     * ((256^-1 mod q) * ((2^32 * 2^32) mod q)) mod q = (8347681 * 2365951) mod 8380417
  173|       |     */
  174|  18.4k|    static const uint32_t inverse_degree_montgomery = 41978;
  175|       |
  176|   166k|    for (offset = 1; offset < ML_DSA_NUM_POLY_COEFFICIENTS; offset <<= 1) {
  ------------------
  |  |   11|   166k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (176:22): [True: 147k, False: 18.4k]
  ------------------
  177|   147k|        step >>= 1;
  178|   147k|        k = 0;
  179|  4.86M|        for (i = 0; i < step; i++) {
  ------------------
  |  Branch (179:21): [True: 4.71M, False: 147k]
  ------------------
  180|  4.71M|            const uint32_t step_root =
  181|  4.71M|                ML_DSA_Q - zetas_montgomery[step + (step - 1 - i)];
  ------------------
  |  |   18|  4.71M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  182|       |
  183|  23.6M|            for (j = k; j < k + offset; j++) {
  ------------------
  |  Branch (183:25): [True: 18.9M, False: 4.71M]
  ------------------
  184|  18.9M|                uint32_t even = p->coeff[j];
  185|  18.9M|                uint32_t odd = p->coeff[j + offset];
  186|       |
  187|  18.9M|                p->coeff[j] = reduce_once(odd + even);
  188|  18.9M|                p->coeff[j + offset] =
  189|  18.9M|                    reduce_montgomery((uint64_t)step_root
  190|  18.9M|                                      * (uint64_t)(ML_DSA_Q + even - odd));
  ------------------
  |  |   18|  18.9M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
  191|  18.9M|            }
  192|  4.71M|            k += 2 * offset;
  193|  4.71M|        }
  194|   147k|    }
  195|  4.75M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  4.75M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (195:17): [True: 4.73M, False: 18.4k]
  ------------------
  196|  4.73M|        p->coeff[i] = reduce_montgomery((uint64_t)p->coeff[i] *
  197|  4.73M|                                        (uint64_t)inverse_degree_montgomery);
  198|  18.4k|}
ml_dsa_ntt.c:reduce_montgomery:
   94|  51.6M|{
   95|  51.6M|    uint64_t t = (uint32_t)a * (uint32_t)ML_DSA_Q_NEG_INV; /* a * -qinv */
  ------------------
  |  |   23|  51.6M|# define ML_DSA_Q_NEG_INV 4236238847 /* Inverse of -q modulo 2^32 */
  ------------------
   96|  51.6M|    uint64_t b = a + t * ML_DSA_Q; /* a - t * q */
  ------------------
  |  |   18|  51.6M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
   97|  51.6M|    uint32_t c = b >> 32; /* /2^32  = 0..2q */
   98|       |
   99|  51.6M|    return reduce_once(c); /* 0..q */
  100|  51.6M|}

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

ml_dsa_key.c:poly_add:
   35|  2.59k|{
   36|  2.59k|    int i;
   37|       |
   38|   667k|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|   667k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (38:17): [True: 664k, False: 2.59k]
  ------------------
   39|   664k|        out->coeff[i] = reduce_once(lhs->coeff[i] + rhs->coeff[i]);
   40|  2.59k|}
ml_dsa_key.c:poly_power2_round:
  103|  2.59k|{
  104|  2.59k|    int i;
  105|       |
  106|   667k|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|   667k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (106:17): [True: 664k, False: 2.59k]
  ------------------
  107|   664k|        ossl_ml_dsa_key_compress_power2_round(t->coeff[i],
  108|   664k|                                              t1->coeff + i, t0->coeff + i);
  109|  2.59k|}
ml_dsa_matrix.c:poly_add:
   35|  46.5k|{
   36|  46.5k|    int i;
   37|       |
   38|  11.9M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  11.9M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (38:17): [True: 11.9M, False: 46.5k]
  ------------------
   39|  11.9M|        out->coeff[i] = reduce_once(lhs->coeff[i] + rhs->coeff[i]);
   40|  46.5k|}
ml_dsa_sample.c:poly_zero:
   20|  1.00k|{
   21|  1.00k|    memset(p->coeff, 0, sizeof(*p));
   22|  1.00k|}
ml_dsa_sign.c:poly_expand_mask:
   86|  4.20k|{
   87|  4.20k|    return ossl_ml_dsa_poly_expand_mask(out, seed, seed_len, gamma1, h_ctx, md);
   88|  4.20k|}
ml_dsa_sign.c:poly_high_bits:
  122|  4.72k|{
  123|  4.72k|    int i;
  124|       |
  125|  1.21M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  1.21M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (125:17): [True: 1.21M, False: 4.72k]
  ------------------
  126|  1.21M|        out->coeff[i] = ossl_ml_dsa_key_compress_high_bits(in->coeff[i], gamma2);
  127|  4.72k|}
ml_dsa_sign.c:poly_sample_in_ball_ntt:
   76|  1.00k|{
   77|  1.00k|    if (!ossl_ml_dsa_poly_sample_in_ball(out, seed, seed_len, h_ctx, md, tau))
  ------------------
  |  Branch (77:9): [True: 0, False: 1.00k]
  ------------------
   78|      0|        return 0;
   79|  1.00k|    poly_ntt(out);
   80|  1.00k|    return 1;
   81|  1.00k|}
ml_dsa_sign.c:poly_ntt:
   69|  1.00k|{
   70|  1.00k|    ossl_ml_dsa_poly_ntt(p);
   71|  1.00k|}
ml_dsa_sign.c:poly_add:
   35|  4.20k|{
   36|  4.20k|    int i;
   37|       |
   38|  1.08M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  1.08M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (38:17): [True: 1.07M, False: 4.20k]
  ------------------
   39|  1.07M|        out->coeff[i] = reduce_once(lhs->coeff[i] + rhs->coeff[i]);
   40|  4.20k|}
ml_dsa_sign.c:poly_sub:
   53|  5.84k|{
   54|  5.84k|    int i;
   55|       |
   56|  1.50M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  1.50M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (56:17): [True: 1.49M, False: 5.84k]
  ------------------
   57|  1.49M|        out->coeff[i] = mod_sub(lhs->coeff[i], rhs->coeff[i]);
   58|  5.84k|}
ml_dsa_sign.c:poly_low_bits:
  131|  4.72k|{
  132|  4.72k|    int i;
  133|       |
  134|  1.21M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|  1.21M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (134:17): [True: 1.21M, False: 4.72k]
  ------------------
  135|  1.21M|        out->coeff[i] = ossl_ml_dsa_key_compress_low_bits(in->coeff[i], gamma2);
  136|  4.72k|}
ml_dsa_sign.c:poly_max:
  162|  6.32k|{
  163|  6.32k|    int i;
  164|       |
  165|  1.62M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++) {
  ------------------
  |  |   11|  1.62M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (165:17): [True: 1.61M, False: 6.32k]
  ------------------
  166|  1.61M|        uint32_t c = p->coeff[i];
  167|  1.61M|        uint32_t abs = abs_mod_prime(c);
  168|       |
  169|  1.61M|        *mx = maximum(*mx, abs);
  170|  1.61M|    }
  171|  6.32k|}
ml_dsa_sign.c:poly_max_signed:
  175|  4.72k|{
  176|  4.72k|    int i;
  177|       |
  178|  1.21M|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++) {
  ------------------
  |  |   11|  1.21M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (178:17): [True: 1.21M, False: 4.72k]
  ------------------
  179|  1.21M|        uint32_t c = p->coeff[i];
  180|  1.21M|        uint32_t abs = abs_signed(c);
  181|       |
  182|  1.21M|        *mx = maximum(*mx, abs);
  183|  1.21M|    }
  184|  4.72k|}
ml_dsa_sign.c:poly_make_hint:
  141|  1.12k|{
  142|  1.12k|    int i;
  143|       |
  144|   288k|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|   288k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (144:17): [True: 287k, False: 1.12k]
  ------------------
  145|   287k|        out->coeff[i] = ossl_ml_dsa_key_compress_make_hint(ct0->coeff[i],
  146|   287k|                                                           cs2->coeff[i],
  147|   287k|                                                           gamma2, w->coeff[i]);
  148|  1.12k|}
ml_dsa_sign.c:poly_scale_power2_round:
  113|  1.12k|{
  114|  1.12k|    int i;
  115|       |
  116|   287k|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|   287k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (116:17): [True: 286k, False: 1.12k]
  ------------------
  117|   286k|        out->coeff[i] = (in->coeff[i] << ML_DSA_D_BITS);
  ------------------
  |  |   26|   286k|# define ML_DSA_D_BITS 13   /* The number of bits dropped from the public vector t */
  ------------------
  118|  1.12k|}
ml_dsa_sign.c:poly_use_hint:
  152|  1.12k|{
  153|  1.12k|    int i;
  154|       |
  155|   287k|    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
  ------------------
  |  |   11|   287k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (155:17): [True: 286k, False: 1.12k]
  ------------------
  156|   286k|        out->coeff[i] = ossl_ml_dsa_key_compress_use_hint(h->coeff[i],
  157|   286k|                                                          r->coeff[i], gamma2);
  158|  1.12k|}

ossl_ml_dsa_matrix_expand_A:
  202|    824|{
  203|    824|    int ret = 0;
  204|    824|    size_t i, j;
  205|    824|    uint8_t derived_seed[ML_DSA_RHO_BYTES + 2];
  206|    824|    POLY *poly = out->m_poly;
  207|       |
  208|       |    /* The seed used for each matrix element is rho + column_index + row_index */
  209|    824|    memcpy(derived_seed, rho, ML_DSA_RHO_BYTES);
  ------------------
  |  |   28|    824|# define ML_DSA_RHO_BYTES 32   /* p = Public Random Seed */
  ------------------
  210|       |
  211|  5.66k|    for (i = 0; i < out->k; i++) {
  ------------------
  |  Branch (211:17): [True: 4.83k, False: 824]
  ------------------
  212|  31.8k|        for (j = 0; j < out->l; j++) {
  ------------------
  |  Branch (212:21): [True: 27.0k, False: 4.83k]
  ------------------
  213|  27.0k|            derived_seed[ML_DSA_RHO_BYTES + 1] = (uint8_t)i;
  ------------------
  |  |   28|  27.0k|# define ML_DSA_RHO_BYTES 32   /* p = Public Random Seed */
  ------------------
  214|  27.0k|            derived_seed[ML_DSA_RHO_BYTES] = (uint8_t)j;
  ------------------
  |  |   28|  27.0k|# define ML_DSA_RHO_BYTES 32   /* p = Public Random Seed */
  ------------------
  215|       |            /* Generate the polynomial for each matrix element using a unique seed */
  216|  27.0k|            if (!rej_ntt_poly(g_ctx, md, derived_seed, sizeof(derived_seed), poly++))
  ------------------
  |  Branch (216:17): [True: 0, False: 27.0k]
  ------------------
  217|      0|                goto err;
  218|  27.0k|        }
  219|  4.83k|    }
  220|    824|    ret = 1;
  221|    824|err:
  222|    824|    return ret;
  223|    824|}
ossl_ml_dsa_vector_expand_S:
  245|    444|{
  246|    444|    int ret = 0;
  247|    444|    size_t i;
  248|    444|    size_t l = s1->num_poly;
  249|    444|    size_t k = s2->num_poly;
  250|    444|    uint8_t derived_seed[ML_DSA_PRIV_SEED_BYTES + 2];
  251|    444|    COEFF_FROM_NIBBLE_FUNC *coef_from_nibble_fn;
  252|       |
  253|    444|    coef_from_nibble_fn = (eta == ML_DSA_ETA_4) ? coeff_from_nibble_4 : coeff_from_nibble_2;
  ------------------
  |  |   42|    444|# define ML_DSA_ETA_4 4
  ------------------
  |  Branch (253:27): [True: 126, False: 318]
  ------------------
  254|       |
  255|       |    /*
  256|       |     * Each polynomial generated uses a unique seed that consists of
  257|       |     * seed + counter (where the counter is 2 bytes starting at 0)
  258|       |     */
  259|    444|    memcpy(derived_seed, seed, ML_DSA_PRIV_SEED_BYTES);
  ------------------
  |  |   29|    444|# define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
  ------------------
  260|    444|    derived_seed[ML_DSA_PRIV_SEED_BYTES] = 0;
  ------------------
  |  |   29|    444|# define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
  ------------------
  261|    444|    derived_seed[ML_DSA_PRIV_SEED_BYTES + 1] = 0;
  ------------------
  |  |   29|    444|# define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
  ------------------
  262|       |
  263|  2.77k|    for (i = 0; i < l; i++) {
  ------------------
  |  Branch (263:17): [True: 2.32k, False: 444]
  ------------------
  264|  2.32k|        if (!rej_bounded_poly(h_ctx, md, coef_from_nibble_fn,
  ------------------
  |  Branch (264:13): [True: 0, False: 2.32k]
  ------------------
  265|  2.32k|                              derived_seed, sizeof(derived_seed), &s1->poly[i]))
  266|      0|            goto err;
  267|  2.32k|        ++derived_seed[ML_DSA_PRIV_SEED_BYTES];
  ------------------
  |  |   29|  2.32k|# define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
  ------------------
  268|  2.32k|    }
  269|  3.04k|    for (i = 0; i < k; i++) {
  ------------------
  |  Branch (269:17): [True: 2.59k, False: 444]
  ------------------
  270|  2.59k|        if (!rej_bounded_poly(h_ctx, md, coef_from_nibble_fn,
  ------------------
  |  Branch (270:13): [True: 0, False: 2.59k]
  ------------------
  271|  2.59k|                              derived_seed, sizeof(derived_seed), &s2->poly[i]))
  272|      0|            goto err;
  273|  2.59k|        ++derived_seed[ML_DSA_PRIV_SEED_BYTES];
  ------------------
  |  |   29|  2.59k|# define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
  ------------------
  274|  2.59k|    }
  275|    444|    ret = 1;
  276|    444|err:
  277|    444|    return ret;
  278|    444|}
ossl_ml_dsa_poly_expand_mask:
  284|  4.20k|{
  285|  4.20k|    uint8_t buf[32 * 20];
  286|  4.20k|    size_t buf_len = 32 * (gamma1 == ML_DSA_GAMMA1_TWO_POWER_19 ? 20 : 18);
  ------------------
  |  |   48|  4.20k|# define ML_DSA_GAMMA1_TWO_POWER_19 (1 << 19)
  ------------------
  |  Branch (286:28): [True: 3.03k, False: 1.16k]
  ------------------
  287|       |
  288|  4.20k|    return shake_xof(h_ctx, md, seed, seed_len, buf, buf_len)
  ------------------
  |  Branch (288:12): [True: 4.20k, False: 0]
  ------------------
  289|  4.20k|        && ossl_ml_dsa_poly_decode_expand_mask(out, buf, buf_len, gamma1);
  ------------------
  |  Branch (289:12): [True: 4.20k, False: 0]
  ------------------
  290|  4.20k|}
ossl_ml_dsa_poly_sample_in_ball:
  309|  1.00k|{
  310|  1.00k|    uint8_t block[SHAKE256_BLOCKSIZE];
  311|  1.00k|    uint64_t signs;
  312|  1.00k|    int offset = 8;
  313|  1.00k|    size_t end;
  314|       |
  315|       |    /*
  316|       |     * Rather than squeeze 8 bytes followed by lots of 1 byte squeezes
  317|       |     * the SHAKE blocksize is squeezed each time and buffered into 'block'.
  318|       |     */
  319|  1.00k|    if (!shake_xof(h_ctx, md, seed, seed_len, block, sizeof(block)))
  ------------------
  |  Branch (319:9): [True: 0, False: 1.00k]
  ------------------
  320|      0|        return 0;
  321|       |
  322|       |    /*
  323|       |     * grab the first 64 bits - since tau < 64
  324|       |     * Each bit gives a +1 or -1 value.
  325|       |     */
  326|  1.00k|    OPENSSL_load_u64_le(&signs, block);
  327|       |
  328|  1.00k|    poly_zero(out_c);
  329|       |
  330|       |    /* Loop tau times */
  331|  49.6k|    for (end = 256 - tau; end < 256; end++) {
  ------------------
  |  Branch (331:27): [True: 48.6k, False: 1.00k]
  ------------------
  332|  48.6k|        size_t index; /* index is a random offset to write +1 or -1 */
  333|       |
  334|       |        /* rejection sample in {0..end} to choose an index to place -1 or 1 into */
  335|  54.0k|        for (;;) {
  336|  54.0k|            if (offset == sizeof(block)) {
  ------------------
  |  Branch (336:17): [True: 0, False: 54.0k]
  ------------------
  337|       |                /* squeeze another block if the bytes from block have been used */
  338|      0|                if (!EVP_DigestSqueeze(h_ctx, block, sizeof(block)))
  ------------------
  |  Branch (338:21): [True: 0, False: 0]
  ------------------
  339|      0|                    return 0;
  340|      0|                offset = 0;
  341|      0|            }
  342|       |
  343|  54.0k|            index = block[offset++];
  344|  54.0k|            if (index <= end)
  ------------------
  |  Branch (344:17): [True: 48.6k, False: 5.39k]
  ------------------
  345|  48.6k|                break;
  346|  54.0k|        }
  347|       |
  348|       |        /*
  349|       |         * In-place swap the coefficient we are about to replace to the end so
  350|       |         * we don't lose any values that have been already written.
  351|       |         */
  352|  48.6k|        out_c->coeff[end] = out_c->coeff[index];
  353|       |        /* set the random coefficient value to either 1 or q-1 */
  354|  48.6k|        out_c->coeff[index] = mod_sub(1, 2 * (signs & 1));
  355|  48.6k|        signs >>= 1; /* grab the next random bit */
  356|  48.6k|    }
  357|  1.00k|    return 1;
  358|  1.00k|}
ml_dsa_sample.c:rej_ntt_poly:
  118|  27.0k|{
  119|  27.0k|    int j = 0;
  120|  27.0k|    uint8_t blocks[SHAKE128_BLOCKSIZE], *b, *end = blocks + sizeof(blocks);
  121|       |
  122|       |    /*
  123|       |     * Instead of just squeezing 3 bytes at a time, we grab a whole block
  124|       |     * Note that the shake128 blocksize of 168 is divisible by 3.
  125|       |     */
  126|  27.0k|    if (!shake_xof(g_ctx, md, seed, seed_len, blocks, sizeof(blocks)))
  ------------------
  |  Branch (126:9): [True: 0, False: 27.0k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|   135k|    while (1) {
  ------------------
  |  Branch (129:12): [Folded - Ignored]
  ------------------
  130|  7.03M|        for (b = blocks; b < end; b += 3) {
  ------------------
  |  Branch (130:26): [True: 6.92M, False: 108k]
  ------------------
  131|  6.92M|            if (coeff_from_three_bytes(b, &(out->coeff[j]))) {
  ------------------
  |  Branch (131:17): [True: 6.92M, False: 6.53k]
  ------------------
  132|  6.92M|                if (++j >= ML_DSA_NUM_POLY_COEFFICIENTS)
  ------------------
  |  |   11|  6.92M|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (132:21): [True: 27.0k, False: 6.89M]
  ------------------
  133|  27.0k|                    return 1;   /* finished */
  134|  6.92M|            }
  135|  6.92M|        }
  136|   108k|        if (!EVP_DigestSqueeze(g_ctx, blocks, sizeof(blocks)))
  ------------------
  |  Branch (136:13): [True: 0, False: 108k]
  ------------------
  137|      0|            return 0;
  138|   108k|    }
  139|  27.0k|}
ml_dsa_sample.c:coeff_from_three_bytes:
   49|  6.92M|{
   50|       |    /* Zero out the top bit of the 3rd byte to get a value in the range 0..2^23-1) */
   51|  6.92M|    *out = (uint32_t)s[0] | ((uint32_t)s[1] << 8) | (((uint32_t)s[2] & 0x7f) << 16);
   52|  6.92M|    return *out < ML_DSA_Q;
  ------------------
  |  |   18|  6.92M|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  ------------------
   53|  6.92M|}
ml_dsa_sample.c:coeff_from_nibble_4:
   66|   630k|{
   67|       |    /*
   68|       |     * This is not constant time but will not leak any important info since
   69|       |     * the value is either chosen or thrown away.
   70|       |     */
   71|   630k|    if (value_barrier_32(nibble < 9)) {
  ------------------
  |  Branch (71:9): [True: 354k, False: 275k]
  ------------------
   72|   354k|        *out = mod_sub(4, nibble);
   73|   354k|        return 1;
   74|   354k|    }
   75|   275k|    return 0;
   76|   630k|}
ml_dsa_sample.c:coeff_from_nibble_2:
   89|   965k|{
   90|   965k|    if (value_barrier_32(nibble < 15)) {
  ------------------
  |  Branch (90:9): [True: 905k, False: 60.1k]
  ------------------
   91|   905k|        *out = mod_sub(2, MOD5(nibble));
  ------------------
  |  |   26|   905k|#define MOD5(n) ((n) - 5 * (0x3335 * (n) >> 16))
  ------------------
   92|   905k|        return 1;
   93|   905k|    }
   94|  60.1k|    return 0;
   95|   965k|}
ml_dsa_sample.c:rej_bounded_poly:
  161|  4.92k|{
  162|  4.92k|    int j = 0;
  163|  4.92k|    uint32_t z0, z1;
  164|  4.92k|    uint8_t blocks[SHAKE256_BLOCKSIZE], *b, *end = blocks + sizeof(blocks);
  165|       |
  166|       |    /* Instead of just squeezing 1 byte at a time, we grab a whole block */
  167|  4.92k|    if (!shake_xof(h_ctx, md, seed, seed_len, blocks, sizeof(blocks)))
  ------------------
  |  Branch (167:9): [True: 0, False: 4.92k]
  ------------------
  168|      0|        return 0;
  169|       |
  170|  8.16k|    while (1) {
  ------------------
  |  Branch (170:12): [Folded - Ignored]
  ------------------
  171|   802k|        for (b = blocks; b < end; b++) {
  ------------------
  |  Branch (171:26): [True: 799k, False: 3.23k]
  ------------------
  172|   799k|            z0 = *b & 0x0F; /* lower nibble of byte */
  173|   799k|            z1 = *b >> 4;   /* high nibble of byte */
  174|       |
  175|   799k|            if (coef_from_nibble(z0, &out->coeff[j])
  ------------------
  |  Branch (175:17): [True: 631k, False: 168k]
  ------------------
  176|   799k|                    && ++j >= ML_DSA_NUM_POLY_COEFFICIENTS)
  ------------------
  |  |   11|   631k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (176:24): [True: 2.42k, False: 628k]
  ------------------
  177|  2.42k|                return 1;
  178|   796k|            if (coef_from_nibble(z1, &out->coeff[j])
  ------------------
  |  Branch (178:17): [True: 629k, False: 167k]
  ------------------
  179|   796k|                    && ++j >= ML_DSA_NUM_POLY_COEFFICIENTS)
  ------------------
  |  |   11|   629k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (179:24): [True: 2.50k, False: 626k]
  ------------------
  180|  2.50k|                return 1;
  181|   796k|        }
  182|  3.23k|        if (!EVP_DigestSqueeze(h_ctx, blocks, sizeof(blocks)))
  ------------------
  |  Branch (182:13): [True: 0, False: 3.23k]
  ------------------
  183|      0|            return 0;
  184|  3.23k|    }
  185|  4.92k|}

ossl_ml_dsa_mu_init:
   71|    380|{
   72|    380|    EVP_MD_CTX *md_ctx;
   73|    380|    uint8_t itb[2];
   74|       |
   75|    380|    if (key == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 380]
  ------------------
   76|      0|        return NULL;
   77|       |
   78|    380|    md_ctx = EVP_MD_CTX_new();
   79|    380|    if (md_ctx == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 380]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|       |    /* H(.. */
   83|    380|    if (!EVP_DigestInit_ex2(md_ctx, key->shake256_md, NULL))
  ------------------
  |  Branch (83:9): [True: 0, False: 380]
  ------------------
   84|      0|        goto err;
   85|       |    /* ..pk (= key->tr) */
   86|    380|    if (!EVP_DigestUpdate(md_ctx, key->tr, sizeof(key->tr)))
  ------------------
  |  Branch (86:9): [True: 0, False: 380]
  ------------------
   87|      0|        goto err;
   88|       |    /* M' = .. */
   89|    380|    if (encode) {
  ------------------
  |  Branch (89:9): [True: 380, False: 0]
  ------------------
   90|    380|        if (ctx_len > ML_DSA_MAX_CONTEXT_STRING_LEN)
  ------------------
  |  |   20|    380|# define ML_DSA_MAX_CONTEXT_STRING_LEN 255
  ------------------
  |  Branch (90:13): [True: 0, False: 380]
  ------------------
   91|      0|            goto err;
   92|       |        /* IntegerToBytes(0, 1) .. */
   93|    380|        itb[0] = 0;
   94|       |        /* || IntegerToBytes(|ctx|, 1) || .. */
   95|    380|        itb[1] = (uint8_t)ctx_len;
   96|    380|        if (!EVP_DigestUpdate(md_ctx, itb, 2))
  ------------------
  |  Branch (96:13): [True: 0, False: 380]
  ------------------
   97|      0|            goto err;
   98|       |        /* ctx || .. */
   99|    380|        if (!EVP_DigestUpdate(md_ctx, ctx, ctx_len))
  ------------------
  |  Branch (99:13): [True: 0, False: 380]
  ------------------
  100|      0|            goto err;
  101|       |        /* .. msg) will follow in update and final functions */
  102|    380|    }
  103|       |
  104|    380|    return md_ctx;
  105|       |
  106|      0|err:
  107|      0|    EVP_MD_CTX_free(md_ctx);
  108|      0|    return NULL;
  109|    380|}
ossl_ml_dsa_mu_update:
  120|    380|{
  121|    380|    return EVP_DigestUpdate(md_ctx, msg, msg_len);
  122|    380|}
ossl_ml_dsa_mu_finalize:
  133|    380|{
  134|    380|    if (!ossl_assert(mu_len == ML_DSA_MU_BYTES)) {
  ------------------
  |  |   52|    380|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    380|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (134:9): [True: 0, False: 380]
  ------------------
  135|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_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)
  |  |  ------------------
  ------------------
  136|      0|        return 0;
  137|      0|    }
  138|    380|    return EVP_DigestSqueeze(md_ctx, mu, mu_len);
  139|    380|}
ossl_ml_dsa_sign:
  424|    380|{
  425|    380|    EVP_MD_CTX *md_ctx = NULL;
  426|    380|    uint8_t mu[ML_DSA_MU_BYTES];
  427|    380|    const uint8_t *mu_ptr = mu;
  428|    380|    size_t mu_len = sizeof(mu);
  429|    380|    int ret = 0;
  430|       |
  431|    380|    if (ossl_ml_dsa_key_get_priv(priv) == NULL)
  ------------------
  |  Branch (431:9): [True: 0, False: 380]
  ------------------
  432|      0|        return 0;
  433|       |
  434|    380|    if (sig_len != NULL)
  ------------------
  |  Branch (434:9): [True: 380, False: 0]
  ------------------
  435|    380|        *sig_len = priv->params->sig_len;
  436|       |
  437|    380|    if (sig == NULL)
  ------------------
  |  Branch (437:9): [True: 190, False: 190]
  ------------------
  438|    190|        return (sig_len != NULL) ? 1 : 0;
  ------------------
  |  Branch (438:16): [True: 190, False: 0]
  ------------------
  439|       |
  440|    190|    if (sig_size < priv->params->sig_len)
  ------------------
  |  Branch (440:9): [True: 0, False: 190]
  ------------------
  441|      0|        return 0;
  442|       |
  443|    190|    if (msg_is_mu) {
  ------------------
  |  Branch (443:9): [True: 0, False: 190]
  ------------------
  444|      0|        mu_ptr = msg;
  445|      0|        mu_len = msg_len;
  446|    190|    } else {
  447|    190|        md_ctx = ossl_ml_dsa_mu_init(priv, encode, context, context_len);
  448|    190|        if (md_ctx == NULL)
  ------------------
  |  Branch (448:13): [True: 0, False: 190]
  ------------------
  449|      0|            return 0;
  450|       |
  451|    190|        if (!ossl_ml_dsa_mu_update(md_ctx, msg, msg_len))
  ------------------
  |  Branch (451:13): [True: 0, False: 190]
  ------------------
  452|      0|            goto err;
  453|       |
  454|    190|        if (!ossl_ml_dsa_mu_finalize(md_ctx, mu, mu_len))
  ------------------
  |  Branch (454:13): [True: 0, False: 190]
  ------------------
  455|      0|            goto err;
  456|    190|    }
  457|       |
  458|    190|    ret = ml_dsa_sign_internal(priv, mu_ptr, mu_len, rand, rand_len, sig);
  459|       |
  460|    190|err:
  461|    190|    EVP_MD_CTX_free(md_ctx);
  462|    190|    return ret;
  463|    190|}
ossl_ml_dsa_verify:
  473|    190|{
  474|    190|    EVP_MD_CTX *md_ctx = NULL;
  475|    190|    uint8_t mu[ML_DSA_MU_BYTES];
  476|    190|    const uint8_t *mu_ptr = mu;
  477|    190|    size_t mu_len = sizeof(mu);
  478|    190|    int ret = 0;
  479|       |
  480|    190|    if (ossl_ml_dsa_key_get_pub(pub) == NULL)
  ------------------
  |  Branch (480:9): [True: 0, False: 190]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    190|    if (msg_is_mu) {
  ------------------
  |  Branch (483:9): [True: 0, False: 190]
  ------------------
  484|      0|        mu_ptr = msg;
  485|      0|        mu_len = msg_len;
  486|    190|    } else {
  487|    190|        md_ctx = ossl_ml_dsa_mu_init(pub, encode, context, context_len);
  488|    190|        if (md_ctx == NULL)
  ------------------
  |  Branch (488:13): [True: 0, False: 190]
  ------------------
  489|      0|            return 0;
  490|       |
  491|    190|        if (!ossl_ml_dsa_mu_update(md_ctx, msg, msg_len))
  ------------------
  |  Branch (491:13): [True: 0, False: 190]
  ------------------
  492|      0|            goto err;
  493|       |
  494|    190|        if (!ossl_ml_dsa_mu_finalize(md_ctx, mu, mu_len))
  ------------------
  |  Branch (494:13): [True: 0, False: 190]
  ------------------
  495|      0|            goto err;
  496|    190|    }
  497|       |
  498|    190|    ret = ml_dsa_verify_internal(pub, mu_ptr, mu_len, sig, sig_len);
  499|    190|err:
  500|    190|    EVP_MD_CTX_free(md_ctx);
  501|    190|    return ret;
  502|    190|}
ml_dsa_sign.c:ml_dsa_sign_internal:
  159|    190|{
  160|    190|    int ret = 0;
  161|    190|    const ML_DSA_PARAMS *params = priv->params;
  162|    190|    EVP_MD_CTX *md_ctx = NULL;
  163|    190|    uint32_t k = params->k, l = params->l;
  164|    190|    uint32_t gamma1 = params->gamma1, gamma2 = params->gamma2;
  165|    190|    uint8_t *alloc = NULL, *w1_encoded;
  166|    190|    size_t alloc_len, w1_encoded_len;
  167|    190|    size_t num_polys_sig_k = 2 * k;
  168|    190|    size_t num_polys_k = 5 * k;
  169|    190|    size_t num_polys_l = 3 * l;
  170|    190|    size_t num_polys_k_by_l = k * l;
  171|    190|    POLY *p, *c_ntt;
  172|    190|    VECTOR s1_ntt, s2_ntt, t0_ntt, w, w1, cs1, cs2, y;
  173|    190|    MATRIX a_ntt;
  174|    190|    ML_DSA_SIG sig;
  175|    190|    uint8_t rho_prime[ML_DSA_RHO_PRIME_BYTES];
  176|    190|    uint8_t c_tilde[ML_DSA_MAX_LAMBDA / 4];
  177|    190|    size_t c_tilde_len = params->bit_strength >> 2;
  178|    190|    size_t kappa;
  179|       |
  180|    190|    if (mu_len != ML_DSA_MU_BYTES) {
  ------------------
  |  |   25|    190|# define ML_DSA_MU_BYTES 64 /* Size of the Hash for the message representative */
  ------------------
  |  Branch (180:9): [True: 0, False: 190]
  ------------------
  181|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_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)
  |  |  ------------------
  ------------------
  182|      0|        return 0;
  183|      0|    }
  184|       |
  185|       |    /*
  186|       |     * Allocate a single blob for most of the variable size temporary variables.
  187|       |     * Mostly used for VECTOR POLYNOMIALS (every POLY is 1K).
  188|       |     */
  189|    190|    w1_encoded_len = k * (gamma2 == ML_DSA_GAMMA2_Q_MINUS1_DIV88 ? 192 : 128);
  ------------------
  |  |   55|    190|# define ML_DSA_GAMMA2_Q_MINUS1_DIV88 ((ML_DSA_Q - 1) / 88)
  |  |  ------------------
  |  |  |  |   18|    190|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  |  |  ------------------
  ------------------
  |  Branch (189:27): [True: 67, False: 123]
  ------------------
  190|    190|    alloc_len = w1_encoded_len
  191|    190|        + sizeof(*p) * (1 + num_polys_k + num_polys_l
  192|    190|                        + num_polys_k_by_l + num_polys_sig_k);
  193|    190|    alloc = OPENSSL_malloc(alloc_len);
  ------------------
  |  |  102|    190|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    190|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    190|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  194|    190|    if (alloc == NULL)
  ------------------
  |  Branch (194:9): [True: 0, False: 190]
  ------------------
  195|      0|        return 0;
  196|    190|    md_ctx = EVP_MD_CTX_new();
  197|    190|    if (md_ctx == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 190]
  ------------------
  198|      0|        goto err;
  199|       |
  200|    190|    w1_encoded = alloc;
  201|       |    /* Init the temp vectors to point to the allocated polys blob */
  202|    190|    p = (POLY *)(w1_encoded + w1_encoded_len);
  203|    190|    c_ntt = p++;
  204|    190|    matrix_init(&a_ntt, p, k, l);
  205|    190|    p += num_polys_k_by_l;
  206|    190|    vector_init(&s2_ntt, p, k);
  207|    190|    vector_init(&t0_ntt, s2_ntt.poly + k, k);
  208|    190|    vector_init(&w, t0_ntt.poly + k, k);
  209|    190|    vector_init(&w1, w.poly + k, k);
  210|    190|    vector_init(&cs2, w1.poly + k, k);
  211|    190|    p += num_polys_k;
  212|    190|    vector_init(&s1_ntt, p, l);
  213|    190|    vector_init(&y, p + l, l);
  214|    190|    vector_init(&cs1, p + 2 * l, l);
  215|    190|    p += num_polys_l;
  216|    190|    signature_init(&sig, p, k, p + k, l, c_tilde, c_tilde_len);
  217|       |    /* End of the allocated blob setup */
  218|       |
  219|    190|    if (!matrix_expand_A(md_ctx, priv->shake128_md, priv->rho, &a_ntt))
  ------------------
  |  Branch (219:9): [True: 0, False: 190]
  ------------------
  220|      0|        goto err;
  221|       |
  222|    190|    if (!shake_xof_3(md_ctx, priv->shake256_md, priv->K, sizeof(priv->K),
  ------------------
  |  Branch (222:9): [True: 0, False: 190]
  ------------------
  223|    190|                     rnd, rnd_len, mu, mu_len,
  224|    190|                     rho_prime, sizeof(rho_prime)))
  225|      0|        goto err;
  226|       |
  227|    190|    vector_copy(&s1_ntt, &priv->s1);
  228|    190|    vector_ntt(&s1_ntt);
  229|    190|    vector_copy(&s2_ntt, &priv->s2);
  230|    190|    vector_ntt(&s2_ntt);
  231|    190|    vector_copy(&t0_ntt, &priv->t0);
  232|    190|    vector_ntt(&t0_ntt);
  233|       |
  234|       |    /*
  235|       |     * kappa must not exceed 2^16. But the probability of it
  236|       |     * exceeding even 1000 iterations is vanishingly small.
  237|       |     */
  238|    816|    for (kappa = 0; ; kappa += l) {
  239|    816|        VECTOR *y_ntt = &cs1;
  240|    816|        VECTOR *r0 = &w1;
  241|    816|        VECTOR *ct0 = &w1;
  242|    816|        uint32_t z_max, r0_max, ct0_max, h_ones;
  243|       |
  244|    816|        vector_expand_mask(&y, rho_prime, sizeof(rho_prime), kappa,
  245|    816|                           gamma1, md_ctx, priv->shake256_md);
  246|    816|        vector_copy(y_ntt, &y);
  247|    816|        vector_ntt(y_ntt);
  248|       |
  249|    816|        matrix_mult_vector(&a_ntt, y_ntt, &w);
  250|    816|        vector_ntt_inverse(&w);
  251|       |
  252|    816|        vector_high_bits(&w, gamma2, &w1);
  253|    816|        ossl_ml_dsa_w1_encode(&w1, gamma2, w1_encoded, w1_encoded_len);
  254|       |
  255|    816|        if (!shake_xof_2(md_ctx, priv->shake256_md, mu, mu_len,
  ------------------
  |  Branch (255:13): [True: 0, False: 816]
  ------------------
  256|    816|                         w1_encoded, w1_encoded_len, c_tilde, c_tilde_len))
  257|      0|            break;
  258|       |
  259|    816|        if (!poly_sample_in_ball_ntt(c_ntt, c_tilde, c_tilde_len,
  ------------------
  |  Branch (259:13): [True: 0, False: 816]
  ------------------
  260|    816|                                     md_ctx, priv->shake256_md, params->tau))
  261|      0|            break;
  262|       |
  263|    816|        vector_mult_scalar(&s1_ntt, c_ntt, &cs1);
  264|    816|        vector_ntt_inverse(&cs1);
  265|    816|        vector_mult_scalar(&s2_ntt, c_ntt, &cs2);
  266|    816|        vector_ntt_inverse(&cs2);
  267|       |
  268|    816|        vector_add(&y, &cs1, &sig.z);
  269|       |
  270|       |        /* r0 = lowbits(w - cs2) */
  271|    816|        vector_sub(&w, &cs2, r0);
  272|    816|        vector_low_bits(r0, gamma2, r0);
  273|       |
  274|       |        /*
  275|       |         * Leaking that the signature is rejected is fine as the next attempt at a
  276|       |         * signature will be (indistinguishable from) independent of this one.
  277|       |         */
  278|    816|        z_max = vector_max(&sig.z);
  279|    816|        r0_max = vector_max_signed(r0);
  280|    816|        if (value_barrier_32(constant_time_ge(z_max, gamma1 - params->beta)
  ------------------
  |  Branch (280:13): [True: 625, False: 191]
  ------------------
  281|    816|                             | constant_time_ge(r0_max, gamma2 - params->beta)))
  282|    625|            continue;
  283|       |
  284|    191|        vector_mult_scalar(&t0_ntt, c_ntt, ct0);
  285|    191|        vector_ntt_inverse(ct0);
  286|    191|        vector_make_hint(ct0, &cs2, &w, gamma2, &sig.hint);
  287|       |
  288|    191|        ct0_max = vector_max(ct0);
  289|    191|        h_ones = vector_count_ones(&sig.hint);
  290|       |        /* Same reasoning applies to the leak as above */
  291|    191|        if (value_barrier_32(constant_time_ge(ct0_max, gamma2)
  ------------------
  |  Branch (291:13): [True: 1, False: 190]
  ------------------
  292|    191|                             | constant_time_lt(params->omega, h_ones)))
  293|      1|            continue;
  294|    190|        ret = ossl_ml_dsa_sig_encode(&sig, params, out_sig);
  295|    190|        break;
  296|    191|    }
  297|    190|err:
  298|    190|    EVP_MD_CTX_free(md_ctx);
  299|    190|    OPENSSL_clear_free(alloc, alloc_len);
  ------------------
  |  |  113|    190|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    190|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    190|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  300|    190|    OPENSSL_cleanse(rho_prime, sizeof(rho_prime));
  301|    190|    return ret;
  302|    190|}
ml_dsa_sign.c:signature_init:
   41|    380|{
   42|    380|    vector_init(&sig->z, z, l);
   43|    380|    vector_init(&sig->hint, hint, k);
   44|    380|    sig->c_tilde = c_tilde;
   45|    380|    sig->c_tilde_len = c_tilde_len;
   46|    380|}
ml_dsa_sign.c:ml_dsa_verify_internal:
  321|    190|{
  322|    190|    int ret = 0;
  323|    190|    uint8_t *alloc = NULL, *w1_encoded;
  324|    190|    POLY *p, *c_ntt;
  325|    190|    MATRIX a_ntt;
  326|    190|    VECTOR az_ntt, ct1_ntt, *z_ntt, *w1, *w_approx;
  327|    190|    ML_DSA_SIG sig;
  328|    190|    const ML_DSA_PARAMS *params = pub->params;
  329|    190|    uint32_t k = pub->params->k;
  330|    190|    uint32_t l = pub->params->l;
  331|    190|    uint32_t gamma2 = params->gamma2;
  332|    190|    size_t w1_encoded_len;
  333|    190|    size_t num_polys_sig = k + l;
  334|    190|    size_t num_polys_k = 2 * k;
  335|    190|    size_t num_polys_l = 1 * l;
  336|    190|    size_t num_polys_k_by_l = k * l;
  337|    190|    uint8_t c_tilde[ML_DSA_MAX_LAMBDA / 4];
  338|    190|    uint8_t c_tilde_sig[ML_DSA_MAX_LAMBDA / 4];
  339|    190|    EVP_MD_CTX *md_ctx = NULL;
  340|    190|    size_t c_tilde_len = params->bit_strength >> 2;
  341|    190|    uint32_t z_max;
  342|       |
  343|    190|    if (mu_len != ML_DSA_MU_BYTES) {
  ------------------
  |  |   25|    190|# define ML_DSA_MU_BYTES 64 /* Size of the Hash for the message representative */
  ------------------
  |  Branch (343:9): [True: 0, False: 190]
  ------------------
  344|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_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)
  |  |  ------------------
  ------------------
  345|      0|        return 0;
  346|      0|    }
  347|       |
  348|       |
  349|       |    /* Allocate space for all the POLYNOMIALS used by temporary VECTORS */
  350|    190|    w1_encoded_len = k * (gamma2 == ML_DSA_GAMMA2_Q_MINUS1_DIV88 ? 192 : 128);
  ------------------
  |  |   55|    190|# define ML_DSA_GAMMA2_Q_MINUS1_DIV88 ((ML_DSA_Q - 1) / 88)
  |  |  ------------------
  |  |  |  |   18|    190|# define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
  |  |  ------------------
  ------------------
  |  Branch (350:27): [True: 67, False: 123]
  ------------------
  351|    190|    alloc = OPENSSL_malloc(w1_encoded_len
  ------------------
  |  |  102|    190|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    190|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    190|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  352|    190|                           + sizeof(*p) * (1 + num_polys_k
  353|    190|                                           + num_polys_l
  354|    190|                                           + num_polys_k_by_l
  355|    190|                                           + num_polys_sig));
  356|    190|    if (alloc == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 190]
  ------------------
  357|      0|        return 0;
  358|    190|    md_ctx = EVP_MD_CTX_new();
  359|    190|    if (md_ctx == NULL)
  ------------------
  |  Branch (359:9): [True: 0, False: 190]
  ------------------
  360|      0|        goto err;
  361|       |
  362|    190|    w1_encoded = alloc;
  363|       |    /* Init the temp vectors to point to the allocated polys blob */
  364|    190|    p = (POLY *)(w1_encoded + w1_encoded_len);
  365|    190|    c_ntt = p++;
  366|    190|    matrix_init(&a_ntt, p, k, l);
  367|    190|    p += num_polys_k_by_l;
  368|    190|    signature_init(&sig, p, k, p + k, l, c_tilde_sig, c_tilde_len);
  369|    190|    p += num_polys_sig;
  370|    190|    vector_init(&az_ntt, p, k);
  371|    190|    vector_init(&ct1_ntt, p + k, k);
  372|       |
  373|    190|    if (!ossl_ml_dsa_sig_decode(&sig, sig_enc, sig_enc_len, pub->params)
  ------------------
  |  Branch (373:9): [True: 0, False: 190]
  ------------------
  374|    190|            || !matrix_expand_A(md_ctx, pub->shake128_md, pub->rho, &a_ntt))
  ------------------
  |  Branch (374:16): [True: 0, False: 190]
  ------------------
  375|      0|        goto err;
  376|       |
  377|       |    /* Compute verifiers challenge c_ntt = NTT(SampleInBall(c_tilde)) */
  378|    190|    if (!poly_sample_in_ball_ntt(c_ntt, c_tilde_sig, c_tilde_len,
  ------------------
  |  Branch (378:9): [True: 0, False: 190]
  ------------------
  379|    190|                                 md_ctx, pub->shake256_md, params->tau))
  380|      0|        goto err;
  381|       |
  382|       |    /* ct1_ntt = NTT(c) * NTT(t1 * 2^d) */
  383|    190|    vector_scale_power2_round_ntt(&pub->t1, &ct1_ntt);
  384|    190|    vector_mult_scalar(&ct1_ntt, c_ntt, &ct1_ntt);
  385|       |
  386|       |    /* compute z_max early in order to reuse sig.z */
  387|    190|    z_max = vector_max(&sig.z);
  388|       |
  389|       |    /* w_approx = NTT_inverse(A * NTT(z) - ct1_ntt) */
  390|    190|    z_ntt = &sig.z;
  391|    190|    vector_ntt(z_ntt);
  392|    190|    matrix_mult_vector(&a_ntt, z_ntt, &az_ntt);
  393|    190|    w_approx = &az_ntt;
  394|    190|    vector_sub(&az_ntt, &ct1_ntt, w_approx);
  395|    190|    vector_ntt_inverse(w_approx);
  396|       |
  397|       |    /* compute w1_encoded */
  398|    190|    w1 = w_approx;
  399|    190|    vector_use_hint(&sig.hint, w_approx, gamma2, w1);
  400|    190|    ossl_ml_dsa_w1_encode(w1, gamma2, w1_encoded, w1_encoded_len);
  401|       |
  402|    190|    if (!shake_xof_3(md_ctx, pub->shake256_md, mu, mu_len,
  ------------------
  |  Branch (402:9): [True: 0, False: 190]
  ------------------
  403|    190|                     w1_encoded, w1_encoded_len, NULL, 0, c_tilde, c_tilde_len))
  404|      0|        goto err;
  405|       |
  406|    190|    ret = (z_max < (uint32_t)(params->gamma1 - params->beta))
  ------------------
  |  Branch (406:11): [True: 190, False: 0]
  ------------------
  407|    190|        && memcmp(c_tilde, sig.c_tilde, c_tilde_len) == 0;
  ------------------
  |  Branch (407:12): [True: 190, False: 0]
  ------------------
  408|    190|err:
  409|    190|    OPENSSL_free(alloc);
  ------------------
  |  |  115|    190|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    190|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    190|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  410|    190|    EVP_MD_CTX_free(md_ctx);
  411|    190|    return ret;
  412|    190|}

ml_dsa_encoders.c:vector_zero:
   54|    190|{
   55|    190|    if (va->poly != NULL)
  ------------------
  |  Branch (55:9): [True: 190, False: 0]
  ------------------
   56|    190|        memset(va->poly, 0, va->num_poly * sizeof(va->poly[0]));
   57|    190|}
ml_dsa_key.c:vector_alloc:
   35|    905|{
   36|    905|    v->poly = OPENSSL_malloc(num_polys * sizeof(POLY));
  ------------------
  |  |  102|    905|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    905|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    905|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   37|    905|    if (v->poly == NULL)
  ------------------
  |  Branch (37:9): [True: 0, False: 905]
  ------------------
   38|      0|        return 0;
   39|    905|    v->num_poly = num_polys;
   40|    905|    return 1;
   41|    905|}
ml_dsa_key.c:vector_init:
   28|  1.80k|{
   29|  1.80k|    v->poly = polys;
   30|  1.80k|    v->num_poly = num_polys;
   31|  1.80k|}
ml_dsa_key.c:vector_zero:
   54|  1.81k|{
   55|  1.81k|    if (va->poly != NULL)
  ------------------
  |  Branch (55:9): [True: 1.81k, False: 0]
  ------------------
   56|  1.81k|        memset(va->poly, 0, va->num_poly * sizeof(va->poly[0]));
   57|  1.81k|}
ml_dsa_key.c:vector_free:
   45|    930|{
   46|    930|    OPENSSL_free(v->poly);
  ------------------
  |  |  115|    930|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    930|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    930|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|    930|    v->poly = NULL;
   48|    930|    v->num_poly = 0;
   49|    930|}
ml_dsa_key.c:vector_copy:
   65|    444|{
   66|    444|    assert(dst->num_poly == src->num_poly);
   67|    444|    memcpy(dst->poly, src->poly, src->num_poly * sizeof(src->poly[0]));
   68|    444|}
ml_dsa_key.c:vector_ntt:
  108|    444|{
  109|    444|    size_t i;
  110|       |
  111|  2.77k|    for (i = 0; i < va->num_poly; i++)
  ------------------
  |  Branch (111:17): [True: 2.32k, False: 444]
  ------------------
  112|  2.32k|        ossl_ml_dsa_poly_ntt(va->poly + i);
  113|    444|}
ml_dsa_key.c:vector_ntt_inverse:
  118|    444|{
  119|    444|    size_t i;
  120|       |
  121|  3.04k|    for (i = 0; i < va->num_poly; i++)
  ------------------
  |  Branch (121:17): [True: 2.59k, False: 444]
  ------------------
  122|  2.59k|        ossl_ml_dsa_poly_ntt_inverse(va->poly + i);
  123|    444|}
ml_dsa_key.c:vector_add:
   88|    444|{
   89|    444|    size_t i;
   90|       |
   91|  3.04k|    for (i = 0; i < lhs->num_poly; i++)
  ------------------
  |  Branch (91:17): [True: 2.59k, False: 444]
  ------------------
   92|  2.59k|        poly_add(lhs->poly + i, rhs->poly + i, out->poly + i);
   93|    444|}
ml_dsa_key.c:vector_power2_round:
  180|    444|{
  181|    444|    size_t i;
  182|       |
  183|  3.04k|    for (i = 0; i < t->num_poly; i++)
  ------------------
  |  Branch (183:17): [True: 2.59k, False: 444]
  ------------------
  184|  2.59k|        poly_power2_round(t->poly + i, t1->poly + i, t0->poly + i);
  185|    444|}
ml_dsa_key.c:vector_expand_S:
  138|    444|{
  139|    444|    return ossl_ml_dsa_vector_expand_S(h_ctx, md, eta, seed, s1, s2);
  140|    444|}
ml_dsa_matrix.c:vector_zero:
   54|  1.45k|{
   55|  1.45k|    if (va->poly != NULL)
  ------------------
  |  Branch (55:9): [True: 1.45k, False: 0]
  ------------------
   56|  1.45k|        memset(va->poly, 0, va->num_poly * sizeof(va->poly[0]));
   57|  1.45k|}
ml_dsa_sign.c:vector_init:
   28|  2.66k|{
   29|  2.66k|    v->poly = polys;
   30|  2.66k|    v->num_poly = num_polys;
   31|  2.66k|}
ml_dsa_sign.c:vector_copy:
   65|  1.38k|{
   66|  1.38k|    assert(dst->num_poly == src->num_poly);
   67|  1.38k|    memcpy(dst->poly, src->poly, src->num_poly * sizeof(src->poly[0]));
   68|  1.38k|}
ml_dsa_sign.c:vector_ntt:
  108|  1.76k|{
  109|  1.76k|    size_t i;
  110|       |
  111|  11.3k|    for (i = 0; i < va->num_poly; i++)
  ------------------
  |  Branch (111:17): [True: 9.55k, False: 1.76k]
  ------------------
  112|  9.55k|        ossl_ml_dsa_poly_ntt(va->poly + i);
  113|  1.76k|}
ml_dsa_sign.c:vector_expand_mask:
  146|    816|{
  147|    816|    size_t i;
  148|    816|    uint8_t derived_seed[ML_DSA_RHO_PRIME_BYTES + 2];
  149|       |
  150|    816|    memcpy(derived_seed, rho_prime, ML_DSA_RHO_PRIME_BYTES);
  ------------------
  |  |   32|    816|# define ML_DSA_RHO_PRIME_BYTES 64 /* private random seed size */
  ------------------
  151|       |
  152|  5.01k|    for (i = 0; i < out->num_poly; i++) {
  ------------------
  |  Branch (152:17): [True: 4.20k, False: 816]
  ------------------
  153|  4.20k|        size_t index = kappa + i;
  154|       |
  155|  4.20k|        derived_seed[ML_DSA_RHO_PRIME_BYTES] = index & 0xFF;
  ------------------
  |  |   32|  4.20k|# define ML_DSA_RHO_PRIME_BYTES 64 /* private random seed size */
  ------------------
  156|  4.20k|        derived_seed[ML_DSA_RHO_PRIME_BYTES + 1] = (index >> 8) & 0xFF;
  ------------------
  |  |   32|  4.20k|# define ML_DSA_RHO_PRIME_BYTES 64 /* private random seed size */
  ------------------
  157|  4.20k|        poly_expand_mask(out->poly + i, derived_seed, sizeof(derived_seed),
  158|  4.20k|                         gamma1, h_ctx, md);
  159|  4.20k|    }
  160|    816|}
ml_dsa_sign.c:vector_ntt_inverse:
  118|  2.82k|{
  119|  2.82k|    size_t i;
  120|       |
  121|  18.7k|    for (i = 0; i < va->num_poly; i++)
  ------------------
  |  Branch (121:17): [True: 15.9k, False: 2.82k]
  ------------------
  122|  15.9k|        ossl_ml_dsa_poly_ntt_inverse(va->poly + i);
  123|  2.82k|}
ml_dsa_sign.c:vector_high_bits:
  189|    816|{
  190|    816|    size_t i;
  191|       |
  192|  5.54k|    for (i = 0; i < out->num_poly; i++)
  ------------------
  |  Branch (192:17): [True: 4.72k, False: 816]
  ------------------
  193|  4.72k|        poly_high_bits(in->poly + i, gamma2, out->poly + i);
  194|    816|}
ml_dsa_sign.c:vector_mult_scalar:
  128|  2.01k|{
  129|  2.01k|    size_t i;
  130|       |
  131|  13.1k|    for (i = 0; i < lhs->num_poly; i++)
  ------------------
  |  Branch (131:17): [True: 11.1k, False: 2.01k]
  ------------------
  132|  11.1k|        ossl_ml_dsa_poly_ntt_mult(lhs->poly + i, rhs, out->poly + i);
  133|  2.01k|}
ml_dsa_sign.c:vector_add:
   88|    816|{
   89|    816|    size_t i;
   90|       |
   91|  5.01k|    for (i = 0; i < lhs->num_poly; i++)
  ------------------
  |  Branch (91:17): [True: 4.20k, False: 816]
  ------------------
   92|  4.20k|        poly_add(lhs->poly + i, rhs->poly + i, out->poly + i);
   93|    816|}
ml_dsa_sign.c:vector_sub:
   98|  1.00k|{
   99|  1.00k|    size_t i;
  100|       |
  101|  6.85k|    for (i = 0; i < lhs->num_poly; i++)
  ------------------
  |  Branch (101:17): [True: 5.84k, False: 1.00k]
  ------------------
  102|  5.84k|        poly_sub(lhs->poly + i, rhs->poly + i, out->poly + i);
  103|  1.00k|}
ml_dsa_sign.c:vector_low_bits:
  198|    816|{
  199|    816|    size_t i;
  200|       |
  201|  5.54k|    for (i = 0; i < out->num_poly; i++)
  ------------------
  |  Branch (201:17): [True: 4.72k, False: 816]
  ------------------
  202|  4.72k|        poly_low_bits(in->poly + i, gamma2, out->poly + i);
  203|    816|}
ml_dsa_sign.c:vector_max:
  207|  1.19k|{
  208|  1.19k|    size_t i;
  209|  1.19k|    uint32_t mx = 0;
  210|       |
  211|  7.52k|    for (i = 0; i < v->num_poly; i++)
  ------------------
  |  Branch (211:17): [True: 6.32k, False: 1.19k]
  ------------------
  212|  6.32k|        poly_max(v->poly + i, &mx);
  213|  1.19k|    return mx;
  214|  1.19k|}
ml_dsa_sign.c:vector_max_signed:
  218|    816|{
  219|    816|    size_t i;
  220|    816|    uint32_t mx = 0;
  221|       |
  222|  5.54k|    for (i = 0; i < v->num_poly; i++)
  ------------------
  |  Branch (222:17): [True: 4.72k, False: 816]
  ------------------
  223|  4.72k|        poly_max_signed(v->poly + i, &mx);
  224|    816|    return mx;
  225|    816|}
ml_dsa_sign.c:vector_make_hint:
  242|    191|{
  243|    191|    size_t i;
  244|       |
  245|  1.31k|    for (i = 0; i < out->num_poly; i++)
  ------------------
  |  Branch (245:17): [True: 1.12k, False: 191]
  ------------------
  246|  1.12k|        poly_make_hint(ct0->poly + i, cs2->poly + i, w->poly + i, gamma2,
  247|  1.12k|                       out->poly + i);
  248|    191|}
ml_dsa_sign.c:vector_count_ones:
  229|    191|{
  230|    191|    int j;
  231|    191|    size_t i, count = 0;
  232|       |
  233|  1.31k|    for (i = 0; i < v->num_poly; i++)
  ------------------
  |  Branch (233:17): [True: 1.12k, False: 191]
  ------------------
  234|   288k|        for (j = 0; j < ML_DSA_NUM_POLY_COEFFICIENTS; j++)
  ------------------
  |  |   11|   288k|#define ML_DSA_NUM_POLY_COEFFICIENTS 256
  ------------------
  |  Branch (234:21): [True: 287k, False: 1.12k]
  ------------------
  235|   287k|            count += v->poly[i].coeff[j];
  236|    191|    return count;
  237|    191|}
ml_dsa_sign.c:vector_scale_power2_round_ntt:
  165|    190|{
  166|    190|    size_t i;
  167|       |
  168|  1.31k|    for (i = 0; i < in->num_poly; i++)
  ------------------
  |  Branch (168:17): [True: 1.12k, False: 190]
  ------------------
  169|  1.12k|        poly_scale_power2_round(in->poly + i, out->poly + i);
  170|    190|    vector_ntt(out);
  171|    190|}
ml_dsa_sign.c:vector_use_hint:
  252|    190|{
  253|    190|    size_t i;
  254|       |
  255|  1.31k|    for (i = 0; i < out->num_poly; i++)
  ------------------
  |  Branch (255:17): [True: 1.12k, False: 190]
  ------------------
  256|  1.12k|        poly_use_hint(h->poly + i, r->poly + i, gamma2, out->poly + i);
  257|    190|}

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

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

CRYPTO_strdup:
   23|    994|{
   24|    994|    char *ret;
   25|       |
   26|    994|    if (str == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 994]
  ------------------
   27|      0|        return NULL;
   28|    994|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   29|    994|    if (ret != NULL)
  ------------------
  |  Branch (29:9): [True: 994, False: 0]
  ------------------
   30|    994|        strcpy(ret, str);
   31|    994|    return ret;
   32|    994|}
CRYPTO_strndup:
   35|    264|{
   36|    264|    size_t maxlen;
   37|    264|    char *ret;
   38|       |
   39|    264|    if (str == NULL)
  ------------------
  |  Branch (39:9): [True: 0, False: 264]
  ------------------
   40|      0|        return NULL;
   41|       |
   42|    264|    maxlen = OPENSSL_strnlen(str, s);
   43|       |
   44|    264|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   45|    264|    if (ret) {
  ------------------
  |  Branch (45:9): [True: 264, False: 0]
  ------------------
   46|    264|        memcpy(ret, str, maxlen);
   47|    264|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   20|    264|#define CH_ZERO '\0'
  ------------------
   48|    264|    }
   49|    264|    return ret;
   50|    264|}
CRYPTO_memdup:
   53|      5|{
   54|      5|    void *ret;
   55|       |
   56|      5|    if (data == NULL || siz >= INT_MAX)
  ------------------
  |  Branch (56:9): [True: 0, False: 5]
  |  Branch (56:25): [True: 0, False: 5]
  ------------------
   57|      0|        return NULL;
   58|       |
   59|      5|    ret = CRYPTO_malloc(siz, file, line);
   60|      5|    if (ret == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 5]
  ------------------
   61|      0|        return NULL;
   62|      5|    return memcpy(ret, data, siz);
   63|      5|}
OPENSSL_strnlen:
   66|    288|{
   67|    288|    const char *p;
   68|       |
   69|  3.67k|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   20|  3.41k|#define CH_ZERO '\0'
  ------------------
  |  Branch (69:19): [True: 3.41k, False: 264]
  |  Branch (69:36): [True: 3.39k, False: 24]
  ------------------
   70|       |
   71|    288|    return p - str;
   72|    288|}
OPENSSL_strlcpy:
   75|  1.52k|{
   76|  1.52k|    size_t l = 0;
   77|  6.13k|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (77:12): [True: 6.13k, False: 0]
  |  Branch (77:24): [True: 4.60k, False: 1.52k]
  ------------------
   78|  4.60k|        *dst++ = *src++;
   79|  4.60k|        l++;
   80|  4.60k|    }
   81|  1.52k|    if (size)
  ------------------
  |  Branch (81:9): [True: 1.52k, False: 0]
  ------------------
   82|  1.52k|        *dst = CH_ZERO;
  ------------------
  |  |   20|  1.52k|#define CH_ZERO '\0'
  ------------------
   83|  1.52k|    return l + strlen(src);
   84|  1.52k|}
OPENSSL_strcasecmp:
  407|  12.9k|{
  408|  12.9k|    int t;
  409|       |
  410|  29.1k|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (410:12): [True: 17.5k, False: 11.6k]
  ------------------
  411|  17.5k|        if (*s1++ == '\0')
  ------------------
  |  Branch (411:13): [True: 1.30k, False: 16.2k]
  ------------------
  412|  1.30k|            return 0;
  413|  11.6k|    return t;
  414|  12.9k|}
OPENSSL_strncasecmp:
  417|    898|{
  418|    898|    int t;
  419|    898|    size_t i;
  420|       |
  421|    898|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (421:17): [True: 898, False: 0]
  ------------------
  422|    898|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (422:13): [True: 898, False: 0]
  ------------------
  423|    898|            return t;
  424|      0|        else if (*s1++ == '\0')
  ------------------
  |  Branch (424:18): [True: 0, False: 0]
  ------------------
  425|      0|            return 0;
  426|      0|    return 0;
  427|    898|}

OBJ_NAME_init:
   64|  1.22k|{
   65|  1.22k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|  1.22k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
   66|  1.22k|}
OBJ_NAME_get:
  152|    556|{
  153|    556|    OBJ_NAME on, *ret;
  154|    556|    int num = 0, alias;
  155|    556|    const char *value = NULL;
  156|       |
  157|    556|    if (name == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 556]
  ------------------
  158|      0|        return NULL;
  159|    556|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (159:9): [True: 0, False: 556]
  ------------------
  160|      0|        return NULL;
  161|    556|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (161:9): [True: 0, False: 556]
  ------------------
  162|      0|        return NULL;
  163|       |
  164|    556|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  165|    556|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  166|       |
  167|    556|    on.name = name;
  168|    556|    on.type = type;
  169|       |
  170|    651|    for (;;) {
  171|    651|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  172|    651|        if (ret == NULL)
  ------------------
  |  Branch (172:13): [True: 157, False: 494]
  ------------------
  173|    157|            break;
  174|    494|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (174:13): [True: 95, False: 399]
  |  Branch (174:29): [True: 95, False: 0]
  ------------------
  175|     95|            if (++num > 10)
  ------------------
  |  Branch (175:17): [True: 0, False: 95]
  ------------------
  176|      0|                break;
  177|     95|            on.name = ret->data;
  178|    399|        } else {
  179|    399|            value = ret->data;
  180|    399|            break;
  181|    399|        }
  182|    494|    }
  183|       |
  184|    556|    CRYPTO_THREAD_unlock(obj_lock);
  185|    556|    return value;
  186|    556|}
OBJ_NAME_add:
  189|    424|{
  190|    424|    OBJ_NAME *onp, *ret;
  191|    424|    int alias, ok = 0;
  192|       |
  193|    424|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (193:9): [True: 0, False: 424]
  ------------------
  194|      0|        return 0;
  195|       |
  196|    424|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  197|    424|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  198|       |
  199|    424|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |  102|    424|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|{
  369|      4|    unsigned long down_load;
  370|       |
  371|      4|    if (names_lh == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 4]
  ------------------
  372|      0|        return;
  373|       |
  374|      4|    free_type = type;
  375|      4|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      4|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      4|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      4|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 1, False: 3]
  ------------------
  380|      1|        lh_OBJ_NAME_free(names_lh);
  381|      1|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      1|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      1|        names_lh = NULL;
  384|      1|        name_funcs_stack = NULL;
  385|      1|        obj_lock = NULL;
  386|      1|    } else
  387|      3|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      4|}
o_names.c:o_names_init:
   51|      1|{
   52|      1|    names_lh = NULL;
   53|      1|    obj_lock = CRYPTO_THREAD_lock_new();
   54|      1|    if (obj_lock != NULL)
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   56|      1|    if (names_lh == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   58|      0|        obj_lock = NULL;
   59|      0|    }
   60|      1|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (60:12): [True: 1, False: 0]
  |  Branch (60:32): [True: 1, False: 0]
  ------------------
   61|      1|}
o_names.c:obj_name_hash:
  136|  1.31k|{
  137|  1.31k|    unsigned long ret;
  138|       |
  139|  1.31k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.31k]
  ------------------
  140|  1.31k|        && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (140:12): [True: 0, False: 0]
  ------------------
  141|      0|        ret =
  142|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  143|      0|                                a->type)->hash_func(a->name);
  144|  1.31k|    } else {
  145|  1.31k|        ret = ossl_lh_strcasehash(a->name);
  146|  1.31k|    }
  147|  1.31k|    ret ^= a->type;
  148|  1.31k|    return ret;
  149|  1.31k|}
o_names.c:obj_name_cmp:
  120|    918|{
  121|    918|    int ret;
  122|       |
  123|    918|    ret = a->type - b->type;
  124|    918|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 918, False: 0]
  ------------------
  125|    918|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 918]
  ------------------
  126|    918|            && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (126:16): [True: 0, False: 0]
  ------------------
  127|      0|            ret = sk_NAME_FUNCS_value(name_funcs_stack,
  128|      0|                                      a->type)->cmp_func(a->name, b->name);
  129|      0|        } else
  130|    918|            ret = OPENSSL_strcasecmp(a->name, b->name);
  131|    918|    }
  132|    918|    return ret;
  133|    918|}
o_names.c:do_all_fn:
  284|    484|{
  285|    484|    if (name->type == d->type)
  ------------------
  |  Branch (285:9): [True: 242, False: 242]
  ------------------
  286|    242|        d->fn(name, d->arg);
  287|    484|}
o_names.c:names_lh_free_doall:
  354|    543|{
  355|    543|    if (onp == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 543]
  ------------------
  356|      0|        return;
  357|       |
  358|    543|    if (free_type < 0 || free_type == onp->type)
  ------------------
  |  Branch (358:9): [True: 0, False: 543]
  |  Branch (358:26): [True: 242, False: 301]
  ------------------
  359|    242|        OBJ_NAME_remove(onp->name, onp->type);
  360|    543|}

ossl_obj_cleanup_int:
  212|      1|{
  213|      1|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 1]
  ------------------
  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|      1|    objs_free_locks();
  222|      1|}
OBJ_nid2obj:
  331|  1.16k|{
  332|  1.16k|    ADDED_OBJ ad, *adp = NULL;
  333|  1.16k|    ASN1_OBJECT ob;
  334|       |
  335|  1.16k|    if (n == NID_undef
  ------------------
  |  |   18|  2.32k|#define NID_undef                       0
  ------------------
  |  Branch (335:9): [True: 1, False: 1.16k]
  ------------------
  336|  1.16k|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1353|  2.32k|#define NUM_NID 1496
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|  1.16k|#define NID_undef                       0
  ------------------
  |  Branch (336:13): [True: 1.16k, False: 0]
  |  Branch (336:22): [True: 1.16k, False: 0]
  |  Branch (336:37): [True: 1.16k, False: 0]
  ------------------
  337|  1.16k|        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|    397|{
  358|    397|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  359|       |
  360|    397|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (360:12): [True: 0, False: 397]
  ------------------
  361|    397|}
OBJ_nid2ln:
  364|    396|{
  365|    396|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  366|       |
  367|    396|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (367:12): [True: 0, False: 396]
  ------------------
  368|    396|}
OBJ_obj2txt:
  469|    210|{
  470|    210|    int i, n = 0, len, nid, first, use_bn;
  471|    210|    BIGNUM *bl;
  472|    210|    unsigned long l;
  473|    210|    const unsigned char *p;
  474|    210|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  475|    210|    const char *s;
  476|       |
  477|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  478|    210|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (478:9): [True: 210, False: 0]
  |  Branch (478:24): [True: 210, False: 0]
  ------------------
  479|    210|        buf[0] = '\0';
  480|       |
  481|    210|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (481:9): [True: 0, False: 210]
  |  Branch (481:22): [True: 1, False: 209]
  ------------------
  482|      1|        return 0;
  483|       |
  484|    209|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (484:9): [True: 0, False: 209]
  |  Branch (484:21): [True: 0, False: 0]
  ------------------
  485|      0|        s = OBJ_nid2ln(nid);
  486|      0|        if (s == NULL)
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|            s = OBJ_nid2sn(nid);
  488|      0|        if (s != NULL) {
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|            if (buf != NULL)
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                OPENSSL_strlcpy(buf, s, buf_len);
  491|      0|            return (int)strlen(s);
  492|      0|        }
  493|      0|    }
  494|       |
  495|    209|    len = a->length;
  496|    209|    p = a->data;
  497|       |
  498|    209|    first = 1;
  499|    209|    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|    209|    if (len > 586)
  ------------------
  |  Branch (517:9): [True: 0, False: 209]
  ------------------
  518|      0|        goto err;
  519|       |
  520|  1.59k|    while (len > 0) {
  ------------------
  |  Branch (520:12): [True: 1.38k, False: 209]
  ------------------
  521|  1.38k|        l = 0;
  522|  1.38k|        use_bn = 0;
  523|  1.70k|        for (;;) {
  524|  1.70k|            unsigned char c = *p++;
  525|       |
  526|  1.70k|            len--;
  527|  1.70k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (527:17): [True: 209, False: 1.49k]
  |  Branch (527:29): [True: 0, False: 209]
  ------------------
  528|      0|                goto err;
  529|  1.70k|            if (use_bn) {
  ------------------
  |  Branch (529:17): [True: 0, False: 1.70k]
  ------------------
  530|      0|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (530:21): [True: 0, False: 0]
  ------------------
  531|      0|                    goto err;
  532|  1.70k|            } else {
  533|  1.70k|                l |= c & 0x7f;
  534|  1.70k|            }
  535|  1.70k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (535:17): [True: 1.38k, False: 322]
  ------------------
  536|  1.38k|                break;
  537|    322|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (537:17): [True: 322, False: 0]
  |  Branch (537:28): [True: 0, False: 322]
  ------------------
  538|      0|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (538:21): [True: 0, False: 0]
  |  Branch (538:35): [True: 0, False: 0]
  ------------------
  539|      0|                    goto err;
  540|      0|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (540:21): [True: 0, False: 0]
  ------------------
  541|      0|                    goto err;
  542|      0|                use_bn = 1;
  543|      0|            }
  544|    322|            if (use_bn) {
  ------------------
  |  Branch (544:17): [True: 0, False: 322]
  ------------------
  545|      0|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (545:21): [True: 0, False: 0]
  ------------------
  546|      0|                    goto err;
  547|    322|            } else {
  548|    322|                l <<= 7L;
  549|    322|            }
  550|    322|        }
  551|       |
  552|  1.38k|        if (first) {
  ------------------
  |  Branch (552:13): [True: 209, False: 1.17k]
  ------------------
  553|    209|            first = 0;
  554|    209|            if (l >= 80) {
  ------------------
  |  Branch (554:17): [True: 81, False: 128]
  ------------------
  555|     81|                i = 2;
  556|     81|                if (use_bn) {
  ------------------
  |  Branch (556:21): [True: 0, False: 81]
  ------------------
  557|      0|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (557:25): [True: 0, False: 0]
  ------------------
  558|      0|                        goto err;
  559|     81|                } else {
  560|     81|                    l -= 80;
  561|     81|                }
  562|    128|            } else {
  563|    128|                i = (int)(l / 40);
  564|    128|                l -= (long)(i * 40);
  565|    128|            }
  566|    209|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (566:17): [True: 209, False: 0]
  |  Branch (566:32): [True: 209, False: 0]
  ------------------
  567|    209|                *buf++ = i + '0';
  568|    209|                *buf = '\0';
  569|    209|                buf_len--;
  570|    209|            }
  571|    209|            n++;
  572|    209|        }
  573|       |
  574|  1.38k|        if (use_bn) {
  ------------------
  |  Branch (574:13): [True: 0, False: 1.38k]
  ------------------
  575|      0|            char *bndec;
  576|      0|            bndec = BN_bn2dec(bl);
  577|      0|            if (!bndec)
  ------------------
  |  Branch (577:17): [True: 0, False: 0]
  ------------------
  578|      0|                goto err;
  579|      0|            i = strlen(bndec);
  580|      0|            if (buf != NULL) {
  ------------------
  |  Branch (580:17): [True: 0, False: 0]
  ------------------
  581|      0|                if (buf_len > 1) {
  ------------------
  |  Branch (581:21): [True: 0, False: 0]
  ------------------
  582|      0|                    *buf++ = '.';
  583|      0|                    *buf = '\0';
  584|      0|                    buf_len--;
  585|      0|                }
  586|      0|                OPENSSL_strlcpy(buf, bndec, buf_len);
  587|      0|                if (i > buf_len) {
  ------------------
  |  Branch (587:21): [True: 0, False: 0]
  ------------------
  588|      0|                    buf += buf_len;
  589|      0|                    buf_len = 0;
  590|      0|                } else {
  591|      0|                    buf += i;
  592|      0|                    buf_len -= i;
  593|      0|                }
  594|      0|            }
  595|      0|            n++;
  596|      0|            n += i;
  597|      0|            OPENSSL_free(bndec);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  598|  1.38k|        } else {
  599|  1.38k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  600|  1.38k|            i = strlen(tbuf);
  601|  1.38k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (601:17): [True: 1.38k, False: 0]
  |  Branch (601:24): [True: 1.38k, False: 0]
  ------------------
  602|  1.38k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  603|  1.38k|                if (i > buf_len) {
  ------------------
  |  Branch (603:21): [True: 0, False: 1.38k]
  ------------------
  604|      0|                    buf += buf_len;
  605|      0|                    buf_len = 0;
  606|  1.38k|                } else {
  607|  1.38k|                    buf += i;
  608|  1.38k|                    buf_len -= i;
  609|  1.38k|                }
  610|  1.38k|            }
  611|  1.38k|            n += i;
  612|  1.38k|            l = 0;
  613|  1.38k|        }
  614|  1.38k|    }
  615|       |
  616|    209|    BN_free(bl);
  617|    209|    return n;
  618|       |
  619|      0| err:
  620|      0|    BN_free(bl);
  621|      0|    return -1;
  622|    209|}
OBJ_ln2nid:
  637|    933|{
  638|    933|    ASN1_OBJECT o;
  639|    933|    const ASN1_OBJECT *oo = &o;
  640|    933|    ADDED_OBJ ad, *adp;
  641|    933|    const unsigned int *op;
  642|    933|    int nid = NID_undef;
  ------------------
  |  |   18|    933|#define NID_undef                       0
  ------------------
  643|       |
  644|    933|    o.ln = s;
  645|    933|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 4344|    933|#define NUM_LN 1487
  ------------------
  646|    933|    if (op != NULL)
  ------------------
  |  Branch (646:9): [True: 876, False: 57]
  ------------------
  647|    876|        return nid_objs[*op].nid;
  648|     57|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (648:9): [True: 0, False: 57]
  ------------------
  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|     57|    if (added != NULL) {
  ------------------
  |  Branch (652:9): [True: 0, False: 57]
  ------------------
  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|     57|    ossl_obj_unlock(1);
  660|     57|    return nid;
  661|     57|}
OBJ_sn2nid:
  664|    938|{
  665|    938|    ASN1_OBJECT o;
  666|    938|    const ASN1_OBJECT *oo = &o;
  667|    938|    ADDED_OBJ ad, *adp;
  668|    938|    const unsigned int *op;
  669|    938|    int nid = NID_undef;
  ------------------
  |  |   18|    938|#define NID_undef                       0
  ------------------
  670|       |
  671|    938|    o.sn = s;
  672|    938|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2853|    938|#define NUM_SN 1487
  ------------------
  673|    938|    if (op != NULL)
  ------------------
  |  Branch (673:9): [True: 29, False: 909]
  ------------------
  674|     29|        return nid_objs[*op].nid;
  675|    909|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (675:9): [True: 0, False: 909]
  ------------------
  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|    909|    if (added != NULL) {
  ------------------
  |  Branch (679:9): [True: 0, False: 909]
  ------------------
  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|    909|    ossl_obj_unlock(1);
  687|    909|    return nid;
  688|    909|}
OBJ_bsearch_:
  692|  3.74k|{
  693|  3.74k|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  694|  3.74k|}
OBJ_bsearch_ex_:
  700|  3.74k|{
  701|  3.74k|    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|  3.74k|    return p;
  724|  3.74k|}
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_dat.c:objs_free_locks:
   49|      1|{
   50|      1|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   51|      1|    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|      1|}
obj_dat.c:ossl_obj_read_lock:
   93|    966|{
   94|    966|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 966]
  ------------------
   95|      0|        return 1;
   96|    966|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 966]
  ------------------
   97|      0|        return 0;
   98|    966|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|    966|}
obj_dat.c:ossl_init_added_lock:
   75|    966|{
   76|    966|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|    966|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|    966|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|    966|#endif
   80|    966|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|    966|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 966, False: 0]
  |  |  ------------------
  ------------------
   81|    966|}
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|    966|{
  103|    966|    if (lock)
  ------------------
  |  Branch (103:9): [True: 966, False: 0]
  ------------------
  104|    966|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|    966|}
obj_dat.c:ln_cmp:
  115|  9.13k|{
  116|  9.13k|    return strcmp((*a)->ln, nid_objs[*b].ln);
  117|  9.13k|}
obj_dat.c:sn_cmp:
  108|  10.2k|{
  109|  10.2k|    return strcmp((*a)->sn, nid_objs[*b].sn);
  110|  10.2k|}

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

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

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

WPACKET_allocate_bytes:
   20|   163k|{
   21|   163k|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 163k]
  ------------------
   22|      0|        return 0;
   23|       |
   24|   163k|    pkt->written += len;
   25|   163k|    pkt->curr += len;
   26|   163k|    return 1;
   27|   163k|}
WPACKET_reserve_bytes:
   47|   163k|{
   48|       |    /* Internal API, so should not fail */
   49|   163k|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|   327k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 163k, False: 0]
  |  |  |  Branch (52:43): [True: 163k, False: 0]
  |  |  ------------------
  |  |   53|   163k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 163k]
  ------------------
   50|      0|        return 0;
   51|       |
   52|   163k|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 163k]
  ------------------
   53|      0|        return 0;
   54|       |
   55|   163k|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 0, False: 163k]
  |  Branch (55:29): [True: 0, False: 0]
  ------------------
   56|      0|        size_t newlen;
   57|      0|        size_t reflen;
   58|       |
   59|      0|        reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
  ------------------
  |  Branch (59:18): [True: 0, False: 0]
  ------------------
   60|       |
   61|      0|        if (reflen > SIZE_MAX / 2) {
  ------------------
  |  Branch (61:13): [True: 0, False: 0]
  ------------------
   62|      0|            newlen = SIZE_MAX;
   63|      0|        } else {
   64|      0|            newlen = reflen * 2;
   65|      0|            if (newlen < DEFAULT_BUF_SIZE)
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE    256
  ------------------
  |  Branch (65:17): [True: 0, False: 0]
  ------------------
   66|      0|                newlen = DEFAULT_BUF_SIZE;
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE    256
  ------------------
   67|      0|        }
   68|      0|        if (BUF_MEM_grow(pkt->buf, newlen) == 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return 0;
   70|      0|    }
   71|   163k|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 163k, False: 0]
  ------------------
   72|   163k|        *allocbytes = WPACKET_get_curr(pkt);
   73|   163k|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 1.14k, False: 162k]
  |  Branch (73:30): [True: 1.14k, False: 0]
  ------------------
   74|  1.14k|            *allocbytes -= len;
   75|   163k|    }
   76|       |
   77|   163k|    return 1;
   78|   163k|}
WPACKET_init_static_len:
  131|  2.08k|{
  132|  2.08k|    size_t max = maxmaxsize(lenbytes);
  133|       |
  134|       |    /* Internal API, so should not fail */
  135|  2.08k|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|  4.16k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.08k, False: 0]
  |  |  |  Branch (52:43): [True: 2.08k, False: 0]
  |  |  ------------------
  |  |   53|  2.08k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (135:9): [True: 0, False: 2.08k]
  ------------------
  136|      0|        return 0;
  137|       |
  138|  2.08k|    pkt->staticbuf = buf;
  139|  2.08k|    pkt->buf = NULL;
  140|  2.08k|    pkt->maxsize = (max < len) ? max : len;
  ------------------
  |  Branch (140:20): [True: 0, False: 2.08k]
  ------------------
  141|  2.08k|    pkt->endfirst = 0;
  142|       |
  143|  2.08k|    return wpacket_intern_init_len(pkt, lenbytes);
  144|  2.08k|}
WPACKET_init_der:
  147|    380|{
  148|       |    /* Internal API, so should not fail */
  149|    380|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|    760|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 380, False: 0]
  |  |  |  Branch (52:43): [True: 380, False: 0]
  |  |  ------------------
  |  |   53|    380|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 380]
  ------------------
  150|      0|        return 0;
  151|       |
  152|    380|    pkt->staticbuf = buf;
  153|    380|    pkt->buf = NULL;
  154|    380|    pkt->maxsize = len;
  155|    380|    pkt->endfirst = 1;
  156|       |
  157|    380|    return wpacket_intern_init_len(pkt, 0);
  158|    380|}
WPACKET_close:
  335|    380|{
  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|    380|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 380]
  |  Branch (340:30): [True: 0, False: 380]
  ------------------
  341|      0|        return 0;
  342|       |
  343|    380|    return wpacket_intern_close(pkt, pkt->subs, 1);
  344|    380|}
WPACKET_finish:
  347|  2.46k|{
  348|  2.46k|    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|  2.46k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 2.46k]
  |  Branch (354:30): [True: 0, False: 2.46k]
  ------------------
  355|      0|        return 0;
  356|       |
  357|  2.46k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  358|  2.46k|    if (ret) {
  ------------------
  |  Branch (358:9): [True: 2.46k, False: 0]
  ------------------
  359|  2.46k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|  2.46k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.46k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.46k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|  2.46k|        pkt->subs = NULL;
  361|  2.46k|    }
  362|       |
  363|  2.46k|    return ret;
  364|  2.46k|}
WPACKET_start_sub_packet_len__:
  367|    380|{
  368|    380|    WPACKET_SUB *sub;
  369|    380|    unsigned char *lenchars;
  370|       |
  371|       |    /* Internal API, so should not fail */
  372|    380|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|    380|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    380|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (372:9): [True: 0, False: 380]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  376|    380|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (376:9): [True: 0, False: 380]
  |  Branch (376:25): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|    380|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |  104|    380|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    380|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    380|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 380]
  ------------------
  380|      0|        return 0;
  381|       |
  382|    380|    sub->parent = pkt->subs;
  383|    380|    pkt->subs = sub;
  384|    380|    sub->pwritten = pkt->written + lenbytes;
  385|    380|    sub->lenbytes = lenbytes;
  386|       |
  387|    380|    if (lenbytes == 0) {
  ------------------
  |  Branch (387:9): [True: 380, False: 0]
  ------------------
  388|    380|        sub->packet_len = 0;
  389|    380|        return 1;
  390|    380|    }
  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|    380|{
  402|    380|    return WPACKET_start_sub_packet_len__(pkt, 0);
  403|    380|}
WPACKET_put_bytes__:
  406|    760|{
  407|    760|    unsigned char *data;
  408|       |
  409|       |    /* Internal API, so should not fail */
  410|    760|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|  1.52k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.52k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (410:9): [True: 0, False: 760]
  ------------------
  411|    760|            || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (411:16): [True: 0, False: 760]
  ------------------
  412|    760|            || !put_value(data, val, size))
  ------------------
  |  Branch (412:16): [True: 0, False: 760]
  ------------------
  413|      0|        return 0;
  414|       |
  415|    760|    return 1;
  416|    760|}
WPACKET_memcpy:
  460|  2.34k|{
  461|  2.34k|    unsigned char *dest;
  462|       |
  463|  2.34k|    if (len == 0)
  ------------------
  |  Branch (463:9): [True: 0, False: 2.34k]
  ------------------
  464|      0|        return 1;
  465|       |
  466|  2.34k|    if (!WPACKET_allocate_bytes(pkt, len, &dest))
  ------------------
  |  Branch (466:9): [True: 0, False: 2.34k]
  ------------------
  467|      0|        return 0;
  468|       |
  469|  2.34k|    if (dest != NULL)
  ------------------
  |  Branch (469:9): [True: 2.34k, False: 0]
  ------------------
  470|  2.34k|        memcpy(dest, src, len);
  471|       |
  472|  2.34k|    return 1;
  473|  2.34k|}
WPACKET_get_total_written:
  487|  2.02k|{
  488|       |    /* Internal API, so should not fail */
  489|  2.02k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|  2.02k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.02k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (489:9): [True: 0, False: 2.02k]
  ------------------
  490|      0|        return 0;
  491|       |
  492|  2.02k|    *written = pkt->written;
  493|       |
  494|  2.02k|    return 1;
  495|  2.02k|}
WPACKET_get_curr:
  509|   163k|{
  510|   163k|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|   163k|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 163k, False: 0]
  |  |  ------------------
  |  |   41|   163k|                     ? (p)->staticbuf \
  |  |   42|   163k|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|      0|                        : NULL))
  ------------------
  511|       |
  512|   163k|    if (buf == NULL)
  ------------------
  |  Branch (512:9): [True: 0, False: 163k]
  ------------------
  513|      0|        return NULL;
  514|       |
  515|   163k|    if (pkt->endfirst)
  ------------------
  |  Branch (515:9): [True: 1.52k, False: 162k]
  ------------------
  516|  1.52k|        return buf + pkt->maxsize - pkt->curr;
  517|       |
  518|   162k|    return buf + pkt->curr;
  519|   163k|}
WPACKET_cleanup:
  527|    380|{
  528|    380|    WPACKET_SUB *sub, *parent;
  529|       |
  530|    380|    for (sub = pkt->subs; sub != NULL; sub = parent) {
  ------------------
  |  Branch (530:27): [True: 0, False: 380]
  ------------------
  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|    380|    pkt->subs = NULL;
  535|    380|}
packet.c:maxmaxsize:
   96|  2.08k|{
   97|  2.08k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 2.08k]
  |  Branch (97:39): [True: 2.08k, False: 0]
  ------------------
   98|  2.08k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|  2.08k|}
packet.c:wpacket_intern_init_len:
  104|  2.46k|{
  105|  2.46k|    unsigned char *lenchars;
  106|       |
  107|  2.46k|    pkt->curr = 0;
  108|  2.46k|    pkt->written = 0;
  109|       |
  110|  2.46k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |  104|  2.46k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.46k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.46k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 2.46k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|  2.46k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 2.46k, False: 0]
  ------------------
  114|  2.46k|        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|  2.84k|{
  252|  2.84k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|  2.84k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 0, False: 2.84k]
  ------------------
  255|  2.84k|            && (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|  2.84k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 0, False: 2.84k]
  ------------------
  259|  2.84k|            && 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|  2.84k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.84k]
  ------------------
  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|  2.84k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 760, False: 2.08k]
  |  Branch (293:33): [True: 380, False: 380]
  ------------------
  294|  2.84k|               && (packlen != 0
  ------------------
  |  Branch (294:20): [True: 380, False: 0]
  ------------------
  295|    380|                   || (sub->flags
  ------------------
  |  Branch (295:23): [True: 0, False: 0]
  ------------------
  296|    380|                       & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) == 0)) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  297|    380|        size_t tmplen = packlen;
  298|    380|        size_t numlenbytes = 1;
  299|       |
  300|    380|        while ((tmplen = tmplen >> 8) > 0)
  ------------------
  |  Branch (300:16): [True: 0, False: 380]
  ------------------
  301|      0|            numlenbytes++;
  302|    380|        if (!WPACKET_put_bytes__(pkt, packlen, numlenbytes))
  ------------------
  |  Branch (302:13): [True: 0, False: 380]
  ------------------
  303|      0|            return 0;
  304|    380|        if (packlen > 0x7f) {
  ------------------
  |  Branch (304:13): [True: 0, False: 380]
  ------------------
  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|    380|    }
  310|       |
  311|  2.84k|    if (doclose) {
  ------------------
  |  Branch (311:9): [True: 2.84k, False: 0]
  ------------------
  312|  2.84k|        pkt->subs = sub->parent;
  313|  2.84k|        OPENSSL_free(sub);
  ------------------
  |  |  115|  2.84k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.84k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.84k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|  2.84k|    }
  315|       |
  316|  2.84k|    return 1;
  317|  2.84k|}
packet.c:put_value:
  212|    760|{
  213|    760|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 0, False: 760]
  ------------------
  214|      0|        return 1;
  215|       |
  216|  1.52k|    for (data += len - 1; len > 0; len--) {
  ------------------
  |  Branch (216:27): [True: 760, False: 760]
  ------------------
  217|    760|        *data = (unsigned char)(value & 0xff);
  218|    760|        data--;
  219|    760|        value >>= 8;
  220|    760|    }
  221|       |
  222|       |    /* Check whether we could fit the value in the assigned number of bytes */
  223|    760|    if (value > 0)
  ------------------
  |  Branch (223:9): [True: 0, False: 760]
  ------------------
  224|      0|        return 0;
  225|       |
  226|    760|    return 1;
  227|    760|}

OSSL_PARAM_locate:
   54|  10.9k|{
   55|  10.9k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 10.0k, False: 888]
  |  Branch (55:22): [True: 10.0k, False: 0]
  ------------------
   56|  23.5k|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 16.9k, False: 6.51k]
  ------------------
   57|  16.9k|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 3.54k, False: 13.4k]
  ------------------
   58|  3.54k|                return p;
   59|  7.40k|    return NULL;
   60|  10.9k|}
OSSL_PARAM_locate_const:
   63|  3.06k|{
   64|  3.06k|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|  3.06k|}
OSSL_PARAM_modified:
   81|  1.09k|{
   82|  1.09k|    return p != NULL && p->return_size != OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  1.09k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (82:12): [True: 1.09k, False: 0]
  |  Branch (82:25): [True: 145, False: 948]
  ------------------
   83|  1.09k|}
OSSL_PARAM_get_int:
  267|     15|{
  268|     15|#ifndef OPENSSL_SMALL_FOOTPRINT
  269|     15|    switch (sizeof(int)) {
  ------------------
  |  Branch (269:13): [Folded - Ignored]
  ------------------
  270|     15|    case sizeof(int32_t):
  ------------------
  |  Branch (270:5): [True: 15, False: 0]
  ------------------
  271|     15|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  272|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (272:5): [True: 0, False: 15]
  ------------------
  273|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  274|     15|    }
  275|      0|#endif
  276|      0|    return general_get_int(p, val, sizeof(*val));
  277|     15|}
OSSL_PARAM_set_int:
  280|  2.63k|{
  281|  2.63k|#ifndef OPENSSL_SMALL_FOOTPRINT
  282|  2.63k|    switch (sizeof(int)) {
  ------------------
  |  Branch (282:13): [Folded - Ignored]
  ------------------
  283|  2.63k|    case sizeof(int32_t):
  ------------------
  |  Branch (283:5): [True: 2.63k, False: 0]
  ------------------
  284|  2.63k|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  285|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (285:5): [True: 0, False: 2.63k]
  ------------------
  286|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  287|  2.63k|    }
  288|      0|#endif
  289|      0|    return general_set_int(p, &val, sizeof(val));
  290|  2.63k|}
OSSL_PARAM_construct_int:
  293|  2.63k|{
  294|  2.63k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|  2.63k|# define OSSL_PARAM_INTEGER              1
  ------------------
  295|  2.63k|}
OSSL_PARAM_get_uint:
  298|      3|{
  299|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  300|      3|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (300:13): [Folded - Ignored]
  ------------------
  301|      3|    case sizeof(uint32_t):
  ------------------
  |  Branch (301:5): [True: 3, False: 0]
  ------------------
  302|      3|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  303|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (303:5): [True: 0, False: 3]
  ------------------
  304|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  305|      3|    }
  306|      0|#endif
  307|      0|    return general_get_uint(p, val, sizeof(*val));
  308|      3|}
OSSL_PARAM_set_uint:
  311|    986|{
  312|    986|#ifndef OPENSSL_SMALL_FOOTPRINT
  313|    986|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (313:13): [Folded - Ignored]
  ------------------
  314|    986|    case sizeof(uint32_t):
  ------------------
  |  Branch (314:5): [True: 986, False: 0]
  ------------------
  315|    986|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  316|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (316:5): [True: 0, False: 986]
  ------------------
  317|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  318|    986|    }
  319|      0|#endif
  320|      0|    return general_set_uint(p, &val, sizeof(val));
  321|    986|}
OSSL_PARAM_construct_uint:
  324|  1.00k|{
  325|  1.00k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  1.00k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  326|  1.00k|                                sizeof(unsigned int));
  327|  1.00k|}
OSSL_PARAM_get_int32:
  393|     15|{
  394|     15|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 15]
  |  Branch (394:24): [True: 0, False: 15]
  ------------------
  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|     15|    if (p->data == NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 15]
  ------------------
  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|     15|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|     15|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (404:9): [True: 3, False: 12]
  ------------------
  405|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  406|      3|        int64_t i64;
  407|       |
  408|      3|        switch (p->data_size) {
  ------------------
  |  Branch (408:17): [True: 0, False: 3]
  ------------------
  409|      3|        case sizeof(int32_t):
  ------------------
  |  Branch (409:9): [True: 3, False: 0]
  ------------------
  410|      3|            *val = *(const int32_t *)p->data;
  411|      3|            return 1;
  412|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (412:9): [True: 0, False: 3]
  ------------------
  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|      3|        }
  421|      0|#endif
  422|      0|        return general_get_int(p, val, sizeof(*val));
  423|       |
  424|     12|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|     12|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (424:16): [True: 12, False: 0]
  ------------------
  425|     12|#ifndef OPENSSL_SMALL_FOOTPRINT
  426|     12|        uint32_t u32;
  427|     12|        uint64_t u64;
  428|       |
  429|     12|        switch (p->data_size) {
  ------------------
  |  Branch (429:17): [True: 0, False: 12]
  ------------------
  430|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (430:9): [True: 0, False: 12]
  ------------------
  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|     12|        case sizeof(uint64_t):
  ------------------
  |  Branch (438:9): [True: 12, False: 0]
  ------------------
  439|     12|            u64 = *(const uint64_t *)p->data;
  440|     12|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (440:17): [True: 12, False: 0]
  ------------------
  441|     12|                *val = (int32_t)u64;
  442|     12|                return 1;
  443|     12|            }
  444|      0|            err_out_of_range;
  ------------------
  |  |   25|     12|    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|     12|        }
  447|      0|#endif
  448|      0|        return general_get_int(p, val, sizeof(*val));
  449|       |
  450|     12|    } 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|     15|    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|     15|}
OSSL_PARAM_set_int32:
  473|  2.63k|{
  474|  2.63k|    if (p == NULL) {
  ------------------
  |  Branch (474:9): [True: 0, False: 2.63k]
  ------------------
  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|  2.63k|    p->return_size = 0;
  479|  2.63k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  2.63k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (479:9): [True: 2.63k, False: 8]
  ------------------
  480|  2.63k|#ifndef OPENSSL_SMALL_FOOTPRINT
  481|  2.63k|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  482|  2.63k|        if (p->data == NULL)
  ------------------
  |  Branch (482:13): [True: 0, False: 2.63k]
  ------------------
  483|      0|            return 1;
  484|  2.63k|        switch (p->data_size) {
  ------------------
  |  Branch (484:17): [True: 0, False: 2.63k]
  ------------------
  485|  2.63k|        case sizeof(int32_t):
  ------------------
  |  Branch (485:9): [True: 2.63k, False: 0]
  ------------------
  486|  2.63k|            *(int32_t *)p->data = val;
  487|  2.63k|            return 1;
  488|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (488:9): [True: 0, False: 2.63k]
  ------------------
  489|      0|            p->return_size = sizeof(int64_t);
  490|      0|            *(int64_t *)p->data = (int64_t)val;
  491|      0|            return 1;
  492|  2.63k|        }
  493|      0|#endif
  494|      0|        return general_set_int(p, &val, sizeof(val));
  495|  2.63k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|     16|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (495:16): [True: 8, False: 0]
  |  Branch (495:63): [True: 8, False: 0]
  ------------------
  496|      8|#ifndef OPENSSL_SMALL_FOOTPRINT
  497|      8|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  498|      8|        if (p->data == NULL)
  ------------------
  |  Branch (498:13): [True: 0, False: 8]
  ------------------
  499|      0|            return 1;
  500|      8|        switch (p->data_size) {
  ------------------
  |  Branch (500:17): [True: 0, False: 8]
  ------------------
  501|      8|        case sizeof(uint32_t):
  ------------------
  |  Branch (501:9): [True: 8, False: 0]
  ------------------
  502|      8|            *(uint32_t *)p->data = (uint32_t)val;
  503|      8|            return 1;
  504|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (504:9): [True: 0, False: 8]
  ------------------
  505|      0|            p->return_size = sizeof(uint64_t);
  506|      0|            *(uint64_t *)p->data = (uint64_t)val;
  507|      0|            return 1;
  508|      8|        }
  509|      0|#endif
  510|      0|        return general_set_int(p, &val, sizeof(val));
  511|      8|    } 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|  2.63k|    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|  2.63k|}
OSSL_PARAM_get_uint32:
  547|      3|{
  548|      3|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (548:9): [True: 0, False: 3]
  |  Branch (548:24): [True: 0, False: 3]
  ------------------
  549|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|      0|        return 0;
  551|      0|    }
  552|       |
  553|      3|    if (p->data == NULL) {
  ------------------
  |  Branch (553:9): [True: 0, False: 3]
  ------------------
  554|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|      0|        return 0;
  556|      0|    }
  557|       |
  558|      3|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      3|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (558:9): [True: 3, False: 0]
  ------------------
  559|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  560|      3|        uint64_t u64;
  561|       |
  562|      3|        switch (p->data_size) {
  ------------------
  |  Branch (562:17): [True: 0, False: 3]
  ------------------
  563|      3|        case sizeof(uint32_t):
  ------------------
  |  Branch (563:9): [True: 3, False: 0]
  ------------------
  564|      3|            *val = *(const uint32_t *)p->data;
  565|      3|            return 1;
  566|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (566:9): [True: 0, False: 3]
  ------------------
  567|      0|            u64 = *(const uint64_t *)p->data;
  568|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                *val = (uint32_t)u64;
  570|      0|                return 1;
  571|      0|            }
  572|      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)
  ------------------
  573|      0|            return 0;
  574|      3|        }
  575|      0|#endif
  576|      0|        return general_get_uint(p, val, sizeof(*val));
  577|      3|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (577:16): [True: 0, False: 0]
  ------------------
  578|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  579|      0|        int32_t i32;
  580|      0|        int64_t i64;
  581|       |
  582|      0|        switch (p->data_size) {
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  ------------------
  583|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (583:9): [True: 0, False: 0]
  ------------------
  584|      0|            i32 = *(const int32_t *)p->data;
  585|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (585:17): [True: 0, False: 0]
  ------------------
  586|      0|                *val = i32;
  587|      0|                return 1;
  588|      0|            }
  589|      0|            err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   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|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  590|      0|            return 0;
  591|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (591:9): [True: 0, False: 0]
  ------------------
  592|      0|            i64 = *(const int64_t *)p->data;
  593|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (593:17): [True: 0, False: 0]
  |  Branch (593:29): [True: 0, False: 0]
  ------------------
  594|      0|                *val = (uint32_t)i64;
  595|      0|                return 1;
  596|      0|            }
  597|      0|            if (i64 < 0)
  ------------------
  |  Branch (597:17): [True: 0, False: 0]
  ------------------
  598|      0|                err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   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|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  599|      0|            else
  600|      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)
  ------------------
  601|      0|            return 0;
  602|      0|        }
  603|      0|#endif
  604|      0|        return general_get_uint(p, val, sizeof(*val));
  605|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (605:16): [True: 0, False: 0]
  ------------------
  606|      0|#ifndef OPENSSL_SYS_UEFI
  607|      0|        double d;
  608|       |
  609|      0|        switch (p->data_size) {
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  ------------------
  610|      0|        case sizeof(double):
  ------------------
  |  Branch (610:9): [True: 0, False: 0]
  ------------------
  611|      0|            d = *(const double *)p->data;
  612|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (612:17): [True: 0, False: 0]
  |  Branch (612:27): [True: 0, False: 0]
  |  Branch (612:46): [True: 0, False: 0]
  ------------------
  613|      0|                *val = (uint32_t)d;
  614|      0|                return 1;
  615|      0|            }
  616|      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)
  ------------------
  617|      0|            return 0;
  618|      0|        }
  619|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|      0|        return 0;
  621|      0|#endif
  622|      0|    }
  623|      0|    err_bad_type;
  ------------------
  |  |   35|      3|    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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  624|      0|    return 0;
  625|      3|}
OSSL_PARAM_set_uint32:
  628|    986|{
  629|    986|    if (p == NULL) {
  ------------------
  |  Branch (629:9): [True: 0, False: 986]
  ------------------
  630|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  631|      0|        return 0;
  632|      0|    }
  633|    986|    p->return_size = 0;
  634|       |
  635|    986|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|    986|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (635:9): [True: 986, False: 0]
  ------------------
  636|    986|#ifndef OPENSSL_SMALL_FOOTPRINT
  637|    986|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  638|    986|        if (p->data == NULL)
  ------------------
  |  Branch (638:13): [True: 0, False: 986]
  ------------------
  639|      0|            return 1;
  640|    986|        switch (p->data_size) {
  ------------------
  |  Branch (640:17): [True: 0, False: 986]
  ------------------
  641|    986|        case sizeof(uint32_t):
  ------------------
  |  Branch (641:9): [True: 986, False: 0]
  ------------------
  642|    986|            *(uint32_t *)p->data = val;
  643|    986|            return 1;
  644|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (644:9): [True: 0, False: 986]
  ------------------
  645|      0|            p->return_size = sizeof(uint64_t);
  646|      0|            *(uint64_t *)p->data = val;
  647|      0|            return 1;
  648|    986|        }
  649|      0|#endif
  650|      0|        return general_set_uint(p, &val, sizeof(val));
  651|    986|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  653|      0|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  654|      0|        if (p->data == NULL)
  ------------------
  |  Branch (654:13): [True: 0, False: 0]
  ------------------
  655|      0|            return 1;
  656|      0|        switch (p->data_size) {
  ------------------
  |  Branch (656:17): [True: 0, False: 0]
  ------------------
  657|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (657:9): [True: 0, False: 0]
  ------------------
  658|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|                *(int32_t *)p->data = (int32_t)val;
  660|      0|                return 1;
  661|      0|            }
  662|      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)
  ------------------
  663|      0|            return 0;
  664|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (664:9): [True: 0, False: 0]
  ------------------
  665|      0|            p->return_size = sizeof(int64_t);
  666|      0|            *(int64_t *)p->data = (int64_t)val;
  667|      0|            return 1;
  668|      0|        }
  669|      0|#endif
  670|      0|        return general_set_uint(p, &val, sizeof(val));
  671|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (671:16): [True: 0, False: 0]
  ------------------
  672|      0|#ifndef OPENSSL_SYS_UEFI
  673|      0|        unsigned int shift;
  674|       |
  675|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (675:13): [True: 0, False: 0]
  ------------------
  676|      0|            p->return_size = sizeof(double);
  677|      0|            return 1;
  678|      0|        }
  679|      0|        switch (p->data_size) {
  ------------------
  |  Branch (679:17): [True: 0, False: 0]
  ------------------
  680|      0|        case sizeof(double):
  ------------------
  |  Branch (680:9): [True: 0, False: 0]
  ------------------
  681|      0|            shift = real_shift();
  682|      0|            if (shift < 8 * sizeof(val) && (val >> shift) != 0) {
  ------------------
  |  Branch (682:17): [True: 0, False: 0]
  |  Branch (682:44): [True: 0, False: 0]
  ------------------
  683|      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)
  ------------------
  684|      0|                return 0;
  685|      0|            }
  686|      0|            *(double *)p->data = (double)val;
  687|      0|            p->return_size = sizeof(double);
  688|      0|            return 1;
  689|      0|        }
  690|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  691|      0|        return 0;
  692|      0|#endif
  693|      0|    }
  694|      0|    err_bad_type;
  ------------------
  |  |   35|    986|    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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|      0|    return 0;
  696|    986|}
OSSL_PARAM_get_int64:
  705|      3|{
  706|      3|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (706:9): [True: 0, False: 3]
  |  Branch (706:24): [True: 0, False: 3]
  ------------------
  707|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|      0|        return 0;
  709|      0|    }
  710|       |
  711|      3|    if (p->data == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 3]
  ------------------
  712|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|      0|        return 0;
  714|      0|    }
  715|       |
  716|      3|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      3|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (716:9): [True: 3, False: 0]
  ------------------
  717|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  718|      3|        switch (p->data_size) {
  ------------------
  |  Branch (718:17): [True: 0, False: 3]
  ------------------
  719|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (719:9): [True: 0, False: 3]
  ------------------
  720|      0|            *val = *(const int32_t *)p->data;
  721|      0|            return 1;
  722|      3|        case sizeof(int64_t):
  ------------------
  |  Branch (722:9): [True: 3, False: 0]
  ------------------
  723|      3|            *val = *(const int64_t *)p->data;
  724|      3|            return 1;
  725|      3|        }
  726|      0|#endif
  727|      0|        return general_get_int(p, val, sizeof(*val));
  728|      3|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (728:16): [True: 0, False: 0]
  ------------------
  729|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  730|      0|        uint64_t u64;
  731|       |
  732|      0|        switch (p->data_size) {
  ------------------
  |  Branch (732:17): [True: 0, False: 0]
  ------------------
  733|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (733:9): [True: 0, False: 0]
  ------------------
  734|      0|            *val = *(const uint32_t *)p->data;
  735|      0|            return 1;
  736|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (736:9): [True: 0, False: 0]
  ------------------
  737|      0|            u64 = *(const uint64_t *)p->data;
  738|      0|            if (u64 <= INT64_MAX) {
  ------------------
  |  Branch (738:17): [True: 0, False: 0]
  ------------------
  739|      0|                *val = (int64_t)u64;
  740|      0|                return 1;
  741|      0|            }
  742|      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)
  ------------------
  743|      0|            return 0;
  744|      0|        }
  745|      0|#endif
  746|      0|        return general_get_int(p, val, sizeof(*val));
  747|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (747:16): [True: 0, False: 0]
  ------------------
  748|      0|#ifndef OPENSSL_SYS_UEFI
  749|      0|        double d;
  750|       |
  751|      0|        switch (p->data_size) {
  ------------------
  |  Branch (751:17): [True: 0, False: 0]
  ------------------
  752|      0|        case sizeof(double):
  ------------------
  |  Branch (752:9): [True: 0, False: 0]
  ------------------
  753|      0|            d = *(const double *)p->data;
  754|      0|            if (d >= INT64_MIN
  ------------------
  |  Branch (754:17): [True: 0, False: 0]
  ------------------
  755|       |                    /*
  756|       |                     * By subtracting 65535 (2^16-1) we cancel the low order
  757|       |                     * 15 bits of INT64_MAX to avoid using imprecise floating
  758|       |                     * point values.
  759|       |                     */
  760|      0|                    && d < (double)(INT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (760:24): [True: 0, False: 0]
  ------------------
  761|      0|                    && d == (int64_t)d) {
  ------------------
  |  Branch (761:24): [True: 0, False: 0]
  ------------------
  762|      0|                *val = (int64_t)d;
  763|      0|                return 1;
  764|      0|            }
  765|      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)
  ------------------
  766|      0|            return 0;
  767|      0|        }
  768|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  769|      0|        return 0;
  770|      0|#endif
  771|      0|    }
  772|      0|    err_bad_type;
  ------------------
  |  |   35|      3|    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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  773|      0|    return 0;
  774|      3|}
OSSL_PARAM_set_uint64:
  938|  1.31k|{
  939|  1.31k|    if (p == NULL) {
  ------------------
  |  Branch (939:9): [True: 0, False: 1.31k]
  ------------------
  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|  1.31k|    p->return_size = 0;
  944|       |
  945|  1.31k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  1.31k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (945:9): [True: 1.31k, False: 0]
  ------------------
  946|  1.31k|#ifndef OPENSSL_SMALL_FOOTPRINT
  947|  1.31k|        if (p->data == NULL) {
  ------------------
  |  Branch (947:13): [True: 0, False: 1.31k]
  ------------------
  948|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  949|      0|            return 1;
  950|      0|        }
  951|  1.31k|        switch (p->data_size) {
  ------------------
  |  Branch (951:17): [True: 0, False: 1.31k]
  ------------------
  952|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (952:9): [True: 0, False: 1.31k]
  ------------------
  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|  1.31k|        case sizeof(uint64_t):
  ------------------
  |  Branch (960:9): [True: 1.31k, False: 0]
  ------------------
  961|  1.31k|            p->return_size = sizeof(uint64_t);
  962|  1.31k|            *(uint64_t *)p->data = val;
  963|  1.31k|            return 1;
  964|  1.31k|        }
  965|      0|#endif
  966|      0|        return general_set_uint(p, &val, sizeof(val));
  967|  1.31k|    } 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|  1.31k|    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|  1.31k|}
OSSL_PARAM_set_size_t:
 1033|  1.31k|{
 1034|  1.31k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1035|  1.31k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1035:13): [Folded - Ignored]
  ------------------
 1036|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1036:5): [True: 0, False: 1.31k]
  ------------------
 1037|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1038|  1.31k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1038:5): [True: 1.31k, False: 0]
  ------------------
 1039|  1.31k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1040|  1.31k|    }
 1041|      0|#endif
 1042|      0|    return general_set_uint(p, &val, sizeof(val));
 1043|  1.31k|}
OSSL_PARAM_construct_size_t:
 1046|  1.31k|{
 1047|  1.31k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  1.31k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1048|  1.31k|                                sizeof(size_t));
 1049|  1.31k|}
OSSL_PARAM_get_time_t:
 1052|      3|{
 1053|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
 1054|      3|    switch (sizeof(time_t)) {
  ------------------
  |  Branch (1054:13): [Folded - Ignored]
  ------------------
 1055|      0|    case sizeof(int32_t):
  ------------------
  |  Branch (1055:5): [True: 0, False: 3]
  ------------------
 1056|      0|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
 1057|      3|    case sizeof(int64_t):
  ------------------
  |  Branch (1057:5): [True: 3, False: 0]
  ------------------
 1058|      3|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
 1059|      3|    }
 1060|      0|#endif
 1061|      0|    return general_get_int(p, val, sizeof(*val));
 1062|      3|}
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_octet_string:
 1412|    380|{
 1413|    380|    return get_string_internal(p, val, &max_len, used_len,
 1414|    380|                               OSSL_PARAM_OCTET_STRING);
  ------------------
  |  |  123|    380|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1415|    380|}
OSSL_PARAM_set_utf8_string:
 1440|    142|{
 1441|    142|    if (p == NULL || val == NULL) {
  ------------------
  |  Branch (1441:9): [True: 0, False: 142]
  |  Branch (1441:22): [True: 0, False: 142]
  ------------------
 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|    142|    p->return_size = 0;
 1446|    142|    return set_string_internal(p, val, strlen(val), OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|    142|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1447|    142|}
OSSL_PARAM_construct_utf8_string:
 1462|    290|{
 1463|    290|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1463:9): [True: 290, False: 0]
  |  Branch (1463:24): [True: 6, False: 284]
  ------------------
 1464|      6|        bsize = strlen(buf);
 1465|    290|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|    290|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1466|    290|}
OSSL_PARAM_construct_octet_string:
 1470|     42|{
 1471|     42|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|     42|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1472|     42|}
OSSL_PARAM_construct_end:
 1661|    755|{
 1662|    755|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|    755|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1663|       |
 1664|    755|    return end;
 1665|    755|}
OSSL_PARAM_get_octet_string_ptr:
 1698|     30|{
 1699|     30|    return get_string_ptr_internal(p, (const void **)val, used_len,
 1700|     30|                                   OSSL_PARAM_OCTET_PTR,
  ------------------
  |  |  160|     30|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
 1701|     30|                                   OSSL_PARAM_OCTET_STRING);
  ------------------
  |  |  123|     30|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1702|     30|}
params.c:ossl_param_construct:
   69|  5.28k|{
   70|  5.28k|    OSSL_PARAM res;
   71|       |
   72|  5.28k|    res.key = key;
   73|  5.28k|    res.data_type = data_type;
   74|  5.28k|    res.data = data;
   75|  5.28k|    res.data_size = data_size;
   76|  5.28k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  5.28k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|  5.28k|    return res;
   78|  5.28k|}
params.c:get_string_internal:
 1332|    380|{
 1333|    380|    size_t sz, alloc_sz;
 1334|       |
 1335|    380|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1335:10): [True: 0, False: 380]
  |  Branch (1335:25): [True: 0, False: 0]
  |  Branch (1335:46): [True: 0, False: 380]
  ------------------
 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|    380|    if (p->data_type != type) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 380]
  ------------------
 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|    380|    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|    380|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|    760|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1349:22): [True: 0, False: 380]
  |  Branch (1349:56): [True: 0, False: 380]
  ------------------
 1350|       |
 1351|    380|    if (used_len != NULL)
  ------------------
  |  Branch (1351:9): [True: 380, False: 0]
  ------------------
 1352|    380|        *used_len = sz;
 1353|       |
 1354|    380|    if (p->data == NULL) {
  ------------------
  |  Branch (1354:9): [True: 0, False: 380]
  ------------------
 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|    380|    if (val == NULL)
  ------------------
  |  Branch (1359:9): [True: 0, False: 380]
  ------------------
 1360|      0|        return 1;
 1361|       |
 1362|    380|    if (*val == NULL) {
  ------------------
  |  Branch (1362:9): [True: 0, False: 380]
  ------------------
 1363|      0|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
 1364|       |
 1365|      0|        if (q == NULL)
  ------------------
  |  Branch (1365:13): [True: 0, False: 0]
  ------------------
 1366|      0|            return 0;
 1367|      0|        *val = q;
 1368|      0|        *max_len = alloc_sz;
 1369|      0|    }
 1370|       |
 1371|    380|    if (*max_len < sz) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 380]
  ------------------
 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|    380|    memcpy(*val, p->data, sz);
 1376|    380|    return 1;
 1377|    380|}
params.c:set_string_internal:
 1419|    142|{
 1420|    142|    if (p->data_type != type) {
  ------------------
  |  Branch (1420:9): [True: 0, False: 142]
  ------------------
 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|    142|    p->return_size = len;
 1425|    142|    if (p->data == NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 142]
  ------------------
 1426|      0|        return 1;
 1427|    142|    if (p->data_size < len) {
  ------------------
  |  Branch (1427:9): [True: 0, False: 142]
  ------------------
 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|    142|    memcpy(p->data, val, len);
 1433|       |    /* If possible within the size of p->data, add a NUL terminator byte */
 1434|    142|    if (type == OSSL_PARAM_UTF8_STRING && p->data_size > len)
  ------------------
  |  |  117|    284|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1434:9): [True: 142, False: 0]
  |  Branch (1434:43): [True: 142, False: 0]
  ------------------
 1435|    142|        ((char *)p->data)[len] = '\0';
 1436|    142|    return 1;
 1437|    142|}
params.c:get_string_ptr_internal:
 1670|     30|{
 1671|     30|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1671:9): [True: 0, False: 30]
  |  Branch (1671:24): [True: 0, False: 30]
  ------------------
 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|     30|    if (p->data_type == ref_type)
  ------------------
  |  Branch (1676:9): [True: 0, False: 30]
  ------------------
 1677|      0|        return get_ptr_internal_skip_checks(p, (const void **)val, used_len);
 1678|       |
 1679|     30|    if (p->data_type != type) {
  ------------------
  |  Branch (1679:9): [True: 0, False: 30]
  ------------------
 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|     30|    if (used_len != NULL)
  ------------------
  |  Branch (1683:9): [True: 30, False: 0]
  ------------------
 1684|     30|        *used_len = p->data_size;
 1685|     30|    *val = p->data;
 1686|     30|    return 1;
 1687|     30|}

ossl_param_bytes_to_blocks:
   30|     28|{
   31|     28|    return (bytes + OSSL_PARAM_ALIGN_SIZE - 1) / OSSL_PARAM_ALIGN_SIZE;
  ------------------
  |  |   22|     28|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
                  return (bytes + OSSL_PARAM_ALIGN_SIZE - 1) / OSSL_PARAM_ALIGN_SIZE;
  ------------------
  |  |   22|     28|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
   32|     28|}
ossl_param_set_secure_block:
   49|      4|{
   50|      4|    last->key = NULL;
   51|      4|    last->data_size = secure_buffer_sz;
   52|      4|    last->data = secure_buffer;
   53|      4|    last->data_type = OSSL_PARAM_ALLOCATED_END;
  ------------------
  |  |   15|      4|#define OSSL_PARAM_ALLOCATED_END    127
  ------------------
   54|      4|}
OSSL_PARAM_dup:
   99|      4|{
  100|      4|    size_t param_blocks;
  101|      4|    OSSL_PARAM_BUF buf[OSSL_PARAM_BUF_MAX];
  102|      4|    OSSL_PARAM *last, *dst;
  103|      4|    int param_count = 1; /* Include terminator in the count */
  104|       |
  105|      4|    if (src == NULL) {
  ------------------
  |  Branch (105:9): [True: 0, False: 4]
  ------------------
  106|      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)
  |  |  ------------------
  ------------------
  107|      0|        return NULL;
  108|      0|    }
  109|       |
  110|      4|    memset(buf, 0, sizeof(buf));
  111|       |
  112|       |    /* First Pass: get the param_count and block sizes required */
  113|      4|    (void)ossl_param_dup(src, NULL, buf, &param_count);
  114|       |
  115|      4|    param_blocks = ossl_param_bytes_to_blocks(param_count * sizeof(*src));
  116|       |    /*
  117|       |     * The allocated buffer consists of an array of OSSL_PARAM followed by
  118|       |     * aligned data bytes that the array elements will point to.
  119|       |     */
  120|      4|    if (!ossl_param_buf_alloc(&buf[OSSL_PARAM_BUF_PUBLIC], param_blocks, 0))
  ------------------
  |  |   18|      4|#define OSSL_PARAM_BUF_PUBLIC 0
  ------------------
  |  Branch (120:9): [True: 0, False: 4]
  ------------------
  121|      0|        return NULL;
  122|       |
  123|       |    /* Allocate a secure memory buffer if required */
  124|      4|    if (buf[OSSL_PARAM_BUF_SECURE].blocks > 0
  ------------------
  |  |   19|      4|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  |  Branch (124:9): [True: 0, False: 4]
  ------------------
  125|      4|        && !ossl_param_buf_alloc(&buf[OSSL_PARAM_BUF_SECURE], 0, 1)) {
  ------------------
  |  |   19|      0|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  |  Branch (125:12): [True: 0, False: 0]
  ------------------
  126|      0|        OPENSSL_free(buf[OSSL_PARAM_BUF_PUBLIC].alloc);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|      0|        return NULL;
  128|      0|    }
  129|       |
  130|      4|    dst = (OSSL_PARAM *)buf[OSSL_PARAM_BUF_PUBLIC].alloc;
  ------------------
  |  |   18|      4|#define OSSL_PARAM_BUF_PUBLIC 0
  ------------------
  131|      4|    last = ossl_param_dup(src, dst, buf, NULL);
  132|       |    /* Store the allocated secure memory buffer in the last param block */
  133|      4|    ossl_param_set_secure_block(last, buf[OSSL_PARAM_BUF_SECURE].alloc,
  ------------------
  |  |   19|      4|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  134|      4|                                buf[OSSL_PARAM_BUF_SECURE].alloc_sz);
  ------------------
  |  |   19|      4|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  135|      4|    return dst;
  136|      4|}
OSSL_PARAM_free:
  226|      4|{
  227|      4|    if (params != NULL) {
  ------------------
  |  Branch (227:9): [True: 4, False: 0]
  ------------------
  228|      4|        OSSL_PARAM *p;
  229|       |
  230|     16|        for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (230:26): [True: 12, False: 4]
  ------------------
  231|     12|            ;
  232|      4|        if (p->data_type == OSSL_PARAM_ALLOCATED_END)
  ------------------
  |  |   15|      4|#define OSSL_PARAM_ALLOCATED_END    127
  ------------------
  |  Branch (232:13): [True: 4, False: 0]
  ------------------
  233|      4|            OPENSSL_secure_clear_free(p->data, p->data_size);
  ------------------
  |  |  129|      4|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|      4|        OPENSSL_free(params);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  235|      4|    }
  236|      4|}
params_dup.c:ossl_param_dup:
   59|      8|{
   60|      8|    const OSSL_PARAM *in;
   61|      8|    int has_dst = (dst != NULL);
   62|      8|    int is_secure;
   63|      8|    size_t param_sz, blks;
   64|       |
   65|     32|    for (in = src; in->key != NULL; in++) {
  ------------------
  |  Branch (65:20): [True: 24, False: 8]
  ------------------
   66|     24|        is_secure = CRYPTO_secure_allocated(in->data);
   67|     24|        if (has_dst) {
  ------------------
  |  Branch (67:13): [True: 12, False: 12]
  ------------------
   68|     12|            *dst = *in;
   69|     12|            dst->data = buf[is_secure].cur;
   70|     12|        }
   71|       |
   72|     24|        if (in->data_type == OSSL_PARAM_OCTET_PTR
  ------------------
  |  |  160|     48|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (72:13): [True: 0, False: 24]
  ------------------
   73|     24|            || in->data_type == OSSL_PARAM_UTF8_PTR) {
  ------------------
  |  |  141|     24|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
  |  Branch (73:16): [True: 0, False: 24]
  ------------------
   74|      0|            param_sz = sizeof(in->data);
   75|      0|            if (has_dst)
  ------------------
  |  Branch (75:17): [True: 0, False: 0]
  ------------------
   76|      0|                *((const void **)dst->data) = *(const void **)in->data;
   77|     24|        } else {
   78|     24|            param_sz = in->data_size;
   79|     24|            if (has_dst)
  ------------------
  |  Branch (79:17): [True: 12, False: 12]
  ------------------
   80|     12|                memcpy(dst->data, in->data, param_sz);
   81|     24|        }
   82|     24|        if (in->data_type == OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|     24|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (82:13): [True: 0, False: 24]
  ------------------
   83|      0|            param_sz++; /* NULL terminator */
   84|     24|        blks = ossl_param_bytes_to_blocks(param_sz);
   85|       |
   86|     24|        if (has_dst) {
  ------------------
  |  Branch (86:13): [True: 12, False: 12]
  ------------------
   87|     12|            dst++;
   88|     12|            buf[is_secure].cur += blks;
   89|     12|        } else {
   90|     12|            buf[is_secure].blocks += blks;
   91|     12|        }
   92|     24|        if (param_count != NULL)
  ------------------
  |  Branch (92:13): [True: 12, False: 12]
  ------------------
   93|     12|            ++*param_count;
   94|     24|    }
   95|      8|    return dst;
   96|      8|}
params_dup.c:ossl_param_buf_alloc:
   36|      4|{
   37|      4|    size_t sz = OSSL_PARAM_ALIGN_SIZE * (extra_blocks + out->blocks);
  ------------------
  |  |   22|      4|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
   38|       |
   39|      4|    out->alloc = is_secure ? OPENSSL_secure_zalloc(sz) : OPENSSL_zalloc(sz);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
                  out->alloc = is_secure ? OPENSSL_secure_zalloc(sz) : OPENSSL_zalloc(sz);
  ------------------
  |  |  104|      8|        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 (39:18): [True: 0, False: 4]
  ------------------
   40|      4|    if (out->alloc == NULL)
  ------------------
  |  Branch (40:9): [True: 0, False: 4]
  ------------------
   41|      0|        return 0;
   42|      4|    out->alloc_sz = sz;
   43|      4|    out->cur = out->alloc + extra_blocks;
   44|      4|    return 1;
   45|      4|}

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

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

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

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

ossl_ctx_global_properties_free:
  115|      1|{
  116|      1|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  117|       |
  118|      1|    if (globp != NULL) {
  ------------------
  |  Branch (118:9): [True: 1, False: 0]
  ------------------
  119|      1|        ossl_property_free(globp->list);
  120|      1|        OPENSSL_free(globp);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  121|      1|    }
  122|      1|}
ossl_ctx_global_properties_new:
  125|      1|{
  126|      1|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  127|      1|}
ossl_ctx_global_properties:
  131|     18|{
  132|     18|    OSSL_GLOBAL_PROPERTIES *globp;
  133|       |
  134|     18|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  135|     18|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (135:9): [True: 0, False: 18]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|      0|        return NULL;
  137|     18|#endif
  138|     18|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  114|     18|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  139|       |
  140|     18|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (140:12): [True: 18, False: 0]
  ------------------
  141|     18|}
ossl_method_store_new:
  244|      4|{
  245|      4|    OSSL_METHOD_STORE *res;
  246|       |
  247|      4|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  248|      4|    if (res != NULL) {
  ------------------
  |  Branch (248:9): [True: 4, False: 0]
  ------------------
  249|      4|        res->ctx = ctx;
  250|      4|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (250:13): [True: 0, False: 4]
  ------------------
  251|      4|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (251:16): [True: 0, False: 4]
  ------------------
  252|      4|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (252:16): [True: 0, False: 4]
  ------------------
  253|      0|            ossl_method_store_free(res);
  254|      0|            return NULL;
  255|      0|        }
  256|      4|    }
  257|      4|    return res;
  258|      4|}
ossl_method_store_free:
  261|      4|{
  262|      4|    if (store != NULL) {
  ------------------
  |  Branch (262:9): [True: 4, False: 0]
  ------------------
  263|      4|        if (store->algs != NULL)
  ------------------
  |  Branch (263:13): [True: 4, False: 0]
  ------------------
  264|      4|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  265|      4|        ossl_sa_ALGORITHM_free(store->algs);
  266|      4|        CRYPTO_THREAD_lock_free(store->lock);
  267|      4|        CRYPTO_THREAD_lock_free(store->biglock);
  268|      4|        OPENSSL_free(store);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  269|      4|    }
  270|      4|}
ossl_method_lock_store:
  273|     20|{
  274|     20|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (274:12): [True: 20, False: 0]
  ------------------
  275|     20|}
ossl_method_unlock_store:
  278|     20|{
  279|     20|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (279:12): [True: 20, False: 0]
  ------------------
  280|     20|}
ossl_method_store_add:
  321|    261|{
  322|    261|    ALGORITHM *alg = NULL;
  323|    261|    IMPLEMENTATION *impl;
  324|    261|    int ret = 0;
  325|    261|    int i;
  326|       |
  327|    261|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 261]
  |  Branch (327:21): [True: 0, False: 261]
  |  Branch (327:39): [True: 0, False: 261]
  ------------------
  328|      0|        return 0;
  329|       |
  330|    261|    if (properties == NULL)
  ------------------
  |  Branch (330:9): [True: 0, False: 261]
  ------------------
  331|      0|        properties = "";
  332|       |
  333|    261|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|    261|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    261|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (333:9): [True: 0, False: 261]
  ------------------
  334|      0|        return 0;
  335|       |
  336|       |    /* Create new entry */
  337|    261|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  102|    261|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  338|    261|    if (impl == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 261]
  ------------------
  339|      0|        return 0;
  340|    261|    impl->method.method = method;
  341|    261|    impl->method.up_ref = method_up_ref;
  342|    261|    impl->method.free = method_destruct;
  343|    261|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 261]
  ------------------
  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|    261|    impl->provider = prov;
  348|       |
  349|       |    /* Insert into the hash table if required */
  350|    261|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (350:9): [True: 0, False: 261]
  ------------------
  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|    261|    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|    261|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (373:9): [True: 1, False: 260]
  ------------------
  374|      1|        impl->properties = ossl_parse_property(store->ctx, properties);
  375|      1|        if (impl->properties == NULL)
  ------------------
  |  Branch (375:13): [True: 0, False: 1]
  ------------------
  376|      0|            goto err;
  377|      1|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (377:13): [True: 0, False: 1]
  ------------------
  378|      0|            ossl_property_free(impl->properties);
  379|      0|            impl->properties = NULL;
  380|      0|            goto err;
  381|      0|        }
  382|      1|    }
  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|    261|    alg = ossl_method_store_retrieve(store, nid);
  389|    261|    if (alg == NULL) {
  ------------------
  |  Branch (389:9): [True: 261, False: 0]
  ------------------
  390|    261|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  104|    261|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (390:13): [True: 0, False: 261]
  ------------------
  391|    261|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (391:20): [True: 0, False: 261]
  ------------------
  392|    261|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (392:20): [True: 0, False: 261]
  ------------------
  393|      0|            goto err;
  394|    261|        alg->nid = nid;
  395|    261|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (395:13): [True: 0, False: 261]
  ------------------
  396|      0|            goto err;
  397|    261|        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, (void *)store);
  ------------------
  |  |  293|    261|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    261|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  398|    261|    }
  399|       |
  400|       |    /* Push onto stack if there isn't one there already */
  401|    261|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (401:17): [True: 0, False: 261]
  ------------------
  402|      0|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  403|       |
  404|      0|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (404:13): [True: 0, False: 0]
  ------------------
  405|      0|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (405:16): [True: 0, False: 0]
  ------------------
  406|      0|            break;
  407|      0|    }
  408|       |
  409|    261|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (409:9): [True: 261, False: 0]
  ------------------
  410|    261|        && sk_IMPLEMENTATION_push(alg->impls, impl)) {
  ------------------
  |  Branch (410:12): [True: 261, False: 0]
  ------------------
  411|    261|        ret = 1;
  412|    261|#ifndef FIPS_MODULE
  413|    261|        OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|    261|    do {                                        \
  |  |  221|    261|        BIO *trc_out = NULL;                    \
  |  |  222|    261|        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|    261|        } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|    261|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  420|    261|#endif
  421|    261|    }
  422|    261|    ossl_property_unlock(store);
  423|    261|    if (ret == 0)
  ------------------
  |  Branch (423:9): [True: 0, False: 261]
  ------------------
  424|      0|        impl_free(impl);
  425|    261|    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|    261|}
ossl_method_store_fetch:
  624|     18|{
  625|     18|    OSSL_PROPERTY_LIST **plp;
  626|     18|    ALGORITHM *alg;
  627|     18|    IMPLEMENTATION *impl, *best_impl = NULL;
  628|     18|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  629|     18|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (629:33): [True: 18, False: 0]
  ------------------
  630|     18|    int ret = 0;
  631|     18|    int j, best = -1, score, optional;
  632|       |
  633|     18|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 18]
  |  Branch (633:21): [True: 0, False: 18]
  |  Branch (633:39): [True: 0, False: 18]
  ------------------
  634|      0|        return 0;
  635|       |
  636|     18|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  637|     18|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (637:9): [True: 18, False: 0]
  ------------------
  638|     18|            && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|     18|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (638:16): [True: 0, False: 18]
  ------------------
  639|      0|        return 0;
  640|     18|#endif
  641|       |
  642|       |    /* This only needs to be a read lock, because the query won't create anything */
  643|     18|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (643:9): [True: 0, False: 18]
  ------------------
  644|      0|        return 0;
  645|       |
  646|     18|    OSSL_TRACE2(QUERY, "Retrieving 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)
  |  |  ------------------
  ------------------
  647|     18|    alg = ossl_method_store_retrieve(store, nid);
  648|     18|    if (alg == NULL) {
  ------------------
  |  Branch (648:9): [True: 0, False: 18]
  ------------------
  649|      0|        ossl_property_unlock(store);
  650|      0|        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  651|      0|        return 0;
  652|      0|    }
  653|     18|    OSSL_TRACE2(QUERY, "Retrieved 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)
  |  |  ------------------
  ------------------
  654|       |
  655|       |    /*
  656|       |     * If a property query string is provided, convert it to an
  657|       |     * OSSL_PROPERTY_LIST structure
  658|       |     */
  659|     18|    if (prop_query != NULL)
  ------------------
  |  Branch (659:9): [True: 18, False: 0]
  ------------------
  660|     18|        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|     18|    plp = ossl_ctx_global_properties(store->ctx, 0);
  667|     18|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (667:9): [True: 18, False: 0]
  |  Branch (667:24): [True: 0, False: 18]
  ------------------
  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|     18|    if (pq == NULL) {
  ------------------
  |  Branch (686:9): [True: 0, False: 18]
  ------------------
  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|     18|    optional = ossl_property_has_optional(pq);
  704|     24|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (704:17): [True: 18, False: 6]
  ------------------
  705|     18|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (705:13): [True: 18, False: 0]
  ------------------
  706|     18|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (706:17): [True: 13, False: 5]
  |  Branch (706:33): [True: 5, False: 0]
  ------------------
  707|     18|            score = ossl_property_match_count(pq, impl->properties);
  708|     18|            if (score > best) {
  ------------------
  |  Branch (708:17): [True: 18, False: 0]
  ------------------
  709|     18|                best_impl = impl;
  710|     18|                best = score;
  711|     18|                ret = 1;
  712|     18|                if (!optional)
  ------------------
  |  Branch (712:21): [True: 12, False: 6]
  ------------------
  713|     12|                    goto fin;
  714|     18|            }
  715|     18|        }
  716|     18|    }
  717|     18|fin:
  718|     18|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (718:9): [True: 18, False: 0]
  |  Branch (718:16): [True: 18, False: 0]
  ------------------
  719|     18|        *method = best_impl->method.method;
  720|     18|        if (prov_rw != NULL)
  ------------------
  |  Branch (720:13): [True: 18, False: 0]
  ------------------
  721|     18|            *prov_rw = best_impl->provider;
  722|     18|    } else {
  723|      0|        ret = 0;
  724|      0|    }
  725|       |
  726|     18|#ifndef FIPS_MODULE
  727|     18|    OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|     18|    do {                                        \
  |  |  221|     18|        BIO *trc_out = NULL;                    \
  |  |  222|     18|        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|     18|    } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|     18|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  738|     18|#endif
  739|       |
  740|     18|    ossl_property_unlock(store);
  741|     18|    ossl_property_free(p2);
  742|     18|    return ret;
  743|     18|}
ossl_method_store_cache_get:
  846|  2.06k|{
  847|  2.06k|    ALGORITHM *alg;
  848|  2.06k|    QUERY elem, *r;
  849|  2.06k|    int res = 0;
  850|       |
  851|  2.06k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (851:9): [True: 0, False: 2.06k]
  |  Branch (851:21): [True: 0, False: 2.06k]
  |  Branch (851:38): [True: 0, False: 2.06k]
  ------------------
  852|      0|        return 0;
  853|       |
  854|  2.06k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (854:9): [True: 0, False: 2.06k]
  ------------------
  855|      0|        return 0;
  856|  2.06k|    alg = ossl_method_store_retrieve(store, nid);
  857|  2.06k|    if (alg == NULL)
  ------------------
  |  Branch (857:9): [True: 1, False: 2.06k]
  ------------------
  858|      1|        goto err;
  859|       |
  860|  2.06k|    elem.query = prop_query;
  861|  2.06k|    elem.provider = prov;
  862|  2.06k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  863|  2.06k|    if (r == NULL)
  ------------------
  |  Branch (863:9): [True: 13, False: 2.05k]
  ------------------
  864|     13|        goto err;
  865|  2.05k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (865:9): [True: 2.05k, False: 0]
  ------------------
  866|  2.05k|        *method = r->method.method;
  867|  2.05k|        res = 1;
  868|  2.05k|    }
  869|  2.06k|err:
  870|  2.06k|    ossl_property_unlock(store);
  871|  2.06k|    return res;
  872|  2.05k|}
ossl_method_store_cache_set:
  878|     18|{
  879|     18|    QUERY elem, *old, *p = NULL;
  880|     18|    ALGORITHM *alg;
  881|     18|    size_t len;
  882|     18|    int res = 1;
  883|       |
  884|     18|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (884:9): [True: 0, False: 18]
  |  Branch (884:21): [True: 0, False: 18]
  |  Branch (884:38): [True: 0, False: 18]
  ------------------
  885|      0|        return 0;
  886|       |
  887|     18|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|     18|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     18|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (887:9): [True: 0, False: 18]
  ------------------
  888|      0|        return 0;
  889|       |
  890|     18|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (890:9): [True: 0, False: 18]
  ------------------
  891|      0|        return 0;
  892|     18|    if (store->cache_need_flush)
  ------------------
  |  Branch (892:9): [True: 0, False: 18]
  ------------------
  893|      0|        ossl_method_cache_flush_some(store);
  894|     18|    alg = ossl_method_store_retrieve(store, nid);
  895|     18|    if (alg == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 18]
  ------------------
  896|      0|        goto err;
  897|       |
  898|     18|    if (method == NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 18]
  ------------------
  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|     18|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |  102|     18|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  908|     18|    if (p != NULL) {
  ------------------
  |  Branch (908:9): [True: 18, False: 0]
  ------------------
  909|     18|        p->query = p->body;
  910|     18|        p->provider = prov;
  911|     18|        p->method.method = method;
  912|     18|        p->method.up_ref = method_up_ref;
  913|     18|        p->method.free = method_destruct;
  914|     18|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (914:13): [True: 0, False: 18]
  ------------------
  915|      0|            goto err;
  916|     18|        memcpy((char *)p->query, prop_query, len + 1);
  917|     18|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (917:13): [True: 0, False: 18]
  ------------------
  918|      0|            impl_cache_free(old);
  919|      0|            goto end;
  920|      0|        }
  921|     18|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (921:13): [True: 18, False: 0]
  ------------------
  922|     18|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   34|     18|#define IMPL_CACHE_FLUSH_THRESHOLD  500
  ------------------
  |  Branch (922:17): [True: 0, False: 18]
  ------------------
  923|      0|                store->cache_need_flush = 1;
  924|     18|            goto end;
  925|     18|        }
  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|     18|end:
  932|     18|    ossl_property_unlock(store);
  933|     18|    return res;
  934|      0|}
property.c:alg_cleanup:
  226|    261|{
  227|    261|    OSSL_METHOD_STORE *store = arg;
  228|       |
  229|    261|    if (a != NULL) {
  ------------------
  |  Branch (229:9): [True: 261, False: 0]
  ------------------
  230|    261|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  231|    261|        lh_QUERY_doall(a->cache, &impl_cache_free);
  232|    261|        lh_QUERY_free(a->cache);
  233|    261|        OPENSSL_free(a);
  ------------------
  |  |  115|    261|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|    261|    }
  235|    261|    if (store != NULL)
  ------------------
  |  Branch (235:9): [True: 261, False: 0]
  ------------------
  236|    261|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  237|    261|}
property.c:ossl_method_up_ref:
  163|  2.35k|{
  164|  2.35k|    return (*method->up_ref)(method->method);
  165|  2.35k|}
property.c:ossl_property_write_lock:
  178|    279|{
  179|    279|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (179:12): [True: 279, False: 0]
  ------------------
  180|    279|}
property.c:impl_free:
  204|    261|{
  205|    261|    if (impl != NULL) {
  ------------------
  |  Branch (205:9): [True: 261, False: 0]
  ------------------
  206|    261|        ossl_method_free(&impl->method);
  207|    261|        OPENSSL_free(impl);
  ------------------
  |  |  115|    261|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    261|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    261|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|    261|    }
  209|    261|}
property.c:ossl_method_store_retrieve:
  283|  2.62k|{
  284|  2.62k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  285|  2.62k|}
property.c:query_hash:
  188|  2.08k|{
  189|  2.08k|    return OPENSSL_LH_strhash(a->query);
  190|  2.08k|}
property.c:query_cmp:
  193|  2.05k|{
  194|  2.05k|    int res = strcmp(a->query, b->query);
  195|       |
  196|  2.05k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (196:9): [True: 2.05k, False: 0]
  |  Branch (196:21): [True: 2.05k, False: 0]
  |  Branch (196:44): [True: 381, False: 1.67k]
  ------------------
  197|    381|        res = b->provider > a->provider ? 1
  ------------------
  |  Branch (197:15): [True: 0, False: 381]
  ------------------
  198|    381|            : b->provider < a->provider ? -1
  ------------------
  |  Branch (198:15): [True: 0, False: 381]
  ------------------
  199|    381|            : 0;
  200|  2.05k|    return res;
  201|  2.05k|}
property.c:ossl_method_store_insert:
  288|    261|{
  289|    261|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  290|    261|}
property.c:ossl_property_unlock:
  183|  2.36k|{
  184|  2.36k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (184:12): [True: 2.36k, False: 0]
  ------------------
  185|  2.36k|}
property.c:ossl_property_read_lock:
  173|  2.08k|{
  174|  2.08k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (174:12): [True: 2.08k, False: 0]
  ------------------
  175|  2.08k|}
property.c:ossl_method_cache_flush:
  753|    261|{
  754|    261|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  755|       |
  756|    261|    if (alg != NULL)
  ------------------
  |  Branch (756:9): [True: 0, False: 261]
  ------------------
  757|      0|        ossl_method_cache_flush_alg(store, alg);
  758|    261|}
property.c:impl_cache_free:
  212|     18|{
  213|     18|    if (elem != NULL) {
  ------------------
  |  Branch (213:9): [True: 18, False: 0]
  ------------------
  214|     18|        ossl_method_free(&elem->method);
  215|     18|        OPENSSL_free(elem);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|     18|    }
  217|     18|}
property.c:ossl_method_free:
  168|    279|{
  169|    279|    (*method->free)(method->method);
  170|    279|}

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

ossl_parse_property:
  346|      1|{
  347|      1|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|      1|    OSSL_PROPERTY_LIST *res = NULL;
  349|      1|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  350|      1|    const char *s = defn;
  351|      1|    int done;
  352|       |
  353|      1|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 1]
  |  Branch (353:22): [True: 0, False: 1]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|      1|    s = skip_space(s);
  357|      1|    done = *s == '\0';
  358|      2|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 1, False: 1]
  ------------------
  359|      1|        const char *start = s;
  360|       |
  361|      1|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      1|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 1]
  ------------------
  363|      0|            goto err;
  364|      1|        memset(&prop->v, 0, sizeof(prop->v));
  365|      1|        prop->optional = 0;
  366|      1|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 1]
  ------------------
  367|      0|            goto err;
  368|      1|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|      1|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1]
  ------------------
  370|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  371|      0|                           "Unknown name HERE-->%s", start);
  372|      0|            goto err;
  373|      0|        }
  374|      1|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 1, False: 0]
  ------------------
  375|      1|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 1]
  ------------------
  376|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   34|      0|# define PROP_R_NO_VALUE                                  107
  ------------------
  377|      0|                               "HERE-->%s", start);
  378|      0|                goto err;
  379|      0|            }
  380|      1|        } else {
  381|       |            /* A name alone means a true Boolean */
  382|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  383|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  384|      0|        }
  385|       |
  386|      1|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 1]
  ------------------
  387|      0|            goto err;
  388|      1|        prop = NULL;
  389|      1|        done = !match_ch(&s, ',');
  390|      1|    }
  391|      1|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 1]
  ------------------
  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|      1|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|      1|err:
  399|      1|    OPENSSL_free(prop);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  400|      1|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|      1|    return res;
  402|      1|}
ossl_parse_query:
  406|     18|{
  407|     18|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|     18|# define STACK_OF(type) struct stack_st_##type
  ------------------
  408|     18|    OSSL_PROPERTY_LIST *res = NULL;
  409|     18|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|     18|    int done;
  411|       |
  412|     18|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 18]
  |  Branch (412:22): [True: 0, False: 18]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|     18|    s = skip_space(s);
  416|     18|    done = *s == '\0';
  417|     24|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 6, False: 18]
  ------------------
  418|      6|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      6|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|      6|        if (prop == NULL)
  ------------------
  |  Branch (419:13): [True: 0, False: 6]
  ------------------
  420|      0|            goto err;
  421|      6|        memset(&prop->v, 0, sizeof(prop->v));
  422|       |
  423|      6|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (423:13): [True: 0, False: 6]
  ------------------
  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|      6|        prop->optional = match_ch(&s, '?');
  431|      6|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (431:13): [True: 0, False: 6]
  ------------------
  432|      0|            goto err;
  433|       |
  434|      6|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (434:13): [True: 6, False: 0]
  ------------------
  435|      6|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  436|      6|        } 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|      6|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (445:13): [True: 6, False: 0]
  ------------------
  446|      6|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  447|       |
  448|      6|skip_value:
  449|      6|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (449:13): [True: 0, False: 6]
  ------------------
  450|      0|            goto err;
  451|      6|        prop = NULL;
  452|      6|        done = !match_ch(&s, ',');
  453|      6|    }
  454|     18|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 18]
  ------------------
  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|     18|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|     18|err:
  462|     18|    OPENSSL_free(prop);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|     18|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|     18|    return res;
  465|     18|}
ossl_property_match_count:
  473|     18|{
  474|     18|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|     18|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|     18|    int i = 0, j = 0, matches = 0;
  477|     18|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|     30|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 12, False: 18]
  ------------------
  480|     12|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (480:13): [True: 0, False: 12]
  ------------------
  481|      0|            i++;
  482|      0|            continue;
  483|      0|        }
  484|     12|        if (j < defn->num_properties) {
  ------------------
  |  Branch (484:13): [True: 6, False: 6]
  ------------------
  485|      6|            if (q[i].name_idx > d[j].name_idx) {  /* skip defn, not in query */
  ------------------
  |  Branch (485:17): [True: 6, False: 0]
  ------------------
  486|      6|                j++;
  487|      6|                continue;
  488|      6|            }
  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|      6|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (509:13): [True: 6, False: 0]
  ------------------
  510|      6|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (510:17): [True: 0, False: 6]
  ------------------
  511|      0|                matches++;
  512|      6|            else if (!q[i].optional)
  ------------------
  |  Branch (512:22): [True: 0, False: 6]
  ------------------
  513|      0|                return -1;
  514|      6|        } 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|      6|        i++;
  525|      6|    }
  526|     18|    return matches;
  527|     18|}
ossl_property_free:
  530|     20|{
  531|     20|    OPENSSL_free(p);
  ------------------
  |  |  115|     20|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     20|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     20|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|     20|}
ossl_property_parse_init:
  575|      1|{
  576|      1|    static const char *const predefined_names[] = {
  577|      1|        "provider",     /* Name of provider (default, legacy, fips) */
  578|      1|        "version",      /* Version number of this provider */
  579|      1|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  580|      1|        "output",       /* Output type for encoders */
  581|      1|        "input",        /* Input type for decoders */
  582|      1|        "structure",    /* Structure name for encoders and decoders */
  583|      1|    };
  584|      1|    size_t i;
  585|       |
  586|      7|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|      7|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 6, False: 1]
  ------------------
  587|      6|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 6]
  ------------------
  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|      1|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      1|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (595:9): [True: 0, False: 1]
  ------------------
  596|      1|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      1|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (596:12): [True: 0, False: 1]
  ------------------
  597|      0|        goto err;
  598|       |
  599|      1|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|      1|}
property_parse.c:skip_space:
   26|     46|{
   27|     46|    while (ossl_isspace(*s))
  ------------------
  |  |   82|     46|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     46|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 46]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|     46|    return s;
   30|     46|}
property_parse.c:parse_name:
   58|      7|{
   59|      7|    char name[100];
   60|      7|    int err = 0;
   61|      7|    size_t i = 0;
   62|      7|    const char *s = *t;
   63|      7|    int user_name = 0;
   64|       |
   65|      7|    for (;;) {
   66|      7|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|      7|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      7|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      7|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      7|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 7]
  ------------------
   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|     32|        do {
   72|     32|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 32, False: 0]
  ------------------
   73|     32|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|     32|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|     32|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|     32|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|     32|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|     32|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|     32|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|     32|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 25, False: 7]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 32]
  ------------------
   77|      7|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 7, False: 0]
  ------------------
   78|      7|            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|      7|    name[i] = '\0';
   87|      7|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 7]
  ------------------
   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|      7|    *t = skip_space(s);
   92|      7|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 7]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|      7|    return 1;
   94|      7|}
property_parse.c:match_ch:
   33|     26|{
   34|     26|    const char *s = *t;
   35|       |
   36|     26|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 13, False: 13]
  ------------------
   37|     13|        *t = skip_space(s + 1);
   38|     13|        return 1;
   39|     13|    }
   40|     13|    return 0;
   41|     26|}
property_parse.c:parse_value:
  258|      7|{
  259|      7|    const char *s = *t;
  260|      7|    int r = 0;
  261|       |
  262|      7|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 7]
  |  Branch (262:22): [True: 0, False: 7]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|      7|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 7]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|      7|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 7]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|      7|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 7]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|      7|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 7]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|      7|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 7]
  ------------------
  279|      0|        return parse_number(t, res);
  280|      7|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|      7|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      7|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      7|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      7|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 7, False: 0]
  |  |  ------------------
  ------------------
  281|      7|        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|      7|}
property_parse.c:parse_unquoted:
  226|      7|{
  227|      7|    char v[1000];
  228|      7|    const char *s = *t;
  229|      7|    size_t i = 0;
  230|      7|    int err = 0;
  231|       |
  232|      7|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 7]
  |  Branch (232:23): [True: 0, False: 7]
  ------------------
  233|      0|        return 0;
  234|     38|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|     76|# define ossl_isprint(c)        (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|     38|# define CTYPE_MASK_print       0x100
  |  |  ------------------
  |  |  |  Branch (80:33): [True: 31, False: 7]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|     69|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     31|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 31, False: 0]
  |  Branch (234:53): [True: 31, False: 0]
  ------------------
  235|     31|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 31, False: 0]
  ------------------
  236|     31|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|     31|        s++;
  240|     31|    }
  241|      7|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|     14|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|      7|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 7, False: 0]
  |  Branch (241:30): [True: 0, False: 7]
  |  Branch (241:44): [True: 0, False: 0]
  ------------------
  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|      7|    v[i] = 0;
  247|      7|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 7]
  ------------------
  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|      7|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 6, False: 1]
  ------------------
  250|      6|        err = 1;
  251|      7|    *t = skip_space(s);
  252|      7|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|      7|    return !err;
  254|      7|}
property_parse.c:stack_to_property_list:
  314|     19|{
  315|     19|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|     19|    OSSL_PROPERTY_LIST *r;
  317|     19|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|     19|    int i;
  319|       |
  320|     19|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|     38|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     19|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     19|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 12, False: 7]
  |  |  ------------------
  ------------------
  321|     19|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|     19|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 19, False: 0]
  ------------------
  323|     19|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|     19|        r->has_optional = 0;
  326|     26|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 7, False: 19]
  ------------------
  327|      7|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|      7|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|      7|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 0, False: 7]
  |  Branch (331:26): [True: 0, False: 0]
  ------------------
  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|      7|            prev_name_idx = r->properties[i].name_idx;
  339|      7|        }
  340|     19|        r->num_properties = n;
  341|     19|    }
  342|     19|    return r;
  343|     19|}
property_parse.c:pd_free:
  301|      7|{
  302|      7|    OPENSSL_free(pd);
  ------------------
  |  |  115|      7|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|      7|}

ossl_property_has_optional:
   63|     18|{
   64|     18|    return query->has_optional ? 1 : 0;
  ------------------
  |  Branch (64:12): [True: 6, False: 12]
  ------------------
   65|     18|}

ossl_property_string_data_free:
   77|      1|{
   78|      1|    PROPERTY_STRING_DATA *propdata = vpropdata;
   79|       |
   80|      1|    if (propdata == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 1]
  ------------------
   81|      0|        return;
   82|       |
   83|      1|    CRYPTO_THREAD_lock_free(propdata->lock);
   84|      1|    property_table_free(&propdata->prop_names);
   85|      1|    property_table_free(&propdata->prop_values);
   86|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
   87|      1|    sk_OPENSSL_CSTRING_free(propdata->prop_namelist);
  ------------------
  |  |  261|      1|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   88|      1|    sk_OPENSSL_CSTRING_free(propdata->prop_valuelist);
  ------------------
  |  |  261|      1|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   89|      1|    propdata->prop_namelist = propdata->prop_valuelist = NULL;
   90|      1|#endif
   91|      1|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   92|       |
   93|      1|    OPENSSL_free(propdata);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   94|      1|}
ossl_property_string_data_new:
   96|      1|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      1|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   98|       |
   99|      1|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 1]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      1|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      1|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      1|                                                  &property_cmp);
  105|      1|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      1|                                                   &property_cmp);
  107|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      1|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      1|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      1|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      1|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      1|#endif
  111|      1|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 1]
  ------------------
  112|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      1|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 1]
  ------------------
  114|      1|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 1]
  ------------------
  115|      1|#endif
  116|      1|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 1]
  ------------------
  117|      1|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 1]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      1|    return propdata;
  122|      1|}
ossl_property_name:
  253|     13|{
  254|     13|    return ossl_property_string(ctx, 1, create, s);
  255|     13|}
ossl_property_value:
  264|      9|{
  265|      9|    return ossl_property_string(ctx, 0, create, s);
  266|      9|}
property_string.c:property_table_free:
   66|      2|{
   67|      2|    PROP_TABLE *t = *pt;
   68|       |
   69|      2|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 2, False: 0]
  ------------------
   70|      2|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|      2|        lh_PROPERTY_STRING_free(t);
   72|      2|        *pt = NULL;
   73|      2|    }
   74|      2|}
property_string.c:property_free:
   61|      9|{
   62|      9|    OPENSSL_free(ps);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   63|      9|}
property_string.c:property_hash:
   51|     40|{
   52|     40|    return OPENSSL_LH_strhash(a->s);
   53|     40|}
property_string.c:property_cmp:
   56|      7|{
   57|      7|    return strcmp(a->s, b->s);
   58|      7|}
property_string.c:ossl_property_string:
  144|     22|{
  145|     22|    PROPERTY_STRING p, *ps, *ps_new;
  146|     22|    PROP_TABLE *t;
  147|     22|    OSSL_PROPERTY_IDX *pidx;
  148|     22|    PROPERTY_STRING_DATA *propdata
  149|     22|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|     22|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|     22|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 22]
  ------------------
  152|      0|        return 0;
  153|       |
  154|     22|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 13, False: 9]
  ------------------
  155|     22|    p.s = s;
  156|     22|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 22]
  ------------------
  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|     22|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|     22|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 15, False: 7]
  |  Branch (161:23): [True: 9, False: 6]
  ------------------
  162|      9|        CRYPTO_THREAD_unlock(propdata->lock);
  163|      9|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 9]
  ------------------
  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|      9|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 6, False: 3]
  ------------------
  168|      9|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|      9|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 9, False: 0]
  |  Branch (169:27): [True: 9, False: 0]
  ------------------
  170|      9|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|      9|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|      9|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|      9|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 6, False: 3]
  ------------------
  174|      9|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  265|      9|#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: 9]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|      9|#endif
  180|      9|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|      9|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 9]
  ------------------
  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|      9|            ps = ps_new;
  195|      9|        }
  196|      9|    }
  197|     22|    CRYPTO_THREAD_unlock(propdata->lock);
  198|     22|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 16, False: 6]
  ------------------
  199|     22|}
property_string.c:new_property_string:
  126|      9|{
  127|      9|    const size_t l = strlen(s);
  128|      9|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  102|      9|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|      9|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 9, False: 0]
  ------------------
  131|      9|        memcpy(ps->body, s, l + 1);
  132|      9|        ps->s = ps->body;
  133|      9|        ps->idx = ++*pidx;
  134|      9|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 9]
  ------------------
  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|      9|    }
  139|      9|    return ps;
  140|      9|}

ossl_child_prov_ctx_new:
   38|      1|{
   39|      1|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  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|      1|}
ossl_child_prov_ctx_free:
   43|      1|{
   44|      1|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|      1|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|      1|    OPENSSL_free(gbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   48|      1|}

ossl_prov_conf_ctx_new:
   31|      1|{
   32|      1|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   33|       |
   34|      1|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      1|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      1|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 1]
  ------------------
   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|      1|    return pcgbl;
   44|      1|}
ossl_prov_conf_ctx_free:
   47|      1|{
   48|      1|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|      1|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|      1|                              ossl_provider_free);
   52|       |
   53|      1|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|      1|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|      1|    OPENSSL_free(pcgbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   56|      1|}

ossl_provider_store_free:
  288|      1|{
  289|      1|    struct provider_store_st *store = vstore;
  290|      1|    size_t i;
  291|       |
  292|      1|    if (store == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 1]
  ------------------
  293|      0|        return;
  294|      1|    store->freeing = 1;
  295|      1|    OPENSSL_free(store->default_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__
  |  |  ------------------
  ------------------
  296|      1|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  297|      1|#ifndef FIPS_MODULE
  298|      1|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  299|      1|                                       ossl_provider_child_cb_free);
  300|      1|#endif
  301|      1|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  302|      1|    CRYPTO_THREAD_lock_free(store->lock);
  303|      1|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (303:17): [True: 0, False: 1]
  ------------------
  304|      0|        ossl_provider_info_clear(&store->provinfo[i]);
  305|      1|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  306|      1|    OPENSSL_free(store);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  307|      1|}
ossl_provider_store_new:
  310|      1|{
  311|      1|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  312|       |
  313|      1|    if (store == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 1]
  ------------------
  314|      1|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 1]
  ------------------
  315|      1|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 1]
  ------------------
  316|      1|#ifndef FIPS_MODULE
  317|      1|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (317:12): [True: 0, False: 1]
  ------------------
  318|      1|#endif
  319|      1|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (319:12): [True: 0, False: 1]
  ------------------
  320|      0|        ossl_provider_store_free(store);
  321|      0|        return NULL;
  322|      0|    }
  323|      1|    store->libctx = ctx;
  324|      1|    store->use_fallbacks = 1;
  325|       |
  326|      1|    return store;
  327|      1|}
ossl_provider_find:
  401|      3|{
  402|      3|    struct provider_store_st *store = NULL;
  403|      3|    OSSL_PROVIDER *prov = NULL;
  404|       |
  405|      3|    if ((store = get_provider_store(libctx)) != NULL) {
  ------------------
  |  Branch (405:9): [True: 3, False: 0]
  ------------------
  406|      3|        OSSL_PROVIDER tmpl = { 0, };
  407|      3|        int i;
  408|       |
  409|      3|#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|      3|        if (!noconfig) {
  ------------------
  |  Branch (414:13): [True: 0, False: 3]
  ------------------
  415|      0|            if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  ------------------
  416|      0|                OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  417|      0|        }
  418|      3|#endif
  419|       |
  420|      3|        tmpl.name = (char *)name;
  421|      3|        if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (421:13): [True: 0, False: 3]
  ------------------
  422|      0|            return NULL;
  423|      3|        sk_OSSL_PROVIDER_sort(store->providers);
  424|      3|        if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
  ------------------
  |  Branch (424:13): [True: 3, False: 0]
  ------------------
  425|      3|            prov = sk_OSSL_PROVIDER_value(store->providers, i);
  426|      3|        CRYPTO_THREAD_unlock(store->lock);
  427|      3|        if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (427:13): [True: 3, False: 0]
  |  Branch (427:29): [True: 0, False: 3]
  ------------------
  428|      0|            prov = NULL;
  429|      3|    }
  430|       |
  431|      3|    return prov;
  432|      3|}
ossl_provider_up_ref:
  477|    264|{
  478|    264|    int ref = 0;
  479|       |
  480|    264|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (480:9): [True: 0, False: 264]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    264|#ifndef FIPS_MODULE
  484|    264|    if (prov->ischild) {
  ------------------
  |  Branch (484:9): [True: 0, False: 264]
  ------------------
  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|    264|#endif
  491|       |
  492|    264|    return ref;
  493|    264|}
ossl_provider_free:
  725|    265|{
  726|    265|    if (prov != NULL) {
  ------------------
  |  Branch (726:9): [True: 265, False: 0]
  ------------------
  727|    265|        int ref = 0;
  728|       |
  729|    265|        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|    265|        if (ref == 0) {
  ------------------
  |  Branch (739:13): [True: 1, False: 264]
  ------------------
  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|    264|#ifndef FIPS_MODULE
  776|    264|        else if (prov->ischild) {
  ------------------
  |  Branch (776:18): [True: 0, False: 264]
  ------------------
  777|      0|            ossl_provider_free_parent(prov, 0);
  778|      0|        }
  779|    265|#endif
  780|    265|    }
  781|    265|}
OSSL_PROVIDER_get_conf_parameters:
  831|    948|{
  832|    948|    int i;
  833|       |
  834|    948|    if (prov->parameters == NULL)
  ------------------
  |  Branch (834:9): [True: 0, False: 948]
  ------------------
  835|      0|        return 1;
  836|       |
  837|    948|    for (i = 0; i < sk_INFOPAIR_num(prov->parameters); i++) {
  ------------------
  |  Branch (837:17): [True: 0, False: 948]
  ------------------
  838|      0|        INFOPAIR *pair = sk_INFOPAIR_value(prov->parameters, i);
  839|      0|        OSSL_PARAM *p = OSSL_PARAM_locate(params, pair->name);
  840|       |
  841|      0|        if (p != NULL
  ------------------
  |  Branch (841:13): [True: 0, False: 0]
  ------------------
  842|      0|            && !OSSL_PARAM_set_utf8_ptr(p, pair->value))
  ------------------
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|            return 0;
  844|      0|    }
  845|    948|    return 1;
  846|    948|}
ossl_provider_deactivate:
 1417|      1|{
 1418|      1|    int count;
 1419|       |
 1420|      1|    if (prov == NULL
  ------------------
  |  Branch (1420:9): [True: 0, False: 1]
  ------------------
 1421|      1|            || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1421:16): [True: 0, False: 1]
  ------------------
 1422|      0|        return 0;
 1423|      1|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1423:12): [True: 1, False: 0]
  ------------------
 1424|      1|}
ossl_provider_ctx:
 1427|  3.47k|{
 1428|  3.47k|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1428:12): [True: 3.47k, False: 0]
  ------------------
 1429|  3.47k|}
ossl_provider_doall_activated:
 1528|     15|{
 1529|     15|    int ret = 0, curr, max, ref = 0;
 1530|     15|    struct provider_store_st *store = get_provider_store(ctx);
 1531|     15|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|     15|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1532|       |
 1533|     15|#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|     15|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1538:9): [True: 15, False: 0]
  ------------------
 1539|     15|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|     15|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1540|     15|#endif
 1541|       |
 1542|     15|    if (store == NULL)
  ------------------
  |  Branch (1542:9): [True: 0, False: 15]
  ------------------
 1543|      0|        return 1;
 1544|     15|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1544:9): [True: 0, False: 15]
  ------------------
 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|     15|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1551:9): [True: 0, False: 15]
  ------------------
 1552|      0|        return 0;
 1553|     15|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1554|     15|    if (provs == NULL) {
  ------------------
  |  Branch (1554:9): [True: 0, False: 15]
  ------------------
 1555|      0|        CRYPTO_THREAD_unlock(store->lock);
 1556|      0|        return 0;
 1557|      0|    }
 1558|     15|    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|     30|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1563:26): [True: 15, False: 15]
  ------------------
 1564|     15|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1565|       |
 1566|     15|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1566:13): [True: 0, False: 15]
  ------------------
 1567|      0|            goto err_unlock;
 1568|     15|        if (prov->flag_activated) {
  ------------------
  |  Branch (1568:13): [True: 15, 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|     15|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1574:17): [True: 0, False: 15]
  ------------------
 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|     15|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1584:17): [True: 0, False: 15]
  ------------------
 1585|     15|                                   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|     15|        } else {
 1591|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1592|      0|            max--;
 1593|      0|        }
 1594|     15|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1595|     15|    }
 1596|     15|    CRYPTO_THREAD_unlock(store->lock);
 1597|       |
 1598|       |    /*
 1599|       |     * Now, we sweep through all providers not under lock
 1600|       |     */
 1601|     30|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1601:20): [True: 15, False: 15]
  ------------------
 1602|     15|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1603|       |
 1604|     15|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 15]
  ------------------
 1605|      0|            curr = -1;
 1606|      0|            goto finish;
 1607|      0|        }
 1608|     15|    }
 1609|     15|    curr = -1;
 1610|       |
 1611|     15|    ret = 1;
 1612|     15|    goto finish;
 1613|       |
 1614|      0| err_unlock:
 1615|      0|    CRYPTO_THREAD_unlock(store->lock);
 1616|     15| 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|     30|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1622:18): [True: 15, False: 15]
  ------------------
 1623|     15|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1624|       |
 1625|     15|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1625:13): [True: 0, False: 15]
  ------------------
 1626|     15|                               prov->activatecnt_lock)) {
 1627|      0|            ret = 0;
 1628|      0|            continue;
 1629|      0|        }
 1630|     15|        if (ref < 1) {
  ------------------
  |  Branch (1630:13): [True: 0, False: 15]
  ------------------
 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|     15|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 15]
  ------------------
 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|     15|        assert(ref > 0);
 1656|     15|    }
 1657|     15|    sk_OSSL_PROVIDER_free(provs);
 1658|     15|    return ret;
 1659|     15|}
ossl_provider_name:
 1683|      3|{
 1684|      3|    return prov->name;
 1685|      3|}
ossl_provider_libctx:
 1720|  1.53k|{
 1721|  1.53k|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1721:12): [True: 1.53k, False: 0]
  ------------------
 1722|  1.53k|}
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|     20|{
 1937|     20|    const OSSL_ALGORITHM *res;
 1938|       |
 1939|     20|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 20]
  ------------------
 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|     20|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1950|     20|#ifndef FIPS_MODULE
 1951|     20|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|     20|    do {                                        \
  |  |  221|     20|        BIO *trc_out = NULL;                    \
  |  |  222|     20|        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|     20|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|     20|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1972|     20|#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|     20|    return res;
 1980|     20|}
ossl_provider_unquery_operation:
 1999|     20|{
 2000|     20|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2000:9): [True: 0, False: 20]
  ------------------
 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|     20|}
ossl_provider_set_operation_bit:
 2015|      5|{
 2016|      5|    size_t byte = bitnum / 8;
 2017|      5|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2018|       |
 2019|      5|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2019:9): [True: 0, False: 5]
  ------------------
 2020|      0|        return 0;
 2021|      5|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2021:9): [True: 2, False: 3]
  ------------------
 2022|      2|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  109|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2023|      2|                                             byte + 1);
 2024|       |
 2025|      2|        if (tmp == NULL) {
  ------------------
  |  Branch (2025:13): [True: 0, False: 2]
  ------------------
 2026|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2027|      0|            return 0;
 2028|      0|        }
 2029|      2|        provider->operation_bits = tmp;
 2030|      2|        memset(provider->operation_bits + provider->operation_bits_sz,
 2031|      2|               '\0', byte + 1 - provider->operation_bits_sz);
 2032|      2|        provider->operation_bits_sz = byte + 1;
 2033|      2|    }
 2034|      5|    provider->operation_bits[byte] |= bit;
 2035|      5|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2036|      5|    return 1;
 2037|      5|}
ossl_provider_test_operation_bit:
 2041|     20|{
 2042|     20|    size_t byte = bitnum / 8;
 2043|     20|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2044|       |
 2045|     20|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|     20|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     20|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2045:9): [True: 0, False: 20]
  ------------------
 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|     20|    *result = 0;
 2051|     20|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2051:9): [True: 0, False: 20]
  ------------------
 2052|      0|        return 0;
 2053|     20|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2053:9): [True: 18, False: 2]
  ------------------
 2054|     18|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2055|     20|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2056|     20|    return 1;
 2057|     20|}
provider_core.c:provider_deactivate_free:
  237|      1|{
  238|      1|    if (prov->flag_activated)
  ------------------
  |  Branch (238:9): [True: 1, False: 0]
  ------------------
  239|      1|        ossl_provider_deactivate(prov, 1);
  240|      1|    ossl_provider_free(prov);
  241|      1|}
provider_core.c:ossl_provider_cmp:
  204|      3|{
  205|      3|    return strcmp((*a)->name, (*b)->name);
  206|      3|}
provider_core.c:get_provider_store:
  330|     20|{
  331|     20|    struct provider_store_st *store = NULL;
  332|       |
  333|     20|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   99|     20|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  334|     20|    if (store == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 20]
  ------------------
  335|     20|        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|     20|    return store;
  337|     20|}
provider_core.c:provider_new:
  442|      1|{
  443|      1|    OSSL_PROVIDER *prov = NULL;
  444|       |
  445|      1|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  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 (445:9): [True: 0, False: 1]
  ------------------
  446|      0|        return NULL;
  447|      1|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (447:9): [True: 0, False: 1]
  ------------------
  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|      1|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (451:9): [True: 0, False: 1]
  ------------------
  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|      1|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (457:9): [True: 0, False: 1]
  ------------------
  458|      1|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (458:12): [True: 0, False: 1]
  ------------------
  459|      1|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (459:12): [True: 0, False: 1]
  ------------------
  460|      1|                                                     infopair_copy,
  461|      1|                                                     infopair_free)) == NULL) {
  462|      0|        ossl_provider_free(prov);
  463|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      1|    if ((prov->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 (466:9): [True: 0, False: 1]
  ------------------
  467|      0|        ossl_provider_free(prov);
  468|      0|        return NULL;
  469|      0|    }
  470|       |
  471|      1|    prov->init_function = init_function;
  472|       |
  473|      1|    return prov;
  474|      1|}
provider_core.c:provider_activate:
 1257|      1|{
 1258|      1|    int count = -1;
 1259|      1|    struct provider_store_st *store;
 1260|      1|    int ret = 1;
 1261|       |
 1262|      1|    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|      1|    if (store == NULL) {
  ------------------
  |  Branch (1267:9): [True: 1, False: 0]
  ------------------
 1268|      1|        lock = 0;
 1269|      1|        if (!provider_init(prov))
  ------------------
  |  Branch (1269:13): [True: 0, False: 1]
  ------------------
 1270|      0|            return -1;
 1271|      1|    }
 1272|       |
 1273|      1|#ifndef FIPS_MODULE
 1274|      1|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1274:9): [True: 0, False: 1]
  ------------------
 1275|      1|            && !ossl_rand_check_random_provider_on_load(prov->libctx, prov))
  ------------------
  |  Branch (1275:16): [True: 0, False: 0]
  ------------------
 1276|      0|        return -1;
 1277|       |
 1278|      1|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1278:9): [True: 0, False: 1]
  |  Branch (1278:26): [True: 0, False: 0]
  |  Branch (1278:37): [True: 0, False: 0]
  ------------------
 1279|      0|        return -1;
 1280|      1|#endif
 1281|       |
 1282|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1282:9): [True: 0, False: 1]
  |  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|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1290:9): [True: 0, False: 1]
  |  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|      1|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1298:9): [True: 1, False: 0]
  ------------------
 1299|      1|        prov->flag_activated = 1;
 1300|       |
 1301|      1|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1301:13): [True: 1, False: 0]
  |  Branch (1301:27): [True: 0, False: 1]
  ------------------
 1302|      0|            ret = create_provider_children(prov);
 1303|      0|        }
 1304|      1|    }
 1305|      1|    if (lock) {
  ------------------
  |  Branch (1305:9): [True: 0, False: 1]
  ------------------
 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|      1|    if (!ret)
  ------------------
  |  Branch (1318:9): [True: 0, False: 1]
  ------------------
 1319|      0|        return -1;
 1320|       |
 1321|      1|    return count;
 1322|      1|}
provider_core.c:provider_init:
  940|      1|{
  941|      1|    const OSSL_DISPATCH *provider_dispatch = NULL;
  942|      1|    void *tmp_provctx = NULL;    /* safety measure */
  943|      1|#ifndef OPENSSL_NO_ERR
  944|      1|# ifndef FIPS_MODULE
  945|      1|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  946|      1|# endif
  947|      1|#endif
  948|      1|    int ok = 0;
  949|       |
  950|      1|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|      1|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      1|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (950:9): [True: 0, False: 1]
  ------------------
  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|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (959:9): [True: 0, False: 1]
  ------------------
  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|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (1030:9): [True: 0, False: 1]
  ------------------
 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|      1|#ifndef FIPS_MODULE
 1037|      1|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      1|    do {                                        \
  |  |  221|      1|        BIO *trc_out = NULL;                    \
  |  |  222|      1|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1038|      0|        BIO_printf(trc_out,
 1039|      0|                   "(provider %s) initalizing\n", prov->name);
 1040|      1|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      1|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1041|      1|#endif
 1042|       |
 1043|      1|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (1043:9): [True: 0, False: 1]
  ------------------
 1044|      1|                             &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|      1|    prov->provctx = tmp_provctx;
 1050|      1|    prov->dispatch = provider_dispatch;
 1051|       |
 1052|      1|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (1052:9): [True: 1, False: 0]
  ------------------
 1053|      6|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (1053:16): [True: 5, False: 1]
  ------------------
 1054|      5|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (1054:21): [True: 0, False: 5]
  ------------------
 1055|      1|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  257|      1|# define OSSL_FUNC_PROVIDER_TEARDOWN           1024
  ------------------
  |  Branch (1055:13): [True: 1, False: 4]
  ------------------
 1056|      1|                prov->teardown =
 1057|      1|                    OSSL_FUNC_provider_teardown(provider_dispatch);
 1058|      1|                break;
 1059|      1|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  259|      1|# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS    1025
  ------------------
  |  Branch (1059:13): [True: 1, False: 4]
  ------------------
 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: 4]
  ------------------
 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: 5]
  ------------------
 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: 5]
  ------------------
 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: 4]
  ------------------
 1076|      1|                prov->get_capabilities =
 1077|      1|                    OSSL_FUNC_provider_get_capabilities(provider_dispatch);
 1078|      1|                break;
 1079|      1|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  265|      1|# define OSSL_FUNC_PROVIDER_QUERY_OPERATION    1027
  ------------------
  |  Branch (1079:13): [True: 1, False: 4]
  ------------------
 1080|      1|                prov->query_operation =
 1081|      1|                    OSSL_FUNC_provider_query_operation(provider_dispatch);
 1082|      1|                break;
 1083|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  268|      0|# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION  1028
  ------------------
  |  Branch (1083:13): [True: 0, False: 5]
  ------------------
 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: 5]
  ------------------
 1090|      0|                p_get_reason_strings =
 1091|      0|                    OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1092|      0|                break;
 1093|      5|# endif
 1094|      5|#endif
 1095|      5|            }
 1096|      5|        }
 1097|      1|    }
 1098|       |
 1099|      1|#ifndef OPENSSL_NO_ERR
 1100|      1|# ifndef FIPS_MODULE
 1101|      1|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 1]
  ------------------
 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|      1|# endif
 1143|      1|#endif
 1144|       |
 1145|       |    /* With this flag set, this provider has become fully "loaded". */
 1146|      1|    prov->flag_initialized = 1;
 1147|      1|    ok = 1;
 1148|       |
 1149|      1| end:
 1150|      1|    return ok;
 1151|      1|}
provider_core.c:core_get_params:
 2309|    948|{
 2310|    948|    OSSL_PARAM *p;
 2311|       |    /*
 2312|       |     * We created this object originally and we know it is actually an
 2313|       |     * OSSL_PROVIDER *, so the cast is safe
 2314|       |     */
 2315|    948|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2316|       |
 2317|    948|    if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_CORE_VERSION)) != NULL)
  ------------------
  |  |  495|    948|# define OSSL_PROV_PARAM_CORE_VERSION "openssl-version"
  ------------------
  |  Branch (2317:9): [True: 0, False: 948]
  ------------------
 2318|      0|        OSSL_PARAM_set_utf8_ptr(p, OPENSSL_VERSION_STR);
  ------------------
  |  |   77|      0|# define OPENSSL_VERSION_STR "3.6.0"
  ------------------
 2319|    948|    if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_CORE_PROV_NAME)) != NULL)
  ------------------
  |  |  494|    948|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  |  Branch (2319:9): [True: 0, False: 948]
  ------------------
 2320|      0|        OSSL_PARAM_set_utf8_ptr(p, prov->name);
 2321|       |
 2322|    948|#ifndef FIPS_MODULE
 2323|    948|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (2323:9): [True: 0, False: 948]
  ------------------
 2324|    948|                               OSSL_PROV_PARAM_CORE_MODULE_FILENAME)) != NULL)
  ------------------
  |  |  493|    948|# define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename"
  ------------------
 2325|      0|        OSSL_PARAM_set_utf8_ptr(p, ossl_provider_module_path(prov));
 2326|    948|#endif
 2327|       |
 2328|    948|    return OSSL_PROVIDER_get_conf_parameters(prov, params);
 2329|    948|}
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_deactivate:
 1161|      1|{
 1162|      1|    int count;
 1163|      1|    struct provider_store_st *store;
 1164|      1|#ifndef FIPS_MODULE
 1165|      1|    int freeparent = 0;
 1166|      1|#endif
 1167|      1|    int lock = 1;
 1168|       |
 1169|      1|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      1|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      1|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1169:9): [True: 0, False: 1]
  ------------------
 1170|      0|        return -1;
 1171|       |
 1172|      1|#ifndef FIPS_MODULE
 1173|      1|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1173:9): [True: 0, False: 1]
  ------------------
 1174|      1|            && !ossl_rand_check_random_provider_on_unload(prov->libctx, prov))
  ------------------
  |  Branch (1174:16): [True: 0, False: 0]
  ------------------
 1175|      0|        return -1;
 1176|      1|#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|      1|    store = get_provider_store(prov->libctx);
 1183|      1|    if (store == NULL)
  ------------------
  |  Branch (1183:9): [True: 0, False: 1]
  ------------------
 1184|      0|        lock = 0;
 1185|       |
 1186|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1186:9): [True: 1, False: 0]
  |  Branch (1186:17): [True: 0, False: 1]
  ------------------
 1187|      0|        return -1;
 1188|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1188:9): [True: 1, False: 0]
  |  Branch (1188:17): [True: 0, False: 1]
  ------------------
 1189|      0|        CRYPTO_THREAD_unlock(store->lock);
 1190|      0|        return -1;
 1191|      0|    }
 1192|       |
 1193|      1|    if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1193:9): [True: 0, False: 1]
  ------------------
 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|      1|#ifndef FIPS_MODULE
 1202|      1|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 1]
  |  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|      1|#endif
 1212|       |
 1213|      1|    if (count < 1)
  ------------------
  |  Branch (1213:9): [True: 1, False: 0]
  ------------------
 1214|      1|        prov->flag_activated = 0;
 1215|      0|#ifndef FIPS_MODULE
 1216|      0|    else
 1217|      0|        removechildren = 0;
 1218|      1|#endif
 1219|       |
 1220|      1|#ifndef FIPS_MODULE
 1221|      1|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1221:9): [True: 1, False: 0]
  |  Branch (1221:27): [True: 1, False: 0]
  ------------------
 1222|      1|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1223|      1|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1224|       |
 1225|      1|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1225:21): [True: 0, False: 1]
  ------------------
 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|      1|    }
 1230|      1|#endif
 1231|      1|    if (lock) {
  ------------------
  |  Branch (1231:9): [True: 1, False: 0]
  ------------------
 1232|      1|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1233|      1|        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|      1|#ifndef FIPS_MODULE
 1239|      1|        if (count < 1)
  ------------------
  |  Branch (1239:13): [True: 1, False: 0]
  ------------------
 1240|      1|            ossl_decoder_cache_flush(prov->libctx);
 1241|      1|#endif
 1242|      1|    }
 1243|      1|#ifndef FIPS_MODULE
 1244|      1|    if (freeparent)
  ------------------
  |  Branch (1244:9): [True: 0, False: 1]
  ------------------
 1245|      0|        ossl_provider_free_parent(prov, 1);
 1246|      1|#endif
 1247|       |
 1248|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1249|      1|    return count;
 1250|      1|}
provider_core.c:provider_remove_store_methods:
 1357|      1|{
 1358|      1|    struct provider_store_st *store;
 1359|      1|    int freeing;
 1360|       |
 1361|      1|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1361:9): [True: 0, False: 1]
  ------------------
 1362|      0|        return 0;
 1363|       |
 1364|      1|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1364:9): [True: 0, False: 1]
  ------------------
 1365|      0|        return 0;
 1366|      1|    freeing = store->freeing;
 1367|      1|    CRYPTO_THREAD_unlock(store->lock);
 1368|       |
 1369|      1|    if (!freeing) {
  ------------------
  |  Branch (1369:9): [True: 0, False: 1]
  ------------------
 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|      1|    return 1;
 1394|      1|}
provider_core.c:provider_activate_fallbacks:
 1437|     15|{
 1438|     15|    int use_fallbacks;
 1439|     15|    int activated_fallback_count = 0;
 1440|     15|    int ret = 0;
 1441|     15|    const OSSL_PROVIDER_INFO *p;
 1442|       |
 1443|     15|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1443:9): [True: 0, False: 15]
  ------------------
 1444|      0|        return 0;
 1445|     15|    use_fallbacks = store->use_fallbacks;
 1446|     15|    CRYPTO_THREAD_unlock(store->lock);
 1447|     15|    if (!use_fallbacks)
  ------------------
  |  Branch (1447:9): [True: 14, False: 1]
  ------------------
 1448|     14|        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|      1|        for (i = 0; i < store->numprovinfo; info++, i++) {
  ------------------
  |  Branch (1468:21): [True: 0, False: 1]
  ------------------
 1469|      0|            if (strcmp(info->name, p->name) != 0)
  ------------------
  |  Branch (1469:17): [True: 0, False: 0]
  ------------------
 1470|      0|                continue;
 1471|      0|            params = info->parameters;
 1472|      0|            break;
 1473|      0|        }
 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|      1|{
  106|      1|#ifndef OPENSSL_NO_ERR
  107|      1|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 1, False: 0]
  ------------------
  108|      1|        ERR_load_strings_const(RAND_str_reasons);
  109|      1|#endif
  110|      1|    return 1;
  111|      1|}

ossl_rand_cleanup_int:
  180|      1|{
  181|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
  182|      1|    const RAND_METHOD *meth = default_RAND_meth;
  183|       |
  184|      1|    if (!rand_inited)
  ------------------
  |  Branch (184:9): [True: 0, False: 1]
  ------------------
  185|      0|        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|    856|{
  287|    856|    const RAND_METHOD *tmp_meth = NULL;
  288|       |
  289|    856|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|    856|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 856, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 0, False: 856]
  ------------------
  290|      0|        return NULL;
  291|       |
  292|    856|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 856]
  ------------------
  293|      0|        return NULL;
  294|       |
  295|    856|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (295:9): [True: 0, False: 856]
  ------------------
  296|      0|        return NULL;
  297|    856|    tmp_meth = default_RAND_meth;
  298|    856|    CRYPTO_THREAD_unlock(rand_meth_lock);
  299|    856|    if (tmp_meth != NULL)
  ------------------
  |  Branch (299:9): [True: 855, False: 1]
  ------------------
  300|    855|        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|    634|{
  439|    634|    RAND_GLOBAL *dgbl;
  440|    634|    EVP_RAND_CTX *rand;
  441|    634|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  442|    634|    const RAND_METHOD *meth = RAND_get_rand_method();
  443|       |
  444|    634|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (444:9): [True: 634, False: 0]
  |  Branch (444:25): [True: 0, False: 634]
  ------------------
  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|    634|#endif
  451|       |
  452|    634|    dgbl = rand_get_global(ctx);
  453|    634|    if (dgbl == NULL)
  ------------------
  |  Branch (453:9): [True: 0, False: 634]
  ------------------
  454|      0|        return 0;
  455|    634|#ifndef FIPS_MODULE
  456|    634|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 634]
  ------------------
  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|    634|#endif      /* !FIPS_MODULE */
  461|    634|    rand = rand_get0_private(ctx, dgbl);
  462|    634|    if (rand != NULL)
  ------------------
  |  Branch (462:9): [True: 634, False: 0]
  ------------------
  463|    634|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  464|       |
  465|      0|    return 0;
  466|    634|}
RAND_bytes_ex:
  477|    222|{
  478|    222|    RAND_GLOBAL *dgbl;
  479|    222|    EVP_RAND_CTX *rand;
  480|    222|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  481|    222|    const RAND_METHOD *meth = RAND_get_rand_method();
  482|       |
  483|    222|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (483:9): [True: 222, False: 0]
  |  Branch (483:25): [True: 0, False: 222]
  ------------------
  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|    222|#endif
  490|       |
  491|    222|    dgbl = rand_get_global(ctx);
  492|    222|    if (dgbl == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 222]
  ------------------
  493|      0|        return 0;
  494|    222|#ifndef FIPS_MODULE
  495|    222|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (495:9): [True: 0, False: 222]
  ------------------
  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|    222|#endif      /* !FIPS_MODULE */
  500|       |
  501|    222|    rand = rand_get0_public(ctx, dgbl);
  502|    222|    if (rand != NULL)
  ------------------
  |  Branch (502:9): [True: 222, False: 0]
  ------------------
  503|    222|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  504|       |
  505|      0|    return 0;
  506|    222|}
RAND_bytes:
  509|     32|{
  510|     32|    if (num < 0)
  ------------------
  |  Branch (510:9): [True: 0, False: 32]
  ------------------
  511|      0|        return 0;
  512|     32|    return RAND_bytes_ex(NULL, buf, (size_t)num, 0);
  513|     32|}
ossl_rand_ctx_new:
  520|      1|{
  521|      1|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  522|       |
  523|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (523:9): [True: 0, False: 1]
  ------------------
  524|      0|        return NULL;
  525|       |
  526|      1|#ifndef FIPS_MODULE
  527|       |    /*
  528|       |     * We need to ensure that base libcrypto thread handling has been
  529|       |     * initialised.
  530|       |     */
  531|      1|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      1|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  532|       |
  533|       |    /* Prepopulate the random provider name */
  534|      1|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  535|      1|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (535:9): [True: 0, False: 1]
  ------------------
  536|      0|        goto err0;
  537|      1|#endif
  538|       |
  539|      1|    dgbl->lock = CRYPTO_THREAD_lock_new();
  540|      1|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (540:9): [True: 0, False: 1]
  ------------------
  541|      0|        goto err1;
  542|       |
  543|      1|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (543:9): [True: 0, False: 1]
  ------------------
  544|      0|        goto err1;
  545|       |
  546|      1|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (546:9): [True: 0, False: 1]
  ------------------
  547|      0|        goto err2;
  548|       |
  549|      1|    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|      1|{
  565|      1|    RAND_GLOBAL *dgbl = vdgbl;
  566|       |
  567|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 1]
  ------------------
  568|      0|        return;
  569|       |
  570|      1|    CRYPTO_THREAD_lock_free(dgbl->lock);
  571|      1|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  572|      1|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  573|      1|    EVP_RAND_CTX_free(dgbl->primary);
  574|      1|    EVP_RAND_CTX_free(dgbl->seed);
  575|      1|#ifndef FIPS_MODULE
  576|      1|    OPENSSL_free(dgbl->random_provider_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__
  |  |  ------------------
  ------------------
  577|      1|#endif      /* !FIPS_MODULE */
  578|      1|    OPENSSL_free(dgbl->rng_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__
  |  |  ------------------
  ------------------
  579|      1|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  580|      1|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  581|      1|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  582|      1|    OPENSSL_free(dgbl->seed_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__
  |  |  ------------------
  ------------------
  583|      1|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  584|       |
  585|      1|    OPENSSL_free(dgbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  586|      1|}
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|    861|{
  101|    861|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  103|    861|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  102|    861|}
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: 0, False: 3]
  ------------------
  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: 3, False: 0]
  ------------------
  696|      3|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (696:18): [True: 0, False: 3]
  ------------------
  697|      3|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  698|      3|                                                cipher, 0);
  699|      3|    }
  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: 3, False: 0]
  ------------------
  713|      3|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  249|      3|# 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|    222|{
  840|    222|    EVP_RAND_CTX *rand, *primary;
  841|       |
  842|    222|    if (dgbl == NULL)
  ------------------
  |  Branch (842:9): [True: 0, False: 222]
  ------------------
  843|      0|        return NULL;
  844|       |
  845|    222|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  846|    222|    if (rand == NULL) {
  ------------------
  |  Branch (846:9): [True: 1, False: 221]
  ------------------
  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|    222|    return rand;
  867|    222|}
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|    634|{
  882|    634|    EVP_RAND_CTX *rand, *primary;
  883|       |
  884|    634|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  885|    634|    if (rand == NULL) {
  ------------------
  |  Branch (885:9): [True: 1, False: 633]
  ------------------
  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|    634|    return rand;
  906|    634|}

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

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

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

ossl_self_test_set_callback_new:
   35|      1|{
   36|      1|    SELF_TEST_CB *stcb;
   37|       |
   38|      1|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   39|      1|    return stcb;
   40|      1|}
ossl_self_test_set_callback_free:
   43|      1|{
   44|      1|    OPENSSL_free(stcb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   45|      1|}

ossl_sha3_reset:
   19|  42.1k|{
   20|       |#if defined(__s390x__) && defined(OPENSSL_CPUID_OBJ)
   21|       |    if (!(OPENSSL_s390xcap_P.stfle[1] & S390X_CAPBIT(S390X_MSA12)))
   22|       |#endif
   23|  42.1k|        memset(ctx->A, 0, sizeof(ctx->A));
   24|  42.1k|    ctx->bufsz = 0;
   25|  42.1k|    ctx->xof_state = XOF_STATE_INIT;
  ------------------
  |  |   35|  42.1k|#define XOF_STATE_INIT    0
  ------------------
   26|  42.1k|}
ossl_sha3_init:
   29|  2.47k|{
   30|  2.47k|    size_t bsz = SHA3_BLOCKSIZE(bitlen);
  ------------------
  |  |   21|  2.47k|# define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8
  |  |  ------------------
  |  |  |  |   18|  2.47k|# define KECCAK1600_WIDTH 1600
  |  |  ------------------
  ------------------
   31|       |
   32|  2.47k|    if (bsz <= sizeof(ctx->buf)) {
  ------------------
  |  Branch (32:9): [True: 2.47k, False: 0]
  ------------------
   33|  2.47k|        ossl_sha3_reset(ctx);
   34|  2.47k|        ctx->block_size = bsz;
   35|  2.47k|        ctx->md_size = bitlen / 8;
   36|  2.47k|        ctx->pad = pad;
   37|  2.47k|        return 1;
   38|  2.47k|    }
   39|       |
   40|      0|    return 0;
   41|  2.47k|}
ossl_keccak_init:
   44|  2.47k|{
   45|  2.47k|    int ret = ossl_sha3_init(ctx, pad, bitlen);
   46|       |
   47|  2.47k|    if (ret)
  ------------------
  |  Branch (47:9): [True: 2.47k, False: 0]
  ------------------
   48|  2.47k|        ctx->md_size = mdlen / 8;
   49|  2.47k|    return ret;
   50|  2.47k|}
ossl_sha3_squeeze:
  141|   151k|{
  142|   151k|    size_t bsz = ctx->block_size;
  143|   151k|    size_t num = ctx->bufsz;
  144|   151k|    size_t len;
  145|   151k|    int next = 1;
  146|       |
  147|   151k|    if (outlen == 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 151k]
  ------------------
  148|      0|        return 1;
  149|       |
  150|   151k|    if (ctx->xof_state == XOF_STATE_FINAL)
  ------------------
  |  |   37|   151k|#define XOF_STATE_FINAL   2
  ------------------
  |  Branch (150:9): [True: 0, False: 151k]
  ------------------
  151|      0|        return 0;
  152|       |
  153|       |    /*
  154|       |     * On the first squeeze call, finish the absorb process,
  155|       |     * by adding the trailing padding and then doing
  156|       |     * a final absorb.
  157|       |     */
  158|   151k|    if (ctx->xof_state != XOF_STATE_SQUEEZE) {
  ------------------
  |  |   38|   151k|#define XOF_STATE_SQUEEZE 3
  ------------------
  |  Branch (158:9): [True: 39.6k, False: 111k]
  ------------------
  159|       |        /*
  160|       |         * Pad the data with 10*1. Note that |num| can be |bsz - 1|
  161|       |         * in which case both byte operations below are performed on
  162|       |         * same byte...
  163|       |         */
  164|  39.6k|        memset(ctx->buf + num, 0, bsz - num);
  165|  39.6k|        ctx->buf[num] = ctx->pad;
  166|  39.6k|        ctx->buf[bsz - 1] |= 0x80;
  167|  39.6k|        (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
  168|  39.6k|        ctx->xof_state = XOF_STATE_SQUEEZE;
  ------------------
  |  |   38|  39.6k|#define XOF_STATE_SQUEEZE 3
  ------------------
  169|  39.6k|        num = ctx->bufsz = 0;
  170|  39.6k|        next = 0;
  171|  39.6k|    }
  172|       |
  173|       |    /*
  174|       |     * Step 1. Consume any bytes left over from a previous squeeze
  175|       |     * (See Step 4 below).
  176|       |     */
  177|   151k|    if (num != 0) {
  ------------------
  |  Branch (177:9): [True: 0, False: 151k]
  ------------------
  178|      0|        if (outlen > ctx->bufsz)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|            len = ctx->bufsz;
  180|      0|        else
  181|      0|            len = outlen;
  182|      0|        memcpy(out, ctx->buf + bsz - ctx->bufsz, len);
  183|      0|        out += len;
  184|      0|        outlen -= len;
  185|      0|        ctx->bufsz -= len;
  186|      0|    }
  187|   151k|    if (outlen == 0)
  ------------------
  |  Branch (187:9): [True: 0, False: 151k]
  ------------------
  188|      0|        return 1;
  189|       |
  190|       |    /* Step 2. Copy full sized squeezed blocks to the output buffer directly */
  191|   151k|    if (outlen >= bsz) {
  ------------------
  |  Branch (191:9): [True: 148k, False: 2.46k]
  ------------------
  192|   148k|        len = bsz * (outlen / bsz);
  193|   148k|        SHA3_squeeze(ctx->A, out, len, bsz, next);
  194|   148k|        next = 1;
  195|   148k|        out += len;
  196|   148k|        outlen -= len;
  197|   148k|    }
  198|   151k|    if (outlen > 0) {
  ------------------
  |  Branch (198:9): [True: 6.67k, False: 144k]
  ------------------
  199|       |        /* Step 3. Squeeze one more block into a buffer */
  200|  6.67k|        SHA3_squeeze(ctx->A, ctx->buf, bsz, bsz, next);
  201|  6.67k|        memcpy(out, ctx->buf, outlen);
  202|       |        /* Step 4. Remember the leftover part of the squeezed block */
  203|  6.67k|        ctx->bufsz = bsz - outlen;
  204|  6.67k|    }
  205|       |
  206|   151k|    return 1;
  207|   151k|}

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

ossl_sa_new:
   59|      4|{
   60|      4|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   61|       |
   62|      4|    return res;
   63|      4|}
ossl_sa_free:
  111|      4|{
  112|      4|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 4, False: 0]
  ------------------
  113|      4|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|      4|        OPENSSL_free(sa);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  115|      4|    }
  116|      4|}
ossl_sa_doall_arg:
  146|      4|{
  147|      4|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 4, False: 0]
  ------------------
  148|      4|        sa_doall(sa, NULL, leaf, arg);
  149|      4|}
ossl_sa_get:
  157|  2.62k|{
  158|  2.62k|    int level;
  159|  2.62k|    void **p, *r = NULL;
  160|       |
  161|  2.62k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 2.62k]
  |  Branch (161:23): [True: 2, False: 2.62k]
  ------------------
  162|      2|        return NULL;
  163|       |
  164|  2.62k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 2.35k, False: 268]
  ------------------
  165|  2.35k|        p = sa->nodes;
  166|  9.21k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 9.01k, False: 202]
  |  Branch (166:51): [True: 6.85k, False: 2.15k]
  ------------------
  167|  6.85k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  6.85k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  6.85k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  6.85k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  6.85k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.85k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  2.35k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  2.15k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  2.15k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.15k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 202, False: 2.15k]
  ------------------
  170|  2.35k|    }
  171|  2.62k|    return r;
  172|  2.62k|}
ossl_sa_set:
  180|    522|{
  181|    522|    int i, level = 1;
  182|    522|    ossl_uintmax_t n = posn;
  183|    522|    void **p;
  184|       |
  185|    522|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 522]
  ------------------
  186|      0|        return 0;
  187|       |
  188|  2.06k|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|  2.06k|#define SA_BLOCK_MAX_LEVELS     (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|  2.06k|                                  + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|  2.06k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  |  |   49|  2.06k|                                 / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  2.06k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 2.06k, False: 0]
  ------------------
  189|  2.06k|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|  2.06k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  |  Branch (189:13): [True: 522, False: 1.54k]
  ------------------
  190|    522|            break;
  191|       |
  192|    526|    for (;sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:11): [True: 4, False: 522]
  ------------------
  193|      4|        p = alloc_node();
  194|      4|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 4]
  ------------------
  195|      0|            return 0;
  196|      4|        p[0] = sa->nodes;
  197|      4|        sa->nodes = p;
  198|      4|    }
  199|    522|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 135, False: 387]
  ------------------
  200|    135|        sa->top = posn;
  201|       |
  202|    522|    p = sa->nodes;
  203|  2.08k|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 1.56k, False: 522]
  ------------------
  204|  1.56k|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|  1.56k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|  1.56k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.56k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.56k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  1.56k|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 487, False: 1.07k]
  |  Branch (205:29): [True: 0, False: 487]
  ------------------
  206|      0|            return 0;
  207|  1.56k|        p = p[i];
  208|  1.56k|    }
  209|    522|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    522|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    522|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    522|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    522|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 261, False: 261]
  |  Branch (210:24): [True: 261, False: 0]
  ------------------
  211|    261|        sa->nelem--;
  212|    261|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 261, False: 0]
  |  Branch (212:29): [True: 261, False: 0]
  ------------------
  213|    261|        sa->nelem++;
  214|    522|    *p = val;
  215|    522|    return 1;
  216|    522|}
sparse_array.c:sa_doall:
   67|      8|{
   68|      8|    int i[SA_BLOCK_MAX_LEVELS];
   69|      8|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|      8|    ossl_uintmax_t idx = 0;
   71|      8|    int l = 0;
   72|       |
   73|      8|    i[0] = 0;
   74|      8|    nodes[0] = sa->nodes;
   75|  16.8k|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 16.7k, False: 8]
  ------------------
   76|  16.7k|        const int n = i[l];
   77|  16.7k|        void ** const p = nodes[l];
   78|       |
   79|  16.7k|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  16.7k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  16.7k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 988, False: 15.8k]
  ------------------
   80|    988|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 982, False: 6]
  |  Branch (80:30): [True: 491, False: 491]
  ------------------
   81|    491|                (*node)(p);
   82|    988|            l--;
   83|    988|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|    988|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  15.8k|        } else {
   85|  15.8k|            i[l] = n + 1;
   86|  15.8k|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 15.7k, False: 96]
  |  Branch (86:30): [True: 1.24k, False: 14.4k]
  ------------------
   87|  1.24k|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|  1.24k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.24k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.24k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|  1.24k|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 980, False: 261]
  ------------------
   89|    980|                    i[++l] = 0;
   90|    980|                    nodes[l] = p[n];
   91|    980|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|    980|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|    980|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 261, False: 0]
  ------------------
   93|    261|                    (*leaf)(idx, p[n], arg);
   94|    261|                }
   95|  1.24k|            }
   96|  15.8k|        }
   97|  16.7k|    }
   98|      8|}
sparse_array.c:sa_free_node:
  101|    491|{
  102|    491|    OPENSSL_free(p);
  ------------------
  |  |  115|    491|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    491|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    491|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    491|}
sparse_array.c:alloc_node:
  175|    491|{
  176|    491|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |  104|    491|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    491|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    491|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    491|}

OPENSSL_sk_dup:
   49|    662|{
   50|    662|    OPENSSL_STACK *ret;
   51|       |
   52|    662|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|    662|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    662|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    662|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (52:9): [True: 0, False: 662]
  ------------------
   53|      0|        goto err;
   54|       |
   55|    662|    if (sk == NULL) {
  ------------------
  |  Branch (55:9): [True: 1, False: 661]
  ------------------
   56|      1|        ret->num = 0;
   57|      1|        ret->sorted = 0;
   58|      1|        ret->comp = NULL;
   59|    661|    } else {
   60|       |        /* direct structure assignment */
   61|    661|        *ret = *sk;
   62|    661|    }
   63|       |
   64|    662|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (64:9): [True: 1, False: 661]
  |  Branch (64:23): [True: 0, False: 661]
  ------------------
   65|       |        /* postpone |ret->data| allocation */
   66|      1|        ret->data = NULL;
   67|      1|        ret->num_alloc = 0;
   68|      1|        return ret;
   69|      1|    }
   70|       |
   71|       |    /* duplicate |sk->data| content */
   72|    661|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|    661|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    661|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    661|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|    661|    if (ret->data == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 661]
  ------------------
   74|      0|        goto err;
   75|    661|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   76|    661|    return ret;
   77|       |
   78|      0| err:
   79|      0|    OPENSSL_sk_free(ret);
   80|      0|    return NULL;
   81|    661|}
OPENSSL_sk_deep_copy:
   86|      1|{
   87|      1|    OPENSSL_STACK *ret;
   88|      1|    int i;
   89|       |
   90|      1|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (90:9): [True: 0, False: 1]
  ------------------
   91|      0|        goto err;
   92|       |
   93|      1|    if (sk == NULL) {
  ------------------
  |  Branch (93:9): [True: 1, False: 0]
  ------------------
   94|      1|        ret->num = 0;
   95|      1|        ret->sorted = 0;
   96|      1|        ret->comp = NULL;
   97|      1|    } else {
   98|       |        /* direct structure assignment */
   99|      0|        *ret = *sk;
  100|      0|    }
  101|       |
  102|      1|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (102:9): [True: 1, False: 0]
  |  Branch (102:23): [True: 0, False: 0]
  ------------------
  103|       |        /* postpone |ret| data allocation */
  104|      1|        ret->data = NULL;
  105|      1|        ret->num_alloc = 0;
  106|      1|        return ret;
  107|      1|    }
  108|       |
  109|      0|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (109:22): [True: 0, False: 0]
  ------------------
  110|      0|    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  111|      0|    if (ret->data == NULL)
  ------------------
  |  Branch (111:9): [True: 0, False: 0]
  ------------------
  112|      0|        goto err;
  113|       |
  114|      0|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (115:13): [True: 0, False: 0]
  ------------------
  116|      0|            continue;
  117|      0|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  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|      0|    }
  124|      0|    return ret;
  125|       |
  126|      0| err:
  127|      0|    OPENSSL_sk_free(ret);
  128|      0|    return NULL;
  129|      0|}
OPENSSL_sk_new_null:
  132|    520|{
  133|    520|    return OPENSSL_sk_new_reserve(NULL, 0);
  134|    520|}
OPENSSL_sk_new:
  137|     21|{
  138|     21|    return OPENSSL_sk_new_reserve(c, 0);
  139|     21|}
OPENSSL_sk_new_reserve:
  228|    541|{
  229|    541|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|    541|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    541|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    541|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |
  231|    541|    if (st == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 541]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|    541|    st->comp = c;
  235|       |
  236|    541|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 541, False: 0]
  ------------------
  237|    541|        return st;
  238|       |
  239|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (239:9): [True: 0, False: 0]
  ------------------
  240|      0|        OPENSSL_sk_free(st);
  241|      0|        return NULL;
  242|      0|    }
  243|       |
  244|      0|    return st;
  245|      0|}
OPENSSL_sk_set_thunks:
  260|    801|{
  261|    801|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 305, False: 496]
  ------------------
  262|    305|        st->free_thunk = f_thunk;
  263|       |
  264|    801|    return st;
  265|    801|}
OPENSSL_sk_insert:
  268|  1.12k|{
  269|  1.12k|    if (st == NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 1.12k]
  ------------------
  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|  1.12k|    if (st->num == max_nodes) {
  ------------------
  |  Branch (273:9): [True: 0, False: 1.12k]
  ------------------
  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|  1.12k|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (278:9): [True: 0, False: 1.12k]
  ------------------
  279|      0|        return 0;
  280|       |
  281|  1.12k|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (281:9): [True: 1.12k, False: 0]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|  1.12k|        st->data[st->num] = data;
  283|  1.12k|    } else {
  284|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  285|      0|                sizeof(st->data[0]) * (st->num - loc));
  286|      0|        st->data[loc] = data;
  287|      0|    }
  288|  1.12k|    st->num++;
  289|  1.12k|    st->sorted = 0;
  290|  1.12k|    return st->num;
  291|  1.12k|}
OPENSSL_sk_delete:
  319|      1|{
  320|      1|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (320:9): [True: 0, False: 1]
  |  Branch (320:23): [True: 0, False: 1]
  |  Branch (320:34): [True: 0, False: 1]
  ------------------
  321|      0|        return NULL;
  322|       |
  323|      1|    return internal_delete(st, loc);
  324|      1|}
OPENSSL_sk_find:
  392|      3|{
  393|      3|    return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
  ------------------
  |  |  153|      3|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  394|      3|}
OPENSSL_sk_push:
  407|  1.12k|{
  408|  1.12k|    if (st == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 1.12k]
  ------------------
  409|      0|        return 0;
  410|  1.12k|    return OPENSSL_sk_insert(st, data, st->num);
  411|  1.12k|}
OPENSSL_sk_pop_free:
  441|  1.50k|{
  442|  1.50k|    int i;
  443|       |
  444|  1.50k|    if (st == NULL)
  ------------------
  |  Branch (444:9): [True: 970, False: 539]
  ------------------
  445|    970|        return;
  446|       |
  447|  1.64k|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (447:17): [True: 1.11k, False: 539]
  ------------------
  448|  1.11k|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (448:13): [True: 1.11k, False: 0]
  ------------------
  449|  1.11k|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (449:17): [True: 522, False: 588]
  ------------------
  450|    522|                st->free_thunk(func, (void *)st->data[i]);
  451|    588|            else
  452|    588|                func((void *)st->data[i]);
  453|  1.11k|        }
  454|  1.11k|    }
  455|    539|    OPENSSL_sk_free(st);
  456|    539|}
OPENSSL_sk_free:
  459|  1.68k|{
  460|  1.68k|    if (st == NULL)
  ------------------
  |  Branch (460:9): [True: 479, False: 1.20k]
  ------------------
  461|    479|        return;
  462|  1.20k|    OPENSSL_free(st->data);
  ------------------
  |  |  115|  1.20k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.20k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.20k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|  1.20k|    OPENSSL_free(st);
  ------------------
  |  |  115|  1.20k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.20k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.20k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|  1.20k|}
OPENSSL_sk_num:
  467|  5.59k|{
  468|  5.59k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (468:12): [True: 949, False: 4.65k]
  ------------------
  469|  5.59k|}
OPENSSL_sk_value:
  472|  3.27k|{
  473|  3.27k|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (473:9): [True: 0, False: 3.27k]
  |  Branch (473:23): [True: 0, False: 3.27k]
  |  Branch (473:32): [True: 0, False: 3.27k]
  ------------------
  474|      0|        return NULL;
  475|  3.27k|    return (void *)st->data[i];
  476|  3.27k|}
OPENSSL_sk_sort:
  495|     22|{
  496|     22|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (496:9): [True: 22, False: 0]
  |  Branch (496:23): [True: 20, False: 2]
  |  Branch (496:38): [True: 20, False: 0]
  ------------------
  497|     20|        if (st->num > 1)
  ------------------
  |  Branch (497:13): [True: 0, False: 20]
  ------------------
  498|      0|            qsort(st->data, st->num, sizeof(void *), st->comp);
  499|     20|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  500|     20|    }
  501|     22|}
stack.c:sk_reserve:
  179|  1.12k|{
  180|  1.12k|    const void **tmpdata;
  181|  1.12k|    int num_alloc;
  182|       |
  183|       |    /* Check to see the reservation isn't exceeding the hard limit */
  184|  1.12k|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (184:9): [True: 0, False: 1.12k]
  ------------------
  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|  1.12k|    num_alloc = st->num + n;
  191|  1.12k|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (191:9): [True: 808, False: 312]
  ------------------
  192|    808|        num_alloc = min_nodes;
  193|       |
  194|       |    /* If |st->data| allocation was postponed */
  195|  1.12k|    if (st->data == NULL) {
  ------------------
  |  Branch (195:9): [True: 526, False: 594]
  ------------------
  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|    526|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|    526|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    526|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    526|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:13): [True: 0, False: 526]
  ------------------
  201|      0|            return 0;
  202|    526|        st->num_alloc = num_alloc;
  203|    526|        return 1;
  204|    526|    }
  205|       |
  206|    594|    if (!exact) {
  ------------------
  |  Branch (206:9): [True: 594, False: 0]
  ------------------
  207|    594|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (207:13): [True: 577, False: 17]
  ------------------
  208|    577|            return 1;
  209|     17|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  210|     17|        if (num_alloc == 0) {
  ------------------
  |  Branch (210:13): [True: 0, False: 17]
  ------------------
  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|     17|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|        return 1;
  216|      0|    }
  217|       |
  218|     17|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|     17|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     17|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     17|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     17|    if (tmpdata == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 17]
  ------------------
  220|      0|        return 0;
  221|       |
  222|     17|    st->data = tmpdata;
  223|     17|    st->num_alloc = num_alloc;
  224|     17|    return 1;
  225|     17|}
stack.c:compute_growth:
  161|     17|{
  162|     17|    int err = 0;
  163|       |
  164|     34|    while (current < target) {
  ------------------
  |  Branch (164:12): [True: 17, False: 17]
  ------------------
  165|     17|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 17]
  ------------------
  166|      0|            return 0;
  167|       |
  168|     17|        current = safe_muldiv_int(current, 8, 5, &err);
  169|     17|        if (err != 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 17]
  ------------------
  170|      0|            return 0;
  171|     17|        if (current >= max_nodes)
  ------------------
  |  Branch (171:13): [True: 0, False: 17]
  ------------------
  172|      0|            current = max_nodes;
  173|     17|    }
  174|     17|    return current;
  175|     17|}
stack.c:internal_delete:
  294|      1|{
  295|      1|    const void *ret = st->data[loc];
  296|       |
  297|      1|    if (loc != st->num - 1)
  ------------------
  |  Branch (297:9): [True: 0, False: 1]
  ------------------
  298|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  299|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  300|      1|    st->num--;
  301|       |
  302|      1|    return (void *)ret;
  303|      1|}
stack.c:internal_find:
  328|      3|{
  329|      3|    const void *r;
  330|      3|    int i, count = 0;
  331|      3|    int *pnum = pnum_matched;
  332|       |
  333|      3|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (333:9): [True: 0, False: 3]
  |  Branch (333:23): [True: 0, False: 3]
  ------------------
  334|      0|        return -1;
  335|       |
  336|      3|    if (pnum == NULL)
  ------------------
  |  Branch (336:9): [True: 3, False: 0]
  ------------------
  337|      3|        pnum = &count;
  338|       |
  339|      3|    if (st->comp == NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (data == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 3]
  ------------------
  350|      0|        return -1;
  351|       |
  352|      3|    if (!st->sorted) {
  ------------------
  |  Branch (352:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (pnum_matched != NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 3]
  ------------------
  370|      0|        ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
  ------------------
  |  |  153|      0|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  371|      3|    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
  372|      3|                     ret_val_options);
  373|       |
  374|      3|    if (pnum_matched != NULL) {
  ------------------
  |  Branch (374:9): [True: 0, False: 3]
  ------------------
  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|      3|    return r == NULL ? -1 : (int)((const void **)r - st->data);
  ------------------
  |  Branch (388:12): [True: 0, False: 3]
  ------------------
  389|      3|}

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

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

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

ossl_crypto_mutex_new:
   97|      1|{
   98|      1|    pthread_mutex_t *mutex;
   99|       |
  100|      1|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  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 (100:9): [True: 0, False: 1]
  ------------------
  101|      0|        return NULL;
  102|      1|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1]
  ------------------
  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|      1|    return (CRYPTO_MUTEX *)mutex;
  107|      1|}
ossl_crypto_mutex_free:
  142|      1|{
  143|      1|    pthread_mutex_t **mutex_p;
  144|       |
  145|      1|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 1]
  ------------------
  146|      0|        return;
  147|       |
  148|      1|    mutex_p = (pthread_mutex_t **)mutex;
  149|      1|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 1, False: 0]
  ------------------
  150|      1|        pthread_mutex_destroy(*mutex_p);
  151|      1|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  152|      1|    *mutex = NULL;
  153|      1|}
ossl_crypto_condvar_new:
  156|      1|{
  157|      1|    pthread_cond_t *cv_p;
  158|       |
  159|      1|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  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 (159:9): [True: 0, False: 1]
  ------------------
  160|      0|        return NULL;
  161|      1|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  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|      1|    return (CRYPTO_CONDVAR *) cv_p;
  166|      1|}
ossl_crypto_condvar_free:
  220|      1|{
  221|      1|    pthread_cond_t **cv_p;
  222|       |
  223|      1|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 1]
  ------------------
  224|      0|        return;
  225|       |
  226|      1|    cv_p = (pthread_cond_t **)cv;
  227|      1|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 1, False: 0]
  ------------------
  228|      1|        pthread_cond_destroy(*cv_p);
  229|      1|    OPENSSL_free(*cv_p);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  230|      1|    *cv_p = NULL;
  231|      1|}

ossl_threads_ctx_new:
  128|      1|{
  129|      1|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  130|       |
  131|      1|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 1]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      1|    t->lock = ossl_crypto_mutex_new();
  135|      1|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      1|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 1]
  |  Branch (137:28): [True: 0, False: 1]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      1|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      1|}
ossl_threads_ctx_free:
  148|      1|{
  149|      1|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *) vdata;
  150|       |
  151|      1|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 1]
  ------------------
  152|      0|        return;
  153|       |
  154|      1|    ossl_crypto_mutex_free(&t->lock);
  155|      1|    ossl_crypto_condvar_free(&t->cond_finished);
  156|      1|    OPENSSL_free(t);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  157|      1|}

ossl_rcu_write_lock:
  441|      3|{
  442|      3|    pthread_mutex_lock(&lock->write_lock);
  443|      3|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  444|      3|}
ossl_rcu_write_unlock:
  447|      3|{
  448|      3|    TSAN_FAKE_LOCK(&lock->write_lock);
  449|      3|    pthread_mutex_unlock(&lock->write_lock);
  450|      3|}
ossl_synchronize_rcu:
  453|      5|{
  454|      5|    struct rcu_qp *qp;
  455|      5|    uint64_t count;
  456|      5|    uint32_t curr_id;
  457|      5|    struct rcu_cb_item *cb_items, *tmpcb;
  458|       |
  459|      5|    pthread_mutex_lock(&lock->write_lock);
  460|      5|    cb_items = lock->cb_items;
  461|      5|    lock->cb_items = NULL;
  462|      5|    pthread_mutex_unlock(&lock->write_lock);
  463|       |
  464|      5|    qp = update_qp(lock, &curr_id);
  465|       |
  466|       |    /* retire in order */
  467|      5|    pthread_mutex_lock(&lock->prior_lock);
  468|      5|    while (lock->next_to_retire != curr_id)
  ------------------
  |  Branch (468:12): [True: 0, False: 5]
  ------------------
  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|      5|    do {
  481|      5|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|      5|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  482|      5|    } while (count != (uint64_t)0);
  ------------------
  |  Branch (482:14): [True: 0, False: 5]
  ------------------
  483|       |
  484|      5|    lock->next_to_retire++;
  485|      5|    pthread_cond_broadcast(&lock->prior_signal);
  486|      5|    pthread_mutex_unlock(&lock->prior_lock);
  487|       |
  488|      5|    retire_qp(lock, qp);
  489|       |
  490|       |    /* handle any callbacks that we have */
  491|      6|    while (cb_items != NULL) {
  ------------------
  |  Branch (491:12): [True: 1, False: 5]
  ------------------
  492|      1|        tmpcb = cb_items;
  493|      1|        cb_items = cb_items->next;
  494|      1|        tmpcb->fn(tmpcb->data);
  495|      1|        OPENSSL_free(tmpcb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  496|      1|    }
  497|      5|}
ossl_rcu_call:
  504|      1|{
  505|      1|    struct rcu_cb_item *new =
  506|      1|        OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  507|       |
  508|      1|    if (new == NULL)
  ------------------
  |  Branch (508:9): [True: 0, False: 1]
  ------------------
  509|      0|        return 0;
  510|       |
  511|      1|    new->data = data;
  512|      1|    new->fn = cb;
  513|       |
  514|      1|    new->next = lock->cb_items;
  515|      1|    lock->cb_items = new;
  516|       |
  517|      1|    return 1;
  518|      1|}
ossl_rcu_uptr_deref:
  521|  9.79k|{
  522|  9.79k|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|  9.79k|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|  9.79k|}
ossl_rcu_assign_uptr:
  526|    591|{
  527|    591|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |   98|    591|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  528|    591|}
ossl_rcu_lock_new:
  531|      2|{
  532|      2|    struct rcu_lock_st *new;
  533|       |
  534|       |    /*
  535|       |     * We need a minimum of 2 qp's
  536|       |     */
  537|      2|    if (num_writers < 2)
  ------------------
  |  Branch (537:9): [True: 2, False: 0]
  ------------------
  538|      2|        num_writers = 2;
  539|       |
  540|      2|    ctx = ossl_lib_ctx_get_concrete(ctx);
  541|      2|    if (ctx == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 2]
  ------------------
  542|      0|        return 0;
  543|       |
  544|      2|    new = 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__
  |  |  ------------------
  ------------------
  545|      2|    if (new == NULL)
  ------------------
  |  Branch (545:9): [True: 0, False: 2]
  ------------------
  546|      0|        return NULL;
  547|       |
  548|      2|    new->ctx = ctx;
  549|      2|    pthread_mutex_init(&new->write_lock, NULL);
  550|      2|    pthread_mutex_init(&new->prior_lock, NULL);
  551|      2|    pthread_mutex_init(&new->alloc_lock, NULL);
  552|      2|    pthread_cond_init(&new->prior_signal, NULL);
  553|      2|    pthread_cond_init(&new->alloc_signal, NULL);
  554|       |
  555|      2|    new->qp_group = allocate_new_qp_group(new, num_writers);
  556|      2|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 2]
  ------------------
  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|      2|    return new;
  562|      2|}
ossl_rcu_lock_free:
  565|      2|{
  566|      2|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  567|       |
  568|      2|    if (lock == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 2]
  ------------------
  569|      0|        return;
  570|       |
  571|       |    /* make sure we're synchronized */
  572|      2|    ossl_synchronize_rcu(rlock);
  573|       |
  574|      2|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  575|       |    /* There should only be a single qp left now */
  576|      2|    OPENSSL_free(rlock);
  ------------------
  |  |  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|}
CRYPTO_THREAD_lock_new:
  580|    506|{
  581|    506|# ifdef USE_RWLOCK
  582|    506|    CRYPTO_RWLOCK *lock;
  583|       |
  584|    506|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|    506|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    506|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    506|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (584:9): [True: 0, False: 506]
  ------------------
  585|       |        /* Don't set error, to avoid recursion blowup. */
  586|      0|        return NULL;
  587|       |
  588|    506|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (588:9): [True: 0, False: 506]
  ------------------
  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|    506|    return lock;
  622|    506|}
CRYPTO_THREAD_read_lock:
  625|  8.31k|{
  626|  8.31k|# ifdef USE_RWLOCK
  627|  8.31k|    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  8.31k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  8.31k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (627:9): [True: 0, False: 8.31k]
  ------------------
  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|  8.31k|    return 1;
  637|  8.31k|}
CRYPTO_THREAD_write_lock:
  640|  2.01k|{
  641|  2.01k|# ifdef USE_RWLOCK
  642|  2.01k|    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|  2.01k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.01k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (642:9): [True: 0, False: 2.01k]
  ------------------
  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|  2.01k|    return 1;
  652|  2.01k|}
CRYPTO_THREAD_unlock:
  655|  10.3k|{
  656|  10.3k|# ifdef USE_RWLOCK
  657|  10.3k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 10.3k]
  ------------------
  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|  10.3k|    return 1;
  667|  10.3k|}
CRYPTO_THREAD_lock_free:
  670|    513|{
  671|    513|    if (lock == NULL)
  ------------------
  |  Branch (671:9): [True: 7, False: 506]
  ------------------
  672|      7|        return;
  673|       |
  674|    506|# ifdef USE_RWLOCK
  675|    506|    pthread_rwlock_destroy(lock);
  676|       |# else
  677|       |    pthread_mutex_destroy(lock);
  678|       |# endif
  679|    506|    OPENSSL_free(lock);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  680|       |
  681|    506|    return;
  682|    513|}
CRYPTO_THREAD_run_once:
  685|  26.8k|{
  686|  26.8k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 26.8k]
  ------------------
  687|      0|        return 0;
  688|       |
  689|  26.8k|    return 1;
  690|  26.8k|}
CRYPTO_THREAD_init_local:
  693|      7|{
  694|      7|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (694:9): [True: 0, False: 7]
  ------------------
  695|      0|        return 0;
  696|       |
  697|      7|    return 1;
  698|      7|}
CRYPTO_THREAD_get_local:
  701|  13.2k|{
  702|  13.2k|    return pthread_getspecific(*key);
  703|  13.2k|}
CRYPTO_THREAD_set_local:
  706|     12|{
  707|     12|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (707:9): [True: 0, False: 12]
  ------------------
  708|      0|        return 0;
  709|       |
  710|     12|    return 1;
  711|     12|}
CRYPTO_THREAD_cleanup_local:
  714|      7|{
  715|      7|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (715:9): [True: 0, False: 7]
  ------------------
  716|      0|        return 0;
  717|       |
  718|      7|    return 1;
  719|      7|}
CRYPTO_atomic_add:
  732|     32|{
  733|     32|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  734|     32|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (734:9): [Folded - Ignored]
  ------------------
  735|     32|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  736|     32|        return 1;
  737|     32|    }
  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|      3|{
  812|      3|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  813|      3|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (813:9): [Folded - Ignored]
  ------------------
  814|      3|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  815|      3|        return 1;
  816|      3|    }
  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|  55.8k|{
  837|  55.8k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  838|  55.8k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (838:9): [Folded - Ignored]
  ------------------
  839|  55.8k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  840|  55.8k|        return 1;
  841|  55.8k|    }
  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|    588|{
  860|    588|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  861|    588|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (861:9): [Folded - Ignored]
  ------------------
  862|    588|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
  863|    588|        return 1;
  864|    588|    }
  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|}
openssl_get_fork_id:
  912|    861|{
  913|    861|    return getpid();
  914|    861|}
threads_pthread.c:update_qp:
  380|      5|{
  381|      5|    uint32_t current_idx;
  382|       |
  383|      5|    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|      5|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (390:12): [True: 0, False: 5]
  ------------------
  391|       |        /* we have to wait for one to be free */
  392|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  393|       |
  394|      5|    current_idx = lock->current_alloc_idx;
  395|       |
  396|       |    /* Allocate the qp */
  397|      5|    lock->writers_alloced++;
  398|       |
  399|       |    /* increment the allocation index */
  400|      5|    lock->current_alloc_idx =
  401|      5|        (lock->current_alloc_idx + 1) % lock->group_count;
  402|       |
  403|      5|    *curr_id = lock->id_ctr;
  404|      5|    lock->id_ctr++;
  405|       |
  406|      5|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |   97|      5|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  407|      5|                   __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|      5|    ATOMIC_ADD_FETCH(&lock->qp_group[current_idx].users, (uint64_t)0,
  ------------------
  |  |   99|      5|#  define ATOMIC_ADD_FETCH(p, v, o) __atomic_add_fetch(p, v, o)
  ------------------
  414|      5|                     __ATOMIC_RELEASE);
  415|       |
  416|       |    /* wake up any waiters */
  417|      5|    pthread_cond_signal(&lock->alloc_signal);
  418|      5|    pthread_mutex_unlock(&lock->alloc_lock);
  419|      5|    return &lock->qp_group[current_idx];
  420|      5|}
threads_pthread.c:retire_qp:
  423|      5|{
  424|      5|    pthread_mutex_lock(&lock->alloc_lock);
  425|      5|    lock->writers_alloced--;
  426|      5|    pthread_cond_signal(&lock->alloc_signal);
  427|      5|    pthread_mutex_unlock(&lock->alloc_lock);
  428|      5|}
threads_pthread.c:allocate_new_qp_group:
  432|      2|{
  433|      2|    struct rcu_qp *new =
  434|      2|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  435|       |
  436|      2|    lock->group_count = count;
  437|      2|    return new;
  438|      2|}

ossl_trace_cleanup:
  340|      1|{
  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|      1|}
OSSL_trace_set_channel:
  362|      1|{
  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|      1|    return 0;
  369|      1|}

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

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

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

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

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

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

FuzzerInitialize:
  627|      2|{
  628|      2|    return 0;
  629|      2|}
FuzzerTestOneInput:
  648|    294|{
  649|    294|    uint8_t operation;
  650|    294|    uint8_t *buffer_cursor;
  651|    294|    void *in1 = NULL, *in2 = NULL;
  652|    294|    void *out1 = NULL, *out2 = NULL;
  653|       |
  654|    294|    if (len < 32)
  ------------------
  |  Branch (654:9): [True: 8, False: 286]
  ------------------
  655|      8|        return -1;
  656|       |
  657|       |    /* Get the first byte of the buffer to tell us what operation to perform */
  658|    286|    buffer_cursor = consume_uint8_t(buf, &len, &operation);
  659|    286|    if (buffer_cursor == NULL)
  ------------------
  |  Branch (659:9): [True: 0, False: 286]
  ------------------
  660|      0|        return -1;
  661|       |
  662|       |    /* Adjust for operational array size */
  663|    286|    operation %= OSSL_NELEM(ops);
  ------------------
  |  |   14|    286|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  664|       |
  665|       |    /* And run our setup/doit/cleanup sequence */
  666|    286|    if (ops[operation].setup != NULL)
  ------------------
  |  Branch (666:9): [True: 286, False: 0]
  ------------------
  667|    286|        ops[operation].setup(&buffer_cursor, &len, &in1, &in2);
  668|    286|    if (ops[operation].doit != NULL)
  ------------------
  |  Branch (668:9): [True: 216, False: 70]
  ------------------
  669|    216|        ops[operation].doit(&buffer_cursor, &len, in1, in2, &out1, &out2);
  670|    286|    if (ops[operation].cleanup != NULL)
  ------------------
  |  Branch (670:9): [True: 286, False: 0]
  ------------------
  671|    286|        ops[operation].cleanup(in1, in2, out1, out2);
  672|       |
  673|    286|    return 0;
  674|    286|}
ml-dsa.c:consume_uint8_t:
   35|    286|{
   36|    286|    if (*len < sizeof(uint8_t))
  ------------------
  |  Branch (36:9): [True: 0, False: 286]
  ------------------
   37|      0|        return NULL;
   38|    286|    *val = *buf;
   39|    286|    *len -= sizeof(uint8_t);
   40|    286|    return (uint8_t *)buf + 1;
   41|    286|}
ml-dsa.c:create_ml_dsa_raw_key:
  161|     64|{
  162|     64|    EVP_PKEY *pubkey;
  163|     64|    char *keytype = NULL;
  164|     64|    size_t keylen = 0;
  165|       |    /* MAX_ML_DSA_PRIV_LEN is longer of that and ML_DSA_87_PUB_LEN */
  166|     64|    uint8_t key[MAX_ML_DSA_PRIV_LEN];
  167|     64|    int pub = 0;
  168|       |
  169|     64|    if (!select_keytype_and_size(buf, len, &keytype, &keylen, 0))
  ------------------
  |  Branch (169:9): [True: 0, False: 64]
  ------------------
  170|      0|        return;
  171|       |
  172|       |    /*
  173|       |     * Select public or private key creation based on the low order bit of the
  174|       |     * next buffer value.
  175|       |     * Note that keylen as returned from select_keytype_and_size is a public key
  176|       |     * length, so make the adjustment to private key lengths here.
  177|       |     */
  178|     64|    if ((*buf)[0] & 0x1) {
  ------------------
  |  Branch (178:9): [True: 18, False: 46]
  ------------------
  179|     18|        pub = 1;
  180|     46|    } else {
  181|     46|        switch (keylen) {
  182|      3|        case (ML_DSA_44_PUB_LEN):
  ------------------
  |  |   29|      3|# define ML_DSA_44_PUB_LEN 1312
  ------------------
  |  Branch (182:9): [True: 3, False: 43]
  ------------------
  183|      3|            keylen = ML_DSA_44_PRIV_LEN;
  ------------------
  |  |   28|      3|# define ML_DSA_44_PRIV_LEN 2560
  ------------------
  184|      3|            break;
  185|      9|        case (ML_DSA_65_PUB_LEN):
  ------------------
  |  |   34|      9|# define ML_DSA_65_PUB_LEN 1952
  ------------------
  |  Branch (185:9): [True: 9, False: 37]
  ------------------
  186|      9|            keylen = ML_DSA_65_PRIV_LEN;
  ------------------
  |  |   33|      9|# define ML_DSA_65_PRIV_LEN 4032
  ------------------
  187|      9|            break;
  188|      2|        case (ML_DSA_87_PUB_LEN):
  ------------------
  |  |   39|      2|# define ML_DSA_87_PUB_LEN 2592
  ------------------
  |  Branch (188:9): [True: 2, False: 44]
  ------------------
  189|      2|            keylen = ML_DSA_87_PRIV_LEN;
  ------------------
  |  |   38|      2|# define ML_DSA_87_PRIV_LEN 4896
  ------------------
  190|      2|            break;
  191|     32|        default:
  ------------------
  |  Branch (191:9): [True: 32, False: 14]
  ------------------
  192|     32|            return;
  193|     46|        }
  194|     46|    }
  195|       |
  196|       |    /*
  197|       |     * libfuzzer provides by default up to 4096 bit input buffers, but it's
  198|       |     * typically much less (between 1 and 100 bytes) so use RAND_bytes here
  199|       |     * instead
  200|       |     */
  201|     32|    if (!RAND_bytes(key, keylen))
  ------------------
  |  Branch (201:9): [True: 0, False: 32]
  ------------------
  202|      0|        return;
  203|       |
  204|       |    /*
  205|       |     * Try to generate either a raw public or private key using random data
  206|       |     * Because the input is completely random, it's effectively certain this
  207|       |     * operation will fail, but it will still exercise the code paths below,
  208|       |     * which is what we want the fuzzer to do
  209|       |     */
  210|     32|    if (pub == 1)
  ------------------
  |  Branch (210:9): [True: 18, False: 14]
  ------------------
  211|     18|        pubkey = EVP_PKEY_new_raw_public_key_ex(NULL, keytype, NULL, key, keylen);
  212|     14|    else
  213|     14|        pubkey = EVP_PKEY_new_raw_private_key_ex(NULL, keytype, NULL, key, keylen);
  214|       |
  215|     32|    *key1 = pubkey;
  216|     32|    return;
  217|     32|}
ml-dsa.c:select_keytype_and_size:
   84|    508|{
   85|    508|    uint16_t keysize;
   86|    508|    uint16_t modulus = 6;
   87|       |
   88|       |    /*
   89|       |     * Note: We don't really care about endianness here, we just want a random
   90|       |     * 16 bit value
   91|       |     */
   92|    508|    *buf = (uint8_t *)OPENSSL_load_u16_le(&keysize, *buf);
   93|    508|    *len -= sizeof(uint16_t);
   94|       |
   95|    508|    if (*buf == NULL)
  ------------------
  |  Branch (95:9): [True: 0, False: 508]
  ------------------
   96|      0|        return 0;
   97|       |
   98|       |    /*
   99|       |     * If `only_valid` is set, select only ML-DSA-44, ML-DSA-65, and ML-DSA-87.
  100|       |     * Otherwise, include some invalid sizes to trigger error paths.
  101|       |     */
  102|       |
  103|    508|    if (only_valid)
  ------------------
  |  Branch (103:9): [True: 444, False: 64]
  ------------------
  104|    444|        modulus = 3;
  105|       |
  106|       |    /*
  107|       |     * Note, keylens for valid values (cases 0-2) are taken based on input
  108|       |     * values from our unit tests
  109|       |     */
  110|    508|    switch (keysize % modulus) {
  111|    179|    case 0:
  ------------------
  |  Branch (111:5): [True: 179, False: 329]
  ------------------
  112|    179|        *keytype = "ML-DSA-44";
  113|    179|        *keylen = ML_DSA_44_PUB_LEN;
  ------------------
  |  |   29|    179|# define ML_DSA_44_PUB_LEN 1312
  ------------------
  114|    179|        break;
  115|    136|    case 1:
  ------------------
  |  Branch (115:5): [True: 136, False: 372]
  ------------------
  116|    136|        *keytype = "ML-DSA-65";
  117|    136|        *keylen = ML_DSA_65_PUB_LEN;
  ------------------
  |  |   34|    136|# define ML_DSA_65_PUB_LEN 1952
  ------------------
  118|    136|        break;
  119|    146|    case 2:
  ------------------
  |  Branch (119:5): [True: 146, False: 362]
  ------------------
  120|    146|        *keytype = "ML-DSA-87";
  121|    146|        *keylen = ML_DSA_87_PUB_LEN;
  ------------------
  |  |   39|    146|# define ML_DSA_87_PUB_LEN 2592
  ------------------
  122|    146|        break;
  123|      1|    case 3:
  ------------------
  |  Branch (123:5): [True: 1, False: 507]
  ------------------
  124|       |        /* select invalid alg */
  125|      1|        *keytype = "ML-DSA-33";
  126|      1|        *keylen = 33;
  127|      1|        break;
  128|     45|    case 4:
  ------------------
  |  Branch (128:5): [True: 45, False: 463]
  ------------------
  129|       |        /* Select valid alg, but bogus size */
  130|     45|        *keytype = "ML-DSA-87";
  131|     45|        *buf = (uint8_t *)OPENSSL_load_u16_le(&keysize, *buf);
  132|     45|        *len -= sizeof(uint16_t);
  133|     45|        *keylen = (size_t)keysize;
  134|     45|        *keylen %= ML_DSA_87_PUB_LEN; /* size to our key buffer */
  ------------------
  |  |   39|     45|# define ML_DSA_87_PUB_LEN 2592
  ------------------
  135|     45|        break;
  136|      1|    default:
  ------------------
  |  Branch (136:5): [True: 1, False: 507]
  ------------------
  137|      1|        *keytype = NULL;
  138|      1|        *keylen = 0;
  139|      1|        break;
  140|    508|    }
  141|    508|    return 1;
  142|    508|}
ml-dsa.c:cleanup_ml_dsa_keys:
  529|    286|{
  530|    286|    EVP_PKEY_free((EVP_PKEY *)key1);
  531|    286|    EVP_PKEY_free((EVP_PKEY *)key2);
  532|    286|    EVP_PKEY_free((EVP_PKEY *)key3);
  533|    286|    EVP_PKEY_free((EVP_PKEY *)key4);
  534|    286|}
ml-dsa.c:keygen_ml_dsa_real_key:
  278|    222|{
  279|    222|    if (!keygen_ml_dsa_real_key_helper(buf, len, (EVP_PKEY **)key1)
  ------------------
  |  Branch (279:9): [True: 0, False: 222]
  ------------------
  280|    222|        || !keygen_ml_dsa_real_key_helper(buf, len, (EVP_PKEY **)key2))
  ------------------
  |  Branch (280:12): [True: 0, False: 222]
  ------------------
  281|      0|        fprintf(stderr, "Unable to generate valid keys");
  282|    222|}
ml-dsa.c:keygen_ml_dsa_real_key_helper:
  221|    444|{
  222|    444|    char *keytype = NULL;
  223|    444|    size_t keylen = 0;
  224|    444|    EVP_PKEY_CTX *ctx = NULL;
  225|    444|    int ret = 0;
  226|       |
  227|       |    /*
  228|       |     * Only generate valid key types and lengths. Note, no adjustment is made to
  229|       |     * keylen here, as the provider is responsible for selecting the keys and
  230|       |     * sizes for us during the EVP_PKEY_keygen call
  231|       |     */
  232|    444|    if (!select_keytype_and_size(buf, len, &keytype, &keylen, 1))
  ------------------
  |  Branch (232:9): [True: 0, False: 444]
  ------------------
  233|      0|        goto err;
  234|       |
  235|    444|    ctx = EVP_PKEY_CTX_new_from_name(NULL, keytype, NULL);
  236|    444|    if (!ctx) {
  ------------------
  |  Branch (236:9): [True: 0, False: 444]
  ------------------
  237|      0|        fprintf(stderr, "Failed to generate ctx\n");
  238|      0|        goto err;
  239|      0|    }
  240|       |
  241|    444|    if (!EVP_PKEY_keygen_init(ctx)) {
  ------------------
  |  Branch (241:9): [True: 0, False: 444]
  ------------------
  242|      0|        fprintf(stderr, "Failed to init keygen ctx\n");
  243|      0|        goto err;
  244|      0|    }
  245|       |
  246|    444|    *key = EVP_PKEY_new();
  247|    444|    if (*key == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 444]
  ------------------
  248|      0|        goto err;
  249|       |
  250|    444|    if (!EVP_PKEY_generate(ctx, key)) {
  ------------------
  |  Branch (250:9): [True: 0, False: 444]
  ------------------
  251|      0|        fprintf(stderr, "Failed to generate new real key\n");
  252|      0|        goto err;
  253|      0|    }
  254|       |
  255|    444|    ret = 1;
  256|    444|err:
  257|    444|    EVP_PKEY_CTX_free(ctx);
  258|    444|    return ret;
  259|    444|}
ml-dsa.c:ml_dsa_sign_verify:
  300|    119|{
  301|    119|    EVP_PKEY *key = (EVP_PKEY *)key1;
  302|    119|    EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_from_pkey(NULL, key, NULL);
  303|    119|    EVP_SIGNATURE *sig_alg = NULL;
  304|    119|    unsigned char *sig = NULL;
  305|    119|    size_t sig_len = 0, tbslen;
  306|    119|    unsigned char *tbs = NULL;
  307|       |    /* Ownership of alg is retained by the pkey object */
  308|    119|    const char *alg = EVP_PKEY_get0_type_name(key);
  309|    119|    const OSSL_PARAM params[] = {
  310|    119|        OSSL_PARAM_octet_string("context-string",
  ------------------
  |  |   63|    119|    OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|    119|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    119|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|    119|                                (unsigned char *)"A context string", 16),
  312|    119|        OSSL_PARAM_END
  ------------------
  |  |   25|    119|    { NULL, 0, NULL, 0, 0 }
  ------------------
  313|    119|    };
  314|       |
  315|    119|    if (!consume_size_t(*buf, len, &tbslen)) {
  ------------------
  |  Branch (315:9): [True: 0, False: 119]
  ------------------
  316|      0|        fprintf(stderr, "Failed to set tbslen");
  317|      0|        goto err;
  318|      0|    }
  319|       |    /* Keep tbslen within a reasonable value we can malloc */
  320|    119|    tbslen = (tbslen % 2048) + 1;
  321|       |
  322|    119|    if ((tbs = OPENSSL_malloc(tbslen)) == NULL
  ------------------
  |  |  102|    119|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    119|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    119|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (322:9): [True: 0, False: 119]
  ------------------
  323|    119|        || ctx == NULL || alg == NULL
  ------------------
  |  Branch (323:12): [True: 0, False: 119]
  |  Branch (323:27): [True: 0, False: 119]
  ------------------
  324|    119|        || !RAND_bytes_ex(NULL, tbs, tbslen, 0)) {
  ------------------
  |  Branch (324:12): [True: 0, False: 119]
  ------------------
  325|      0|        fprintf(stderr, "Failed basic initialization\n");
  326|      0|        goto err;
  327|      0|    }
  328|       |
  329|       |    /*
  330|       |     * Because ML-DSA is fundamentally a one-shot algorithm like "pure" Ed25519
  331|       |     * and Ed448, we don't have any immediate plans to implement intermediate
  332|       |     * sign/verify functions. Therefore, we only test the one-shot functions.
  333|       |     */
  334|       |
  335|    119|    if ((sig_alg = EVP_SIGNATURE_fetch(NULL, alg, NULL)) == NULL
  ------------------
  |  Branch (335:9): [True: 0, False: 119]
  ------------------
  336|    119|        || EVP_PKEY_sign_message_init(ctx, sig_alg, params) <= 0
  ------------------
  |  Branch (336:12): [True: 0, False: 119]
  ------------------
  337|    119|        || EVP_PKEY_sign(ctx, NULL, &sig_len, tbs, tbslen) <= 0
  ------------------
  |  Branch (337:12): [True: 0, False: 119]
  ------------------
  338|    119|        || (sig = OPENSSL_zalloc(sig_len)) == NULL
  ------------------
  |  |  104|    119|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    119|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    119|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (338:12): [True: 0, False: 119]
  ------------------
  339|    119|        || EVP_PKEY_sign(ctx, sig, &sig_len, tbs, tbslen) <= 0) {
  ------------------
  |  Branch (339:12): [True: 0, False: 119]
  ------------------
  340|      0|        fprintf(stderr, "Failed to sign message\n");
  341|      0|        goto err;
  342|      0|    }
  343|       |
  344|       |    /* Verify signature */
  345|    119|    EVP_PKEY_CTX_free(ctx);
  346|    119|    ctx = NULL;
  347|       |
  348|    119|    if ((ctx = EVP_PKEY_CTX_new_from_pkey(NULL, key, NULL)) == NULL
  ------------------
  |  Branch (348:9): [True: 0, False: 119]
  ------------------
  349|    119|        || EVP_PKEY_verify_message_init(ctx, sig_alg, params) <= 0
  ------------------
  |  Branch (349:12): [True: 0, False: 119]
  ------------------
  350|    119|        || EVP_PKEY_verify(ctx, sig, sig_len, tbs, tbslen) <= 0) {
  ------------------
  |  Branch (350:12): [True: 0, False: 119]
  ------------------
  351|      0|        fprintf(stderr, "Failed to verify message\n");
  352|      0|        goto err;
  353|      0|    }
  354|       |
  355|    119|err:
  356|    119|    OPENSSL_free(tbs);
  ------------------
  |  |  115|    119|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    119|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    119|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  357|    119|    EVP_PKEY_CTX_free(ctx);
  358|    119|    EVP_SIGNATURE_free(sig_alg);
  359|    119|    OPENSSL_free(sig);
  ------------------
  |  |  115|    119|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    119|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    119|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|    119|    return;
  361|    119|}
ml-dsa.c:consume_size_t:
   57|    190|{
   58|    190|    if (*len < sizeof(size_t))
  ------------------
  |  Branch (58:9): [True: 0, False: 190]
  ------------------
   59|      0|        return NULL;
   60|    190|    *val = *buf;
   61|    190|    *len -= sizeof(size_t);
   62|    190|    return (uint8_t *)buf + sizeof(size_t);
   63|    190|}
ml-dsa.c:ml_dsa_digest_sign_verify:
  379|     71|{
  380|     71|    EVP_PKEY *key = (EVP_PKEY *)key1;
  381|     71|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  382|     71|    EVP_SIGNATURE *sig_alg = NULL;
  383|     71|    unsigned char *sig = NULL;
  384|     71|    size_t sig_len, tbslen;
  385|     71|    unsigned char *tbs = NULL;
  386|     71|    const OSSL_PARAM params[] = {
  387|     71|        OSSL_PARAM_octet_string("context-string",
  ------------------
  |  |   63|     71|    OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|     71|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     71|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|     71|                                (unsigned char *)"A context string", 16),
  389|     71|        OSSL_PARAM_END
  ------------------
  |  |   25|     71|    { NULL, 0, NULL, 0, 0 }
  ------------------
  390|     71|    };
  391|       |
  392|     71|    if (!consume_size_t(*buf, len, &tbslen)) {
  ------------------
  |  Branch (392:9): [True: 0, False: 71]
  ------------------
  393|      0|        fprintf(stderr, "Failed to set tbslen");
  394|      0|        goto err;
  395|      0|    }
  396|       |    /* Keep tbslen within a reasonable value we can malloc */
  397|     71|    tbslen = (tbslen % 2048) + 1;
  398|       |
  399|     71|    if ((tbs = OPENSSL_malloc(tbslen)) == NULL
  ------------------
  |  |  102|     71|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     71|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     71|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (399:9): [True: 0, False: 71]
  ------------------
  400|     71|        || ctx == NULL
  ------------------
  |  Branch (400:12): [True: 0, False: 71]
  ------------------
  401|     71|        || !RAND_bytes_ex(NULL, tbs, tbslen, 0)) {
  ------------------
  |  Branch (401:12): [True: 0, False: 71]
  ------------------
  402|      0|        fprintf(stderr, "Failed basic initialization\n");
  403|      0|        goto err;
  404|      0|    }
  405|       |
  406|       |    /*
  407|       |     * Because ML-DSA is fundamentally a one-shot algorithm like "pure" Ed25519
  408|       |     * and Ed448, we don't have any immediate plans to implement intermediate
  409|       |     * sign/verify functions. Therefore, we only test the one-shot functions.
  410|       |     */
  411|       |
  412|     71|    if (!EVP_DigestSignInit_ex(ctx, NULL, NULL, NULL, "?fips=true", key, params)
  ------------------
  |  Branch (412:9): [True: 0, False: 71]
  ------------------
  413|     71|        || EVP_DigestSign(ctx, NULL, &sig_len, tbs, tbslen) <= 0
  ------------------
  |  Branch (413:12): [True: 0, False: 71]
  ------------------
  414|     71|        || (sig = OPENSSL_malloc(sig_len)) == NULL
  ------------------
  |  |  102|     71|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     71|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     71|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (414:12): [True: 0, False: 71]
  ------------------
  415|     71|        || EVP_DigestSign(ctx, sig, &sig_len, tbs, tbslen) <= 0) {
  ------------------
  |  Branch (415:12): [True: 0, False: 71]
  ------------------
  416|      0|        fprintf(stderr, "Failed to sign digest with EVP_DigestSign\n");
  417|      0|        goto err;
  418|      0|    }
  419|       |
  420|       |    /* Verify signature */
  421|     71|    EVP_MD_CTX_free(ctx);
  422|     71|    ctx = NULL;
  423|       |
  424|     71|    if ((ctx = EVP_MD_CTX_new()) == NULL
  ------------------
  |  Branch (424:9): [True: 0, False: 71]
  ------------------
  425|     71|        || EVP_DigestVerifyInit_ex(ctx, NULL, NULL, NULL, "?fips=true", key,
  ------------------
  |  Branch (425:12): [True: 0, False: 71]
  ------------------
  426|     71|                                   params) <= 0
  427|     71|        || EVP_DigestVerify(ctx, sig, sig_len, tbs, tbslen) <= 0) {
  ------------------
  |  Branch (427:12): [True: 0, False: 71]
  ------------------
  428|      0|        fprintf(stderr, "Failed to verify digest with EVP_DigestVerify\n");
  429|      0|        goto err;
  430|      0|    }
  431|       |
  432|     71|err:
  433|     71|    OPENSSL_free(tbs);
  ------------------
  |  |  115|     71|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     71|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     71|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  434|     71|    EVP_MD_CTX_free(ctx);
  435|     71|    EVP_SIGNATURE_free(sig_alg);
  436|     71|    OPENSSL_free(sig);
  ------------------
  |  |  115|     71|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     71|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     71|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  437|     71|    return;
  438|     71|}
ml-dsa.c:ml_dsa_export_import:
  460|      4|{
  461|      4|    EVP_PKEY *alice = (EVP_PKEY *)key1;
  462|      4|    EVP_PKEY *new_key = NULL;
  463|      4|    EVP_PKEY_CTX *ctx = NULL;
  464|      4|    OSSL_PARAM *params = NULL;
  465|       |
  466|      4|    if (!EVP_PKEY_todata(alice, EVP_PKEY_KEYPAIR, &params)) {
  ------------------
  |  |  113|      4|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  111|      4|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      4|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  647|      4|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  642|      4|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  648|      4|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  643|      4|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|      4|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|      4|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
  |  Branch (466:9): [True: 0, False: 4]
  ------------------
  467|      0|        fprintf(stderr, "Failed todata\n");
  468|      0|        goto err;
  469|      0|    }
  470|       |
  471|      4|    ctx = EVP_PKEY_CTX_new_from_pkey(NULL, alice, NULL);
  472|      4|    if (ctx == NULL) {
  ------------------
  |  Branch (472:9): [True: 0, False: 4]
  ------------------
  473|      0|        fprintf(stderr, "Failed new ctx\n");
  474|      0|        goto err;
  475|      0|    }
  476|       |
  477|      4|    if (!EVP_PKEY_fromdata(ctx, &new_key, EVP_PKEY_KEYPAIR, params)) {
  ------------------
  |  |  113|      4|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  111|      4|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      4|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  647|      4|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  642|      4|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  648|      4|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  643|      4|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|      4|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|      4|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
  |  Branch (477:9): [True: 0, False: 4]
  ------------------
  478|      0|        fprintf(stderr, "Failed fromdata\n");
  479|      0|        goto err;
  480|      0|    }
  481|       |
  482|      4|err:
  483|      4|    EVP_PKEY_CTX_free(ctx);
  484|      4|    EVP_PKEY_free(new_key);
  485|      4|    OSSL_PARAM_free(params);
  486|      4|}
ml-dsa.c:ml_dsa_compare:
  505|     22|{
  506|     22|    EVP_PKEY *alice = (EVP_PKEY *)key1;
  507|     22|    EVP_PKEY *bob = (EVP_PKEY *)key2;
  508|       |
  509|     22|    EVP_PKEY_eq(alice, alice);
  510|     22|    EVP_PKEY_eq(alice, bob);
  511|     22|}

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

property.c:ossl_sa_ALGORITHM_new:
   27|      4|    { \
   28|      4|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|      4|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|      4|    { \
   57|      4|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|      4|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|      4|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    522|    { \
   69|    522|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    522|    } \
property.c:ossl_sa_ALGORITHM_free:
   32|      4|    { \
   33|      4|        ossl_sa_free((OPENSSL_SA *)sa); \
   34|      4|    } \
property.c:ossl_sa_ALGORITHM_get:
   62|  2.62k|    { \
   63|  2.62k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  2.62k|    } \

digest.c:ossl_assert_int:
   45|  38.4k|{
   46|  38.4k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 38.4k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  38.4k|    return expr;
   50|  38.4k|}
evp_fetch.c:ossl_assert_int:
   45|  6.80k|{
   46|  6.80k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 6.80k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  6.80k|    return expr;
   50|  6.80k|}
m_sigver.c:ossl_assert_int:
   45|    142|{
   46|    142|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 142]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    142|    return expr;
   50|    142|}
p_lib.c:ossl_assert_int:
   45|  4.51k|{
   46|  4.51k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4.51k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  4.51k|    return expr;
   50|  4.51k|}
core_algorithm.c:ossl_assert_int:
   45|      5|{
   46|      5|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 5]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|      5|    return expr;
   50|      5|}
core_fetch.c:ossl_assert_int:
   45|     25|{
   46|     25|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 25]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     25|    return expr;
   50|     25|}
core_namemap.c:ossl_assert_int:
   45|  1.18k|{
   46|  1.18k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.18k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.18k|    return expr;
   50|  1.18k|}
provider_core.c:ossl_assert_int:
   45|     22|{
   46|     22|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     22|    return expr;
   50|     22|}
threads_pthread.c:ossl_assert_int:
   45|  10.3k|{
   46|  10.3k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 10.3k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  10.3k|    return expr;
   50|  10.3k|}
defn_cache.c:ossl_assert_int:
   45|    522|{
   46|    522|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 522]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    522|    return expr;
   50|    522|}
property.c:ossl_assert_int:
   45|    279|{
   46|    279|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 279]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    279|    return expr;
   50|    279|}
drbg_ctr.c:ossl_assert_int:
   45|     13|{
   46|     13|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 13]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     13|    return expr;
   50|     13|}
bio_print.c:ossl_assert_int:
   45|  11.9k|{
   46|  11.9k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 11.9k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  11.9k|    return expr;
   50|  11.9k|}
evp_enc.c:ossl_assert_int:
   45|  2.61k|{
   46|  2.61k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.61k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.61k|    return expr;
   50|  2.61k|}
packet.c:ossl_assert_int:
   45|   169k|{
   46|   169k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 169k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   169k|    return expr;
   50|   169k|}
ml_dsa_sign.c:ossl_assert_int:
   45|    380|{
   46|    380|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 380]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    380|    return expr;
   50|    380|}

ml_dsa_encoders.c:constant_time_select_32:
  372|  3.51M|{
  373|  3.51M|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|  3.51M|}
ml_dsa_encoders.c:value_barrier_32:
  291|  7.02M|{
  292|  7.02M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|  7.02M|    uint32_t r;
  294|  7.02M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|  7.02M|    return r;
  299|  7.02M|}
ml_dsa_encoders.c:constant_time_lt_32:
  142|  3.51M|{
  143|  3.51M|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|  3.51M|}
ml_dsa_encoders.c:constant_time_msb_32:
  110|  3.51M|{
  111|  3.51M|    return 0 - (a >> 31);
  112|  3.51M|}
ml_dsa_key.c:constant_time_select_32:
  372|   664k|{
  373|   664k|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|   664k|}
ml_dsa_key.c:value_barrier_32:
  291|  1.32M|{
  292|  1.32M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|  1.32M|    uint32_t r;
  294|  1.32M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|  1.32M|    return r;
  299|  1.32M|}
ml_dsa_key.c:constant_time_lt_32:
  142|   664k|{
  143|   664k|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|   664k|}
ml_dsa_key.c:constant_time_msb_32:
  110|   664k|{
  111|   664k|    return 0 - (a >> 31);
  112|   664k|}
ml_dsa_key_compress.c:constant_time_lt:
  126|   664k|{
  127|   664k|    return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b)));
  128|   664k|}
ml_dsa_key_compress.c:constant_time_msb:
  104|   664k|{
  105|   664k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  106|   664k|}
ml_dsa_key_compress.c:constant_time_select_int:
  360|  1.32M|{
  361|  1.32M|    return (int)constant_time_select(mask, (unsigned)(a), (unsigned)(b));
  362|  1.32M|}
ml_dsa_key_compress.c:constant_time_select:
  340|  1.32M|{
  341|  1.32M|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  342|  1.32M|}
ml_dsa_key_compress.c:value_barrier:
  279|  2.65M|{
  280|  2.65M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  281|  2.65M|    unsigned int r;
  282|  2.65M|    __asm__("" : "=r"(r) : "0"(a));
  283|       |#else
  284|       |    volatile unsigned int r = a;
  285|       |#endif
  286|  2.65M|    return r;
  287|  2.65M|}
ml_dsa_key_compress.c:constant_time_select_32:
  372|  1.24M|{
  373|  1.24M|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|  1.24M|}
ml_dsa_key_compress.c:value_barrier_32:
  291|  2.48M|{
  292|  2.48M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|  2.48M|    uint32_t r;
  294|  2.48M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|  2.48M|    return r;
  299|  2.48M|}
ml_dsa_key_compress.c:constant_time_lt_32:
  142|  1.24M|{
  143|  1.24M|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|  1.24M|}
ml_dsa_key_compress.c:constant_time_msb_32:
  110|  1.24M|{
  111|  1.24M|    return 0 - (a >> 31);
  112|  1.24M|}
ml_dsa_matrix.c:constant_time_select_32:
  372|  11.9M|{
  373|  11.9M|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|  11.9M|}
ml_dsa_matrix.c:value_barrier_32:
  291|  23.8M|{
  292|  23.8M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|  23.8M|    uint32_t r;
  294|  23.8M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|  23.8M|    return r;
  299|  23.8M|}
ml_dsa_matrix.c:constant_time_lt_32:
  142|  11.9M|{
  143|  11.9M|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|  11.9M|}
ml_dsa_matrix.c:constant_time_msb_32:
  110|  11.9M|{
  111|  11.9M|    return 0 - (a >> 31);
  112|  11.9M|}
ml_dsa_ntt.c:constant_time_select_32:
  372|  97.0M|{
  373|  97.0M|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|  97.0M|}
ml_dsa_ntt.c:value_barrier_32:
  291|   194M|{
  292|   194M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|   194M|    uint32_t r;
  294|   194M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|   194M|    return r;
  299|   194M|}
ml_dsa_ntt.c:constant_time_lt_32:
  142|  97.0M|{
  143|  97.0M|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|  97.0M|}
ml_dsa_ntt.c:constant_time_msb_32:
  110|  97.0M|{
  111|  97.0M|    return 0 - (a >> 31);
  112|  97.0M|}
ml_dsa_sample.c:value_barrier_32:
  291|  4.21M|{
  292|  4.21M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|  4.21M|    uint32_t r;
  294|  4.21M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|  4.21M|    return r;
  299|  4.21M|}
ml_dsa_sample.c:constant_time_select_32:
  372|  1.30M|{
  373|  1.30M|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|  1.30M|}
ml_dsa_sample.c:constant_time_lt_32:
  142|  1.30M|{
  143|  1.30M|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|  1.30M|}
ml_dsa_sample.c:constant_time_msb_32:
  110|  1.30M|{
  111|  1.30M|    return 0 - (a >> 31);
  112|  1.30M|}
ml_dsa_sign.c:constant_time_select_32:
  372|  5.40M|{
  373|  5.40M|    return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
  374|  5.40M|}
ml_dsa_sign.c:constant_time_lt_32:
  142|  5.40M|{
  143|  5.40M|    return constant_time_msb_32(a ^ ((a ^ b) | ((a - b) ^ b)));
  144|  5.40M|}
ml_dsa_sign.c:constant_time_msb_32:
  110|  5.40M|{
  111|  5.40M|    return 0 - (a >> 31);
  112|  5.40M|}
ml_dsa_sign.c:constant_time_select_int:
  360|  2.82M|{
  361|  2.82M|    return (int)constant_time_select(mask, (unsigned)(a), (unsigned)(b));
  362|  2.82M|}
ml_dsa_sign.c:constant_time_select:
  340|  2.82M|{
  341|  2.82M|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  342|  2.82M|}
ml_dsa_sign.c:value_barrier:
  279|  5.65M|{
  280|  5.65M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  281|  5.65M|    unsigned int r;
  282|  5.65M|    __asm__("" : "=r"(r) : "0"(a));
  283|       |#else
  284|       |    volatile unsigned int r = a;
  285|       |#endif
  286|  5.65M|    return r;
  287|  5.65M|}
ml_dsa_sign.c:value_barrier_32:
  291|  10.8M|{
  292|  10.8M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  293|  10.8M|    uint32_t r;
  294|  10.8M|    __asm__("" : "=r"(r) : "0"(a));
  295|       |#else
  296|       |    volatile uint32_t r = a;
  297|       |#endif
  298|  10.8M|    return r;
  299|  10.8M|}
ml_dsa_sign.c:constant_time_ge:
  194|  1.82k|{
  195|  1.82k|    return ~constant_time_lt(a, b);
  196|  1.82k|}
ml_dsa_sign.c:constant_time_lt:
  126|  2.83M|{
  127|  2.83M|    return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b)));
  128|  2.83M|}
ml_dsa_sign.c:constant_time_msb:
  104|  2.83M|{
  105|  2.83M|    return 0 - (a >> (sizeof(a) * 8 - 1));
  106|  2.83M|}

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

ml_dsa_encoders.c:PACKET_buf_init:
   72|  4.41k|{
   73|       |    /* Sanity check for negative values. */
   74|  4.41k|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 4.41k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|  4.41k|    pkt->curr = buf;
   78|  4.41k|    pkt->remaining = len;
   79|  4.41k|    return 1;
   80|  4.41k|}
ml_dsa_encoders.c:PACKET_copy_bytes:
  411|    231|{
  412|    231|    if (!PACKET_peek_copy_bytes(pkt, data, len))
  ------------------
  |  Branch (412:9): [True: 0, False: 231]
  ------------------
  413|      0|        return 0;
  414|       |
  415|    231|    packet_forward(pkt, len);
  416|       |
  417|    231|    return 1;
  418|    231|}
ml_dsa_encoders.c:PACKET_peek_copy_bytes:
  396|    231|{
  397|    231|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (397:9): [True: 0, False: 231]
  ------------------
  398|      0|        return 0;
  399|       |
  400|    231|    memcpy(data, pkt->curr, len);
  401|       |
  402|    231|    return 1;
  403|    231|}
ml_dsa_encoders.c:packet_forward:
   31|   335k|{
   32|   335k|    pkt->curr += len;
   33|   335k|    pkt->remaining -= len;
   34|   335k|}
ml_dsa_encoders.c:PACKET_get_bytes:
  383|   335k|{
  384|   335k|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (384:9): [True: 0, False: 335k]
  ------------------
  385|      0|        return 0;
  386|       |
  387|   335k|    packet_forward(pkt, len);
  388|       |
  389|   335k|    return 1;
  390|   335k|}
ml_dsa_encoders.c:PACKET_peek_bytes:
  365|   335k|{
  366|   335k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (366:9): [True: 0, False: 335k]
  ------------------
  367|      0|        return 0;
  368|       |
  369|   335k|    *data = pkt->curr;
  370|       |
  371|   335k|    return 1;
  372|   335k|}
ml_dsa_encoders.c:PACKET_remaining:
   40|   335k|{
   41|   335k|    return pkt->remaining;
   42|   335k|}

digest.c:CRYPTO_NEW_REF:
  280|     27|{
  281|     27|    refcnt->val = n;
  282|     27|    return 1;
  283|     27|}
digest.c:CRYPTO_UP_REF:
   40|  3.45k|{
   41|  3.45k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  3.45k|    return 1;
   43|  3.45k|}
digest.c:CRYPTO_DOWN_REF:
   56|  3.48k|{
   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.48k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  3.48k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 27, False: 3.45k]
  ------------------
   66|     27|        atomic_thread_fence(memory_order_acquire);
   67|  3.48k|#   endif
   68|  3.48k|    return 1;
   69|  3.48k|}
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|  1.73k|{
   41|  1.73k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  1.73k|    return 1;
   43|  1.73k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   56|  1.77k|{
   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|  1.77k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.77k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 40, False: 1.73k]
  ------------------
   66|     40|        atomic_thread_fence(memory_order_acquire);
   67|  1.77k|#   endif
   68|  1.77k|    return 1;
   69|  1.77k|}
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|}
p_lib.c:CRYPTO_NEW_REF:
  280|    474|{
  281|    474|    refcnt->val = n;
  282|    474|    return 1;
  283|    474|}
p_lib.c:CRYPTO_FREE_REF:
  285|    474|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    474|{
  287|    474|}
p_lib.c:CRYPTO_UP_REF:
   40|    384|{
   41|    384|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    384|    return 1;
   43|    384|}
p_lib.c:CRYPTO_DOWN_REF:
   56|    858|{
   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|    858|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    858|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 474, False: 384]
  ------------------
   66|    474|        atomic_thread_fence(memory_order_acquire);
   67|    858|#   endif
   68|    858|    return 1;
   69|    858|}
signature.c:CRYPTO_DOWN_REF:
   56|    623|{
   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|    623|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    623|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 59, False: 564]
  ------------------
   66|     59|        atomic_thread_fence(memory_order_acquire);
   67|    623|#   endif
   68|    623|    return 1;
   69|    623|}
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|    564|{
   41|    564|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    564|    return 1;
   43|    564|}
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|    279|{
   41|    279|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    279|    return 1;
   43|    279|}
provider_core.c:CRYPTO_NEW_REF:
  280|      1|{
  281|      1|    refcnt->val = n;
  282|      1|    return 1;
  283|      1|}
provider_core.c:CRYPTO_DOWN_REF:
   56|    280|{
   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|    280|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    280|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1, False: 279]
  ------------------
   66|      1|        atomic_thread_fence(memory_order_acquire);
   67|    280|#   endif
   68|    280|    return 1;
   69|    280|}
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|}
bio_lib.c:CRYPTO_FREE_REF:
  285|      1|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      1|{
  287|      1|}
evp_enc.c:CRYPTO_NEW_REF:
  280|    130|{
  281|    130|    refcnt->val = n;
  282|    130|    return 1;
  283|    130|}
evp_enc.c:CRYPTO_UP_REF:
   40|    147|{
   41|    147|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    147|    return 1;
   43|    147|}
evp_enc.c:CRYPTO_FREE_REF:
  285|    130|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    130|{
  287|    130|}
evp_enc.c:CRYPTO_DOWN_REF:
   56|    277|{
   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|    277|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    277|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 130, False: 147]
  ------------------
   66|    130|        atomic_thread_fence(memory_order_acquire);
   67|    277|#   endif
   68|    277|    return 1;
   69|    277|}
evp_rand.c:CRYPTO_UP_REF:
   40|     18|{
   41|     18|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     18|    return 1;
   43|     18|}
evp_rand.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
evp_rand.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}
evp_rand.c:CRYPTO_DOWN_REF:
   56|     27|{
   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|     27|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     27|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 18]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|     27|#   endif
   68|     27|    return 1;
   69|     27|}

stack.c:safe_muldiv_int:
  324|     17|    {                                                                        \
  325|     17|        int e2 = 0;                                                          \
  326|     17|        type q, r, x, y;                                                     \
  327|     17|                                                                             \
  328|     17|        if (c == 0) {                                                        \
  ------------------
  |  Branch (328:13): [True: 0, False: 17]
  ------------------
  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|     17|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  333|     17|        if (!e2)                                                             \
  ------------------
  |  Branch (333:13): [True: 17, False: 0]
  ------------------
  334|     17|            return safe_div_ ## type_name(x, c, err);                        \
  335|     17|        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|     17|    }
stack.c:safe_mul_int:
  138|     17|    {                                                                        \
  139|     17|        type r;                                                              \
  140|     17|                                                                             \
  141|     17|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (141:13): [True: 17, False: 0]
  ------------------
  142|     17|            return r;                                                        \
  143|     17|        *err |= 1;                                                           \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|     17|    }
stack.c:safe_div_int:
  201|     17|    {                                                                        \
  202|     17|        if (b == 0) {                                                        \
  ------------------
  |  Branch (202:13): [True: 0, False: 17]
  ------------------
  203|      0|            *err |= 1;                                                       \
  204|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                                    \
  206|     17|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (206:13): [True: 0, False: 17]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                                       \
  208|      0|            return max;                                                      \
  209|      0|        }                                                                    \
  210|     17|        return a / b;                                                        \
  211|     17|    }

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

ml-dsa.c:OPENSSL_load_u16_le:
  202|    553|{
  203|    553|# ifdef OSSL_LE16TOH
  204|    553|    uint16_t t;
  205|       |
  206|    553|    memcpy((unsigned char *)&t, in, 2);
  207|    553|    *val = OSSL_LE16TOH(t);
  ------------------
  |  |   53|    553|#   define OSSL_LE16TOH(x) le16toh(x)
  ------------------
  208|    553|    return in + 2;
  209|       |# else
  210|       |    uint16_t b0 = *in++;
  211|       |    uint16_t b1 = *in++;
  212|       |
  213|       |    *val = b0 | (b1 << 8);
  214|       |    return in;
  215|       |#endif
  216|    553|}
ml_dsa_encoders.c:OPENSSL_load_u32_le:
  238|   667k|{
  239|   667k|# ifdef OSSL_LE32TOH
  240|   667k|    uint32_t t;
  241|       |
  242|   667k|    memcpy((unsigned char *)&t, in, 4);
  243|   667k|    *val = OSSL_LE32TOH(t);
  ------------------
  |  |   54|   667k|#   define OSSL_LE32TOH(x) le32toh(x)
  ------------------
  244|   667k|    return in + 4;
  245|       |# else
  246|       |    uint32_t b0 = *in++;
  247|       |    uint32_t b1 = *in++;
  248|       |    uint32_t b2 = *in++;
  249|       |    uint32_t b3 = *in++;
  250|       |
  251|       |    *val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
  252|       |    return in;
  253|       |#endif
  254|   667k|}
ml_dsa_encoders.c:OPENSSL_store_u16_le:
   96|   159k|{
   97|   159k|# ifdef OSSL_HTOLE16
   98|   159k|    uint16_t t = OSSL_HTOLE16(val);
  ------------------
  |  |   50|   159k|#   define OSSL_HTOLE16(x) htole16(x)
  ------------------
   99|       |
  100|   159k|    memcpy(out, (unsigned char *)&t, 2);
  101|   159k|    return out + 2;
  102|       |# else
  103|       |    *out++ = (val & 0xff);
  104|       |    *out++ = (val >> 8) & 0xff;
  105|       |    return out;
  106|       |# endif
  107|   159k|}
ml_dsa_encoders.c:OPENSSL_store_u64_le:
  160|  83.0k|{
  161|  83.0k|# ifdef OSSL_HTOLE64
  162|  83.0k|    uint64_t t = OSSL_HTOLE64(val);
  ------------------
  |  |   52|  83.0k|#   define OSSL_HTOLE64(x) htole64(x)
  ------------------
  163|       |
  164|  83.0k|    memcpy(out, (unsigned char *)&t, 8);
  165|  83.0k|    return out + 8;
  166|       |# else
  167|       |    *out++ = (val & 0xff);
  168|       |    *out++ = (val >> 8) & 0xff;
  169|       |    *out++ = (val >> 16) & 0xff;
  170|       |    *out++ = (val >> 24) & 0xff;
  171|       |    *out++ = (val >> 32) & 0xff;
  172|       |    *out++ = (val >> 40) & 0xff;
  173|       |    *out++ = (val >> 48) & 0xff;
  174|       |    *out++ = (val >> 56) & 0xff;
  175|       |    return out;
  176|       |# endif
  177|  83.0k|}
ml_dsa_encoders.c:OPENSSL_store_u32_le:
  126|   210k|{
  127|   210k|# ifdef OSSL_HTOLE32
  128|   210k|    uint32_t t = OSSL_HTOLE32(val);
  ------------------
  |  |   51|   210k|#   define OSSL_HTOLE32(x) htole32(x)
  ------------------
  129|       |
  130|   210k|    memcpy(out, (unsigned char *)&t, 4);
  131|   210k|    return out + 4;
  132|       |# else
  133|       |    *out++ = (val & 0xff);
  134|       |    *out++ = (val >> 8) & 0xff;
  135|       |    *out++ = (val >> 16) & 0xff;
  136|       |    *out++ = (val >> 24) & 0xff;
  137|       |    return out;
  138|       |# endif
  139|   210k|}
ml_dsa_encoders.c:OPENSSL_load_u16_le:
  202|   241k|{
  203|   241k|# ifdef OSSL_LE16TOH
  204|   241k|    uint16_t t;
  205|       |
  206|   241k|    memcpy((unsigned char *)&t, in, 2);
  207|   241k|    *val = OSSL_LE16TOH(t);
  ------------------
  |  |   53|   241k|#   define OSSL_LE16TOH(x) le16toh(x)
  ------------------
  208|   241k|    return in + 2;
  209|       |# else
  210|       |    uint16_t b0 = *in++;
  211|       |    uint16_t b1 = *in++;
  212|       |
  213|       |    *val = b0 | (b1 << 8);
  214|       |    return in;
  215|       |#endif
  216|   241k|}
ml_dsa_sample.c:OPENSSL_load_u64_le:
  278|  1.00k|{
  279|  1.00k|# ifdef OSSL_LE64TOH
  280|  1.00k|    uint64_t t;
  281|       |
  282|  1.00k|    memcpy((unsigned char *)&t, in, 8);
  283|  1.00k|    *val = OSSL_LE64TOH(t);
  ------------------
  |  |   55|  1.00k|#   define OSSL_LE64TOH(x) le64toh(x)
  ------------------
  284|  1.00k|    return in + 8;
  285|       |# else
  286|       |    uint64_t b0 = *in++;
  287|       |    uint64_t b1 = *in++;
  288|       |    uint64_t b2 = *in++;
  289|       |    uint64_t b3 = *in++;
  290|       |    uint64_t b4 = *in++;
  291|       |    uint64_t b5 = *in++;
  292|       |    uint64_t b6 = *in++;
  293|       |    uint64_t b7 = *in++;
  294|       |
  295|       |    *val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24)
  296|       |        | (b4 << 32) | (b5 << 40) | (b6 << 48) | (b7 << 56);
  297|       |    return in;
  298|       |#endif
  299|  1.00k|}

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|    }
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|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
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|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
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|    }
drbg.c:OSSL_FUNC_rand_enable_locking:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_lock:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_unlock:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_get_ctx_params:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_get_seed:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_clear_seed:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
evp_enc.c:OSSL_FUNC_cipher_newctx:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_init:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_init:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_skey_init:
   59|     68|    {                                                                   \
   60|     68|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     68|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_skey_init:
   59|     68|    {                                                                   \
   60|     68|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     68|    }
evp_enc.c:OSSL_FUNC_cipher_update:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_final:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_cipher:
   59|    118|    {                                                                   \
   60|    118|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    118|    }
evp_enc.c:OSSL_FUNC_cipher_freectx:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_dupctx:
   59|    129|    {                                                                   \
   60|    129|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    129|    }
evp_enc.c:OSSL_FUNC_cipher_get_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_get_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_set_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_settable_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_get_seed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_clear_seed:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }

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

o_names.c:lh_OBJ_NAME_new:
  317|      1|    { \
  318|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      1|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      1|                                lh_##type##_doall_thunk, \
  321|      1|                                lh_##type##_doall_arg_thunk); \
  322|      1|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.31k|    { \
  244|  1.31k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.31k|        return hfn_conv((const type *)data); \
  246|  1.31k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|    918|    { \
  249|    918|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    918|        return cfn_conv((const type *)da, (const type *)db); \
  251|    918|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|    543|    { \
  300|    543|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    543|        doall_conv((type *)node); \
  302|    543|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|    651|    { \
  275|    651|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    651|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    424|    { \
  265|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    424|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    242|    { \
  280|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    242|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    242|    { \
  270|    242|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    242|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  354|      2|    { \
  355|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|      2|                             lh_##type##_doall_##argtype##_thunk, \
  357|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|      2|                             (void *)arg); \
  359|      2|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  346|    484|    { \
  347|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|    484|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|    484|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  289|      4|    { \
  290|      4|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      4|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|      7|    { \
  295|      7|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|      7|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      1|    { \
  312|      1|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_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|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  243|    263|    { \
  244|    263|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    263|        return hfn_conv((const type *)data); \
  246|    263|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    260|    { \
  249|    260|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    260|        return cfn_conv((const type *)da, (const type *)db); \
  251|    260|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|      1|    { \
  300|      1|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      1|        doall_conv((type *)node); \
  302|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    262|    { \
  275|    262|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    262|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|      1|    { \
  265|      1|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|      1|    { \
  280|      1|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      1|    } \
property.c:lh_QUERY_doall:
  311|    261|    { \
  312|    261|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    261|    } \
property.c:lh_QUERY_free:
  254|    261|    { \
  255|    261|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    261|    } \
property.c:lh_QUERY_new:
  317|    261|    { \
  318|    261|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    261|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    261|                                lh_##type##_doall_thunk, \
  321|    261|                                lh_##type##_doall_arg_thunk); \
  322|    261|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  2.08k|    { \
  244|  2.08k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  2.08k|        return hfn_conv((const type *)data); \
  246|  2.08k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  2.05k|    { \
  249|  2.05k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  2.05k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  2.05k|    } \
property.c:lh_QUERY_doall_thunk:
  299|     18|    { \
  300|     18|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     18|        doall_conv((type *)node); \
  302|     18|    } \
property.c:lh_QUERY_retrieve:
  274|  2.06k|    { \
  275|  2.06k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  2.06k|    } \
property.c:lh_QUERY_insert:
  264|     18|    { \
  265|     18|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     18|    } \
property.c:lh_QUERY_error:
  279|     18|    { \
  280|     18|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     18|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
property_string.c:lh_PROPERTY_STRING_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
property_string.c:lh_PROPERTY_STRING_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|     40|    { \
  244|     40|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|     40|        return hfn_conv((const type *)data); \
  246|     40|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|      7|    { \
  249|      7|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|      7|        return cfn_conv((const type *)da, (const type *)db); \
  251|      7|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|      9|    { \
  300|      9|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      9|        doall_conv((type *)node); \
  302|      9|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|     31|    { \
  275|     31|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|     31|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|      9|    { \
  265|      9|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      9|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|      9|    { \
  280|      9|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      9|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_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|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      1|    { \
  312|      1|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      1|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  4.38k|    { \
  197|  4.38k|        return (OPENSSL_LHASH *)lh; \
  198|  4.38k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      1|    { \
  207|      1|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      1|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      1|    { \
  202|      1|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      1|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  4.37k|    { \
  161|  4.37k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  4.37k|        return hfn_conv((const type *)data); \
  163|  4.37k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  2.94k|    { \
  166|  2.94k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  2.94k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  2.94k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  4.31k|    { \
  182|  4.31k|        return ptr; \
  183|  4.31k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|     68|    { \
  187|     68|        return ptr; \
  188|     68|    } \

obj_dat.c:OBJ_bsearch_ln:
  129|    933|      { \
  130|    933|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|    933|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|    933|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|  9.13k|      { \
  124|  9.13k|      type1 const *a = a_; \
  125|  9.13k|      type2 const *b = b_; \
  126|  9.13k|      return nm##_cmp(a,b); \
  127|  9.13k|      } \
obj_dat.c:OBJ_bsearch_sn:
  129|    938|      { \
  130|    938|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|    938|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|    938|      } \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  123|  10.2k|      { \
  124|  10.2k|      type1 const *a = a_; \
  125|  10.2k|      type2 const *b = b_; \
  126|  10.2k|      return nm##_cmp(a,b); \
  127|  10.2k|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|  1.87k|      { \
  130|  1.87k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.87k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.87k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|  7.48k|      { \
  124|  7.48k|      type1 const *a = a_; \
  125|  7.48k|      type2 const *b = b_; \
  126|  7.48k|      return nm##_cmp(a,b); \
  127|  7.48k|      } \

p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   53|    474|    { \
   54|    474|        return (OPENSSL_STACK *)sk; \
   55|    474|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   65|    474|    { \
   66|    474|        return (OPENSSL_sk_freefunc)fr; \
   67|    474|    }
core_namemap.c:sk_NAMES_value:
   84|    981|    { \
   85|    981|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|    981|    } \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   49|  5.72k|    { \
   50|  5.72k|        return (const OPENSSL_STACK *)sk; \
   51|  5.72k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   53|  1.48k|    { \
   54|  1.48k|        return (OPENSSL_STACK *)sk; \
   55|  1.48k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   45|    588|    { \
   46|    588|        return ptr; \
   47|    588|    } \
core_namemap.c:sk_NAMES_push:
  129|    253|    { \
  130|    253|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    253|    } \
core_namemap.c:sk_NAMES_num:
   80|    253|    { \
   81|    253|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    253|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    253|    { \
   66|    253|        return (OPENSSL_sk_freefunc)fr; \
   67|    253|    }
core_namemap.c:sk_NAMES_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
core_namemap.c:sk_NAMES_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|    } \
core_namemap.c:sk_NAMES_freefunc_thunk:
   75|    253|    { \
   76|    253|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    253|        freefunc((t3 *)ptr);\
   78|    253|    } \
ex_data.c:sk_EX_CALLBACK_pop_free:
  145|     18|    { \
  146|     18|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     18|        \
  148|     18|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     18|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     18|        \
  151|     18|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     18|    } \
ex_data.c:sk_EX_CALLBACK_num:
   80|    948|    { \
   81|    948|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    948|    } \
ex_data.c:ossl_check_void_sk_type:
   53|    474|    { \
   54|    474|        return (OPENSSL_STACK *)sk; \
   55|    474|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  112|      1|    { \
  113|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  129|      1|    { \
  130|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   80|      3|    { \
   81|      3|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      3|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   84|      1|    { \
   85|      1|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  120|      1|    { \
  121|      1|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  122|      1|    } \
provider_conf.c:sk_OSSL_PROVIDER_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|    } \
provider_core.c:sk_INFOPAIR_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|    } \
provider_core.c:sk_OSSL_PROVIDER_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|    } \
provider_core.c:sk_OSSL_PROVIDER_freefunc_thunk:
   75|      1|    { \
   76|      1|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      1|        freefunc((t3 *)ptr);\
   78|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_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|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   88|      1|    { \
   89|      1|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      1|        \
   92|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_sort:
  174|      3|    { \
  175|      3|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_find:
  162|      3|    { \
  163|      3|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
  164|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   84|     48|    { \
   85|     48|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|     48|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  188|      1|    { \
  189|      1|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|      1|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|      1|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  129|      1|    { \
  130|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      1|    } \
provider_core.c:sk_INFOPAIR_num:
   80|    948|    { \
   81|    948|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    948|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  182|     15|    { \
  183|     15|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|     15|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   80|     15|    { \
   81|     15|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     15|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
  112|     15|    { \
  113|     15|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|     15|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   80|      1|    { \
   81|      1|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      1|    } \
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|      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_free:
  112|      1|    { \
  113|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      1|    } \
property.c:sk_IMPLEMENTATION_pop_free:
  145|    261|    { \
  146|    261|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    261|        \
  148|    261|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    261|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    261|        \
  151|    261|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    261|    } \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   75|    261|    { \
   76|    261|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    261|        freefunc((t3 *)ptr);\
   78|    261|    } \
property.c:sk_IMPLEMENTATION_new_null:
   96|    261|    { \
   97|    261|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    261|    } \
property.c:sk_IMPLEMENTATION_num:
   80|    546|    { \
   81|    546|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    546|    } \
property.c:sk_IMPLEMENTATION_value:
   84|     18|    { \
   85|     18|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|     18|    } \
property.c:sk_IMPLEMENTATION_push:
  129|    261|    { \
  130|    261|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    261|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   88|     19|    { \
   89|     19|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|     19|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|     19|        \
   92|     19|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|     19|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|     19|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   75|      7|    { \
   76|      7|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      7|        freefunc((t3 *)ptr);\
   78|      7|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  129|      7|    { \
  130|      7|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      7|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   80|     19|    { \
   81|     19|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     19|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  174|     19|    { \
  175|     19|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|     19|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   84|      7|    { \
   85|      7|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      7|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  145|     19|    { \
  146|     19|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     19|        \
  148|     19|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     19|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     19|        \
  151|     19|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     19|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|     11|    { \
   54|     11|        return (OPENSSL_STACK *)sk; \
   55|     11|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   45|      9|    { \
   46|      9|        return ptr; \
   47|      9|    } \
conf_mod.c:sk_CONF_IMODULE_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  182|      1|    { \
  183|      1|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      1|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
conf_mod.c:sk_CONF_MODULE_num:
   80|      2|    { \
   81|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      2|    } \
conf_mod.c:sk_CONF_MODULE_free:
  112|      3|    { \
  113|      3|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      3|    } \
conf_mod.c:sk_CONF_MODULE_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|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   80|      1|    { \
   81|      1|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      1|    } \
evp_pbe.c:sk_EVP_PBE_CTL_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|    } \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  145|    474|    { \
  146|    474|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    474|        \
  148|    474|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    474|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    474|        \
  151|    474|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    474|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   57|      1|    { \
   58|      1|        return (OPENSSL_sk_compfunc)cmp; \
   59|      1|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   53|      1|    { \
   54|      1|        return (OPENSSL_STACK *)sk; \
   55|      1|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   65|      1|    { \
   66|      1|        return (OPENSSL_sk_freefunc)fr; \
   67|      1|    }

ossl_prov_bio_from_dispatch:
   27|      1|{
   28|     53|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 52, False: 1]
  ------------------
   29|     52|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 42, False: 10]
  ------------------
   30|      1|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  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_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_DER_w_algorithmIdentifier_ML_DSA:
   20|    380|{
   21|    380|    const uint8_t *alg;
   22|    380|    size_t len;
   23|    380|    const char *name = ossl_ml_dsa_key_get_name(key);
   24|       |
   25|    380|    if (OPENSSL_strcasecmp(name, "ML-DSA-44") == 0) {
  ------------------
  |  Branch (25:9): [True: 134, False: 246]
  ------------------
   26|    134|        alg = ossl_der_oid_id_ml_dsa_44;
   27|    134|        len = sizeof(ossl_der_oid_id_ml_dsa_44);
   28|    246|    } else if (OPENSSL_strcasecmp(name, "ML-DSA-65") == 0) {
  ------------------
  |  Branch (28:16): [True: 132, False: 114]
  ------------------
   29|    132|        alg = ossl_der_oid_id_ml_dsa_65;
   30|    132|        len = sizeof(ossl_der_oid_id_ml_dsa_65);
   31|    132|    } else if (OPENSSL_strcasecmp(name, "ML-DSA-87") == 0) {
  ------------------
  |  Branch (31:16): [True: 114, False: 0]
  ------------------
   32|    114|        alg = ossl_der_oid_id_ml_dsa_87;
   33|    114|        len = sizeof(ossl_der_oid_id_ml_dsa_87);
   34|    114|    } else {
   35|      0|        return 0;
   36|      0|    }
   37|    380|    return ossl_DER_w_begin_sequence(pkt, tag)
  ------------------
  |  Branch (37:12): [True: 380, False: 0]
  ------------------
   38|       |        /* No parameters */
   39|    380|        && ossl_DER_w_precompiled(pkt, -1, alg, len)
  ------------------
  |  Branch (39:12): [True: 380, False: 0]
  ------------------
   40|    380|        && ossl_DER_w_end_sequence(pkt, tag);
  ------------------
  |  Branch (40:12): [True: 380, False: 0]
  ------------------
   41|    380|}

sha3_prov.c:ossl_param_is_empty:
   30|  39.6k|{
   31|  39.6k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 39.6k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|  39.6k|}
drbg.c:ossl_param_is_empty:
   30|      3|{
   31|      3|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 3]
  |  Branch (31:30): [True: 0, False: 3]
  ------------------
   32|      3|}
ml_dsa_sig.c:ossl_param_is_empty:
   30|    380|{
   31|    380|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 380]
  |  Branch (31:30): [True: 0, False: 380]
  ------------------
   32|    380|}
ciphercommon.c:ossl_param_is_empty:
   30|  2.61k|{
   31|  2.61k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 2.61k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|  2.61k|}

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|    866|{
   53|    866|    if (ctx == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 866]
  ------------------
   54|      0|        return NULL;
   55|    866|    return ctx->libctx;
   56|    866|}
ossl_prov_ctx_get0_core_bio_method:
   66|      1|{
   67|      1|    if (ctx == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|        return NULL;
   69|      1|    return ctx->corebiometh;
   70|      1|}
ossl_prov_ctx_get_param:
   81|    948|{
   82|    948|    char *val = NULL;
   83|    948|    OSSL_PARAM param[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    948|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM param[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    948|    { NULL, 0, NULL, 0, 0 }
  ------------------
   84|       |
   85|    948|    if (ctx == NULL
  ------------------
  |  Branch (85:9): [True: 0, False: 948]
  ------------------
   86|    948|        || ctx->handle == NULL
  ------------------
  |  Branch (86:12): [True: 0, False: 948]
  ------------------
   87|    948|        || ctx->core_get_params == NULL)
  ------------------
  |  Branch (87:12): [True: 0, False: 948]
  ------------------
   88|      0|        return defval;
   89|       |
   90|    948|    param[0].key = (char *) name;
   91|    948|    param[0].data_type = OSSL_PARAM_UTF8_PTR;
  ------------------
  |  |  141|    948|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
   92|    948|    param[0].data = (void *) &val;
   93|    948|    param[0].data_size = sizeof(val);
   94|    948|    param[0].return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|    948|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   95|       |
   96|       |    /* Errors are ignored, returning the default value */
   97|    948|    if (ctx->core_get_params(ctx->handle, param)
  ------------------
  |  Branch (97:9): [True: 948, False: 0]
  ------------------
   98|    948|        && OSSL_PARAM_modified(param)
  ------------------
  |  Branch (98:12): [True: 0, False: 948]
  ------------------
   99|    948|        && val != NULL)
  ------------------
  |  Branch (99:12): [True: 0, False: 0]
  ------------------
  100|      0|        return val;
  101|    948|    return defval;
  102|    948|}
ossl_prov_ctx_get_bool_param:
  105|    948|{
  106|    948|    const char *val = ossl_prov_ctx_get_param(ctx, name, NULL);
  107|       |
  108|    948|    if (val != NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 948]
  ------------------
  109|      0|        if ((strcmp(val, "1") == 0)
  ------------------
  |  Branch (109:13): [True: 0, False: 0]
  ------------------
  110|      0|            || (OPENSSL_strcasecmp(val, "yes") == 0)
  ------------------
  |  Branch (110:16): [True: 0, False: 0]
  ------------------
  111|      0|            || (OPENSSL_strcasecmp(val, "true") == 0)
  ------------------
  |  Branch (111:16): [True: 0, False: 0]
  ------------------
  112|      0|            || (OPENSSL_strcasecmp(val, "on") == 0))
  ------------------
  |  Branch (112:16): [True: 0, False: 0]
  ------------------
  113|      0|            return 1;
  114|      0|        else if ((strcmp(val, "0") == 0)
  ------------------
  |  Branch (114:18): [True: 0, False: 0]
  ------------------
  115|      0|                 || (OPENSSL_strcasecmp(val, "no") == 0)
  ------------------
  |  Branch (115:21): [True: 0, False: 0]
  ------------------
  116|      0|                 || (OPENSSL_strcasecmp(val, "false") == 0)
  ------------------
  |  Branch (116:21): [True: 0, False: 0]
  ------------------
  117|      0|                 || (OPENSSL_strcasecmp(val, "off") == 0))
  ------------------
  |  Branch (117:21): [True: 0, False: 0]
  ------------------
  118|      0|            return 0;
  119|      0|    }
  120|    948|    return defval;
  121|    948|}

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

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

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

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

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

cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha1_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_gettable_ctx_params:
  303|      4|{
  304|      4|    return cipher_aes_known_gettable_ctx_params;
  305|      4|}
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha1_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha256_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha256_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \

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

cipher_aes_gcm_siv.c:ossl_aes_128_gcm_siv_get_params:
  287|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  288|      1|{                                                                                                       \
  289|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  290|      1|                                          flags, kbits, blkbits, ivbits);                               \
  291|      1|}                                                                                                       \
cipher_aes_gcm_siv.c:ossl_aes_gcm_siv_gettable_ctx_params:
  211|      3|{
  212|      3|    return aes_gcm_siv_known_gettable_ctx_params;
  213|      3|}
cipher_aes_gcm_siv.c:ossl_aes_192_gcm_siv_get_params:
  287|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  288|      1|{                                                                                                       \
  289|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  290|      1|                                          flags, kbits, blkbits, ivbits);                               \
  291|      1|}                                                                                                       \
cipher_aes_gcm_siv.c:ossl_aes_256_gcm_siv_get_params:
  287|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  288|      1|{                                                                                                       \
  289|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  290|      1|                                          flags, kbits, blkbits, ivbits);                               \
  291|      1|}                                                                                                       \

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

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

cipher_aes_ocb.c:aes_256_ocb_get_params:
  528|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  529|      1|{                                                                              \
  530|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  531|      1|                                          flags, kbits, blkbits, ivbits);      \
  532|      1|}                                                                              \
cipher_aes_ocb.c:cipher_ocb_gettable_ctx_params:
  488|      3|{
  489|      3|    return cipher_ocb_known_gettable_ctx_params;
  490|      3|}
cipher_aes_ocb.c:aes_192_ocb_get_params:
  528|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  529|      1|{                                                                              \
  530|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  531|      1|                                          flags, kbits, blkbits, ivbits);      \
  532|      1|}                                                                              \
cipher_aes_ocb.c:aes_128_ocb_get_params:
  528|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  529|      1|{                                                                              \
  530|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  531|      1|                                          flags, kbits, blkbits, ivbits);      \
  532|      1|}                                                                              \

cipher_aes_siv.c:aes_128_siv_get_params:
  260|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  261|      1|{                                                                              \
  262|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  263|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  264|      1|}                                                                              \
cipher_aes_siv.c:aes_siv_gettable_ctx_params:
  186|      3|{
  187|      3|    return aes_siv_known_gettable_ctx_params;
  188|      3|}
cipher_aes_siv.c:aes_192_siv_get_params:
  260|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  261|      1|{                                                                              \
  262|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  263|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  264|      1|}                                                                              \
cipher_aes_siv.c:aes_256_siv_get_params:
  260|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  261|      1|{                                                                              \
  262|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  263|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  264|      1|}                                                                              \

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

cipher_aes_xts.c:aes_256_xts_get_params:
  281|      1|static int aes_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  282|      1|{                                                                              \
  283|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  284|      1|                                     flags, 2 * kbits, AES_XTS_BLOCK_BITS,     \
  ------------------
  |  |   25|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  285|      1|                                     AES_XTS_IV_BITS);                         \
  ------------------
  |  |   24|      1|#define AES_XTS_IV_BITS 128
  ------------------
  286|      1|}                                                                              \
cipher_aes_xts.c:aes_128_xts_get_params:
  281|      1|static int aes_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  282|      1|{                                                                              \
  283|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  284|      1|                                     flags, 2 * kbits, AES_XTS_BLOCK_BITS,     \
  ------------------
  |  |   25|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  285|      1|                                     AES_XTS_IV_BITS);                         \
  ------------------
  |  |   24|      1|#define AES_XTS_IV_BITS 128
  ------------------
  286|      1|}                                                                              \

cipher_chacha20.c:chacha20_get_params:
   96|      1|{
   97|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_FLAGS,
  ------------------
  |  |   21|      1|#define CHACHA20_FLAGS (PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   98|      1|                                          CHACHA20_KEYLEN * 8,
  ------------------
  |  |   18|      1|#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
  |  |  ------------------
  |  |  |  |   45|      1|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
   99|      1|                                          CHACHA20_BLKLEN * 8,
  ------------------
  |  |   19|      1|#define CHACHA20_BLKLEN (1)
  ------------------
  100|      1|                                          CHACHA20_IVLEN * 8);
  ------------------
  |  |   20|      1|#define CHACHA20_IVLEN (CHACHA_CTR_SIZE)
  |  |  ------------------
  |  |  |  |   46|      1|#define CHACHA_CTR_SIZE         16
  |  |  ------------------
  ------------------
  101|      1|}
cipher_chacha20.c:chacha20_gettable_ctx_params:
  141|      1|{
  142|      1|    return chacha20_known_gettable_ctx_params;
  143|      1|}

cipher_chacha20_poly1305.c:chacha20_poly1305_get_params:
   97|      1|{
   98|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_POLY1305_FLAGS,
  ------------------
  |  |   24|      1|#define CHACHA20_POLY1305_FLAGS (PROV_CIPHER_FLAG_AEAD                         \
  |  |  ------------------
  |  |  |  |   39|      1|# define PROV_CIPHER_FLAG_AEAD             0x0001
  |  |  ------------------
  |  |   25|      1|                                 | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   99|      1|                                          CHACHA20_POLY1305_KEYLEN * 8,
  ------------------
  |  |   20|      1|#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
  |  |  ------------------
  |  |  |  |   45|      1|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
  100|      1|                                          CHACHA20_POLY1305_BLKLEN * 8,
  ------------------
  |  |   21|      1|#define CHACHA20_POLY1305_BLKLEN 1
  ------------------
  101|      1|                                          CHACHA20_POLY1305_IVLEN * 8);
  ------------------
  |  |   16|      1|#define CHACHA20_POLY1305_IVLEN 12
  ------------------
  102|      1|}
cipher_chacha20_poly1305.c:chacha20_poly1305_gettable_ctx_params:
  218|      1|{
  219|      1|    return chacha20_poly1305_known_gettable_ctx_params;
  220|      1|}

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

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

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

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

ossl_tdes_get_params:
  190|     10|{
  191|       |#ifdef FIPS_MODULE
  192|       |    const int decrypt_only = 1;
  193|       |#else
  194|     10|    const int decrypt_only = 0;
  195|     10|#endif
  196|     10|    OSSL_PARAM *p;
  197|       |
  198|     10|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_DECRYPT_ONLY);
  ------------------
  |  |  187|     10|# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
  ------------------
  199|     10|    if (p != NULL && !OSSL_PARAM_set_int(p, decrypt_only)) {
  ------------------
  |  Branch (199:9): [True: 0, False: 10]
  |  Branch (199:22): [True: 0, False: 0]
  ------------------
  200|      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)
  |  |  ------------------
  ------------------
  201|      0|        return 0;
  202|      0|    }
  203|       |
  204|     10|    return ossl_cipher_generic_get_params(params, md, flags,
  205|     10|                                          kbits, blkbits, ivbits);
  206|     10|}

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

ossl_cipher_generic_get_params:
   50|    130|{
   51|    130|    OSSL_PARAM *p;
   52|       |
   53|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_MODE);
  ------------------
  |  |  195|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
   54|    130|    if (p != NULL && !OSSL_PARAM_set_uint(p, md)) {
  ------------------
  |  Branch (54:9): [True: 130, False: 0]
  |  Branch (54:22): [True: 0, False: 130]
  ------------------
   55|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD);
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
   59|    130|    if (p != NULL
  ------------------
  |  Branch (59:9): [True: 130, False: 0]
  ------------------
   60|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
  ------------------
  |  |   39|    130|# define PROV_CIPHER_FLAG_AEAD             0x0001
  ------------------
  |  Branch (60:12): [True: 0, False: 130]
  ------------------
   61|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   62|      0|        return 0;
   63|      0|    }
   64|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CUSTOM_IV);
  ------------------
  |  |  186|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
   65|    130|    if (p != NULL
  ------------------
  |  Branch (65:9): [True: 130, False: 0]
  ------------------
   66|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
  ------------------
  |  |   40|    130|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  ------------------
  |  Branch (66:12): [True: 0, False: 130]
  ------------------
   67|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS);
  ------------------
  |  |  184|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
   71|    130|    if (p != NULL
  ------------------
  |  Branch (71:9): [True: 130, False: 0]
  ------------------
   72|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
  ------------------
  |  |   41|    130|# define PROV_CIPHER_FLAG_CTS              0x0004
  ------------------
  |  Branch (72:12): [True: 0, False: 130]
  ------------------
   73|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   74|      0|        return 0;
   75|      0|    }
   76|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK);
  ------------------
  |  |  203|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
   77|    130|    if (p != NULL
  ------------------
  |  Branch (77:9): [True: 130, False: 0]
  ------------------
   78|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
  ------------------
  |  |   42|    130|# define PROV_CIPHER_FLAG_TLS1_MULTIBLOCK  0x0008
  ------------------
  |  Branch (78:12): [True: 0, False: 130]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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 0;
   81|      0|    }
   82|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_HAS_RAND_KEY);
  ------------------
  |  |  191|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
   83|    130|    if (p != NULL
  ------------------
  |  Branch (83:9): [True: 130, False: 0]
  ------------------
   84|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
  ------------------
  |  |   43|    130|# define PROV_CIPHER_FLAG_RAND_KEY         0x0010
  ------------------
  |  Branch (84:12): [True: 0, False: 130]
  ------------------
   85|      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)
  |  |  ------------------
  ------------------
   86|      0|        return 0;
   87|      0|    }
   88|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC);
  ------------------
  |  |  188|    130|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
   89|    130|    if (p != NULL
  ------------------
  |  Branch (89:9): [True: 130, False: 0]
  ------------------
   90|    130|        && !OSSL_PARAM_set_int(p, (flags & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0)) {
  ------------------
  |  |  379|    130|# define         EVP_CIPH_FLAG_ENC_THEN_MAC      0x10000000
  ------------------
  |  Branch (90:12): [True: 0, False: 130]
  ------------------
   91|      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)
  |  |  ------------------
  ------------------
   92|      0|        return 0;
   93|      0|    }
   94|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
   95|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, kbits / 8)) {
  ------------------
  |  Branch (95:9): [True: 130, False: 0]
  |  Branch (95:22): [True: 0, False: 130]
  ------------------
   96|      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)
  |  |  ------------------
  ------------------
   97|      0|        return 0;
   98|      0|    }
   99|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_BLOCK_SIZE);
  ------------------
  |  |  183|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  100|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, blkbits / 8)) {
  ------------------
  |  Branch (100:9): [True: 130, False: 0]
  |  Branch (100:22): [True: 0, False: 130]
  ------------------
  101|      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)
  |  |  ------------------
  ------------------
  102|      0|        return 0;
  103|      0|    }
  104|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  105|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ivbits / 8)) {
  ------------------
  |  Branch (105:9): [True: 130, False: 0]
  |  Branch (105:22): [True: 0, False: 130]
  ------------------
  106|      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)
  |  |  ------------------
  ------------------
  107|      0|        return 0;
  108|      0|    }
  109|    130|    return 1;
  110|    130|}
ossl_cipher_aead_gettable_ctx_params:
  255|     14|{
  256|     14|    return cipher_aead_known_gettable_ctx_params;
  257|     14|}
ossl_cipher_generic_reset_ctx:
  332|      9|{
  333|      9|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (333:9): [True: 9, False: 0]
  |  Branch (333:24): [True: 0, False: 9]
  ------------------
  334|      0|        OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  335|      0|        ctx->alloced = 0;
  336|      0|        ctx->tlsmac = NULL;
  337|      0|    }
  338|      9|}
ossl_cipher_generic_einit:
  383|  2.61k|{
  384|  2.61k|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  385|  2.61k|                                        iv, ivlen, params, 1);
  386|  2.61k|}
ossl_cipher_generic_block_update:
  424|    935|{
  425|    935|    size_t outlint = 0;
  426|    935|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  427|    935|    size_t blksz = ctx->blocksize;
  428|    935|    size_t nextblocks;
  429|       |
  430|    935|    if (!ctx->key_set) {
  ------------------
  |  Branch (430:9): [True: 0, False: 935]
  ------------------
  431|      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)
  |  |  ------------------
  ------------------
  432|      0|        return 0;
  433|      0|    }
  434|       |
  435|    935|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (435:9): [True: 0, False: 935]
  ------------------
  436|       |        /*
  437|       |         * Each update call corresponds to a TLS record and is individually
  438|       |         * padded
  439|       |         */
  440|       |
  441|       |        /* Sanity check inputs */
  442|      0|        if (in == NULL
  ------------------
  |  Branch (442:13): [True: 0, False: 0]
  ------------------
  443|      0|                || in != out
  ------------------
  |  Branch (443:20): [True: 0, False: 0]
  ------------------
  444|      0|                || outsize < inl
  ------------------
  |  Branch (444:20): [True: 0, False: 0]
  ------------------
  445|      0|                || !ctx->pad) {
  ------------------
  |  Branch (445:20): [True: 0, False: 0]
  ------------------
  446|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  447|      0|            return 0;
  448|      0|        }
  449|       |
  450|      0|        if (ctx->enc) {
  ------------------
  |  Branch (450:13): [True: 0, False: 0]
  ------------------
  451|      0|            unsigned char padval;
  452|      0|            size_t padnum, loop;
  453|       |
  454|       |            /* Add padding */
  455|       |
  456|      0|            padnum = blksz - (inl % blksz);
  457|       |
  458|      0|            if (outsize < inl + padnum) {
  ------------------
  |  Branch (458:17): [True: 0, False: 0]
  ------------------
  459|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|            if (padnum > MAX_PADDING) {
  ------------------
  |  |  419|      0|#define MAX_PADDING 256
  ------------------
  |  Branch (463:17): [True: 0, False: 0]
  ------------------
  464|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|            padval = (unsigned char)(padnum - 1);
  468|      0|            if (ctx->tlsversion == SSL3_VERSION) {
  ------------------
  |  |   23|      0|# define SSL3_VERSION                    0x0300
  ------------------
  |  Branch (468:17): [True: 0, False: 0]
  ------------------
  469|      0|                if (padnum > 1)
  ------------------
  |  Branch (469:21): [True: 0, False: 0]
  ------------------
  470|      0|                    memset(out + inl, 0, padnum - 1);
  471|      0|                *(out + inl + padnum - 1) = padval;
  472|      0|            } else {
  473|       |                /* we need to add 'padnum' padding bytes of value padval */
  474|      0|                for (loop = inl; loop < inl + padnum; loop++)
  ------------------
  |  Branch (474:34): [True: 0, False: 0]
  ------------------
  475|      0|                    out[loop] = padval;
  476|      0|            }
  477|      0|            inl += padnum;
  478|      0|        }
  479|       |
  480|      0|        if ((inl % blksz) != 0) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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 0;
  483|      0|        }
  484|       |
  485|       |
  486|       |        /* Shouldn't normally fail */
  487|      0|        if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 0]
  ------------------
  488|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|      0|        if (ctx->alloced) {
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  494|      0|            ctx->alloced = 0;
  495|      0|            ctx->tlsmac = NULL;
  496|      0|        }
  497|       |
  498|       |        /* This only fails if padding is publicly invalid */
  499|      0|        *outl = inl;
  500|      0|        if (!ctx->enc
  ------------------
  |  Branch (500:13): [True: 0, False: 0]
  ------------------
  501|      0|            && !ossl_cipher_tlsunpadblock(ctx->libctx, ctx->tlsversion,
  ------------------
  |  Branch (501:16): [True: 0, False: 0]
  ------------------
  502|      0|                                          out, outl,
  503|      0|                                          blksz, &ctx->tlsmac, &ctx->alloced,
  504|      0|                                          ctx->tlsmacsize, 0)) {
  505|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  506|      0|            return 0;
  507|      0|        }
  508|      0|        return 1;
  509|      0|    }
  510|       |
  511|    935|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (511:9): [True: 0, False: 935]
  ------------------
  512|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  513|      0|                                           &in, &inl);
  514|    935|    else
  515|    935|        nextblocks = inl & ~(blksz-1);
  516|       |
  517|       |    /*
  518|       |     * If we're decrypting and we end an update on a block boundary we hold
  519|       |     * the last block back in case this is the last update call and the last
  520|       |     * block is padded.
  521|       |     */
  522|    935|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (522:9): [True: 0, False: 935]
  |  Branch (522:33): [True: 0, False: 0]
  |  Branch (522:45): [True: 0, False: 0]
  |  Branch (522:56): [True: 0, False: 0]
  ------------------
  523|      0|        if (outsize < blksz) {
  ------------------
  |  Branch (523:13): [True: 0, False: 0]
  ------------------
  524|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  525|      0|            return 0;
  526|      0|        }
  527|      0|        if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) {
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|            return 0;
  530|      0|        }
  531|      0|        ctx->bufsz = 0;
  532|      0|        outlint = blksz;
  533|      0|        out += blksz;
  534|      0|    }
  535|    935|    if (nextblocks > 0) {
  ------------------
  |  Branch (535:9): [True: 935, False: 0]
  ------------------
  536|    935|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (536:13): [True: 0, False: 935]
  |  Branch (536:26): [True: 0, False: 0]
  |  Branch (536:38): [True: 0, False: 0]
  ------------------
  537|      0|            if (!ossl_assert(inl >= blksz)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (537:17): [True: 0, False: 0]
  ------------------
  538|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  539|      0|                return 0;
  540|      0|            }
  541|      0|            nextblocks -= blksz;
  542|      0|        }
  543|    935|        outlint += nextblocks;
  544|    935|        if (outsize < outlint) {
  ------------------
  |  Branch (544:13): [True: 0, False: 935]
  ------------------
  545|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|      0|            return 0;
  547|      0|        }
  548|    935|    }
  549|    935|    if (nextblocks > 0) {
  ------------------
  |  Branch (549:9): [True: 935, False: 0]
  ------------------
  550|    935|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (550:13): [True: 0, False: 935]
  ------------------
  551|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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 0;
  553|      0|        }
  554|    935|        in += nextblocks;
  555|    935|        inl -= nextblocks;
  556|    935|    }
  557|    935|    if (inl != 0
  ------------------
  |  Branch (557:9): [True: 0, False: 935]
  ------------------
  558|    935|        && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) {
  ------------------
  |  Branch (558:12): [True: 0, False: 0]
  ------------------
  559|       |        /* ERR_raise already called */
  560|      0|        return 0;
  561|      0|    }
  562|       |
  563|    935|    *outl = outlint;
  564|    935|    return inl == 0;
  565|    935|}
ossl_cipher_generic_stream_update:
  644|    858|{
  645|    858|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  646|       |
  647|    858|    if (!ctx->key_set) {
  ------------------
  |  Branch (647:9): [True: 0, False: 858]
  ------------------
  648|      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)
  |  |  ------------------
  ------------------
  649|      0|        return 0;
  650|      0|    }
  651|       |
  652|    858|    if (inl == 0) {
  ------------------
  |  Branch (652:9): [True: 0, False: 858]
  ------------------
  653|      0|        *outl = 0;
  654|      0|        return 1;
  655|      0|    }
  656|       |
  657|    858|    if (outsize < inl) {
  ------------------
  |  Branch (657:9): [True: 0, False: 858]
  ------------------
  658|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  659|      0|        return 0;
  660|      0|    }
  661|       |
  662|    858|    if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (662:9): [True: 0, False: 858]
  ------------------
  663|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  664|      0|        return 0;
  665|      0|    }
  666|       |
  667|    858|    *outl = inl;
  668|    858|    if (!ctx->enc && ctx->tlsversion > 0) {
  ------------------
  |  Branch (668:9): [True: 0, False: 858]
  |  Branch (668:22): [True: 0, False: 0]
  ------------------
  669|       |        /*
  670|       |        * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
  671|       |        * cipher_aes_cbc_hmac_sha256_hw.c
  672|       |        */
  673|      0|        if (ctx->removetlspad) {
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|       |            /*
  675|       |             * We should have already failed in the cipher() call above if this
  676|       |             * isn't true.
  677|       |             */
  678|      0|            if (!ossl_assert(*outl >= (size_t)(out[inl - 1] + 1)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (678:17): [True: 0, False: 0]
  ------------------
  679|      0|                return 0;
  680|       |            /* The actual padding length */
  681|      0|            *outl -= out[inl - 1] + 1;
  682|      0|        }
  683|       |
  684|       |        /* TLS MAC and explicit IV if relevant. We should have already failed
  685|       |         * in the cipher() call above if *outl is too short.
  686|       |         */
  687|      0|        if (!ossl_assert(*outl >= ctx->removetlsfixed))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (687:13): [True: 0, False: 0]
  ------------------
  688|      0|            return 0;
  689|      0|        *outl -= ctx->removetlsfixed;
  690|       |
  691|       |        /* Extract the MAC if there is one */
  692|      0|        if (ctx->tlsmacsize > 0) {
  ------------------
  |  Branch (692:13): [True: 0, False: 0]
  ------------------
  693|      0|            if (*outl < ctx->tlsmacsize)
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  ------------------
  694|      0|                return 0;
  695|       |
  696|      0|            ctx->tlsmac = out + *outl - ctx->tlsmacsize;
  697|      0|            *outl -= ctx->tlsmacsize;
  698|      0|        }
  699|      0|    }
  700|       |
  701|    858|    return 1;
  702|    858|}
ossl_cipher_generic_get_ctx_params:
  749|     12|{
  750|     12|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  751|     12|    OSSL_PARAM *p;
  752|       |
  753|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|     12|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  754|     12|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (754:9): [True: 3, False: 9]
  |  Branch (754:22): [True: 0, False: 3]
  ------------------
  755|      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)
  |  |  ------------------
  ------------------
  756|      0|        return 0;
  757|      0|    }
  758|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  197|     12|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  759|     12|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
  ------------------
  |  Branch (759:9): [True: 0, False: 12]
  |  Branch (759:22): [True: 0, False: 0]
  ------------------
  760|      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)
  |  |  ------------------
  ------------------
  761|      0|        return 0;
  762|      0|    }
  763|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
  ------------------
  |  |  192|     12|# define OSSL_CIPHER_PARAM_IV "iv"
  ------------------
  764|     12|    if (p != NULL
  ------------------
  |  Branch (764:9): [True: 0, False: 12]
  ------------------
  765|     12|        && !OSSL_PARAM_set_octet_string_or_ptr(p, ctx->oiv, ctx->ivlen)) {
  ------------------
  |  Branch (765:12): [True: 0, False: 0]
  ------------------
  766|      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)
  |  |  ------------------
  ------------------
  767|      0|        return 0;
  768|      0|    }
  769|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
  ------------------
  |  |  215|     12|# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
  ------------------
  770|     12|    if (p != NULL
  ------------------
  |  Branch (770:9): [True: 0, False: 12]
  ------------------
  771|     12|        && !OSSL_PARAM_set_octet_string_or_ptr(p, ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (771:12): [True: 0, False: 0]
  ------------------
  772|      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)
  |  |  ------------------
  ------------------
  773|      0|        return 0;
  774|      0|    }
  775|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  196|     12|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  776|     12|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 12]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      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)
  |  |  ------------------
  ------------------
  778|      0|        return 0;
  779|      0|    }
  780|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|     12|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  781|     12|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (781:9): [True: 9, False: 3]
  |  Branch (781:22): [True: 0, False: 9]
  ------------------
  782|      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)
  |  |  ------------------
  ------------------
  783|      0|        return 0;
  784|      0|    }
  785|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
  ------------------
  |  |  212|     12|# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
  ------------------
  786|     12|    if (p != NULL
  ------------------
  |  Branch (786:9): [True: 0, False: 12]
  ------------------
  787|     12|        && !OSSL_PARAM_set_octet_ptr(p, ctx->tlsmac, ctx->tlsmacsize)) {
  ------------------
  |  Branch (787:12): [True: 0, False: 0]
  ------------------
  788|      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)
  |  |  ------------------
  ------------------
  789|      0|        return 0;
  790|      0|    }
  791|     12|    return 1;
  792|     12|}
ossl_cipher_generic_set_ctx_params:
  795|  2.61k|{
  796|  2.61k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  797|  2.61k|    const OSSL_PARAM *p;
  798|       |
  799|  2.61k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (799:9): [True: 2.61k, False: 0]
  ------------------
  800|  2.61k|        return 1;
  801|       |
  802|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  197|      0|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  803|      0|    if (p != NULL) {
  ------------------
  |  Branch (803:9): [True: 0, False: 0]
  ------------------
  804|      0|        unsigned int pad;
  805|       |
  806|      0|        if (!OSSL_PARAM_get_uint(p, &pad)) {
  ------------------
  |  Branch (806:13): [True: 0, False: 0]
  ------------------
  807|      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)
  |  |  ------------------
  ------------------
  808|      0|            return 0;
  809|      0|        }
  810|      0|        ctx->pad = pad ? 1 : 0;
  ------------------
  |  Branch (810:20): [True: 0, False: 0]
  ------------------
  811|      0|    }
  812|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_USE_BITS);
  ------------------
  |  |  216|      0|# define OSSL_CIPHER_PARAM_USE_BITS "use-bits"
  ------------------
  813|      0|    if (p != NULL) {
  ------------------
  |  Branch (813:9): [True: 0, False: 0]
  ------------------
  814|      0|        unsigned int bits;
  815|       |
  816|      0|        if (!OSSL_PARAM_get_uint(p, &bits)) {
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      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)
  |  |  ------------------
  ------------------
  818|      0|            return 0;
  819|      0|        }
  820|      0|        ctx->use_bits = bits ? 1 : 0;
  ------------------
  |  Branch (820:25): [True: 0, False: 0]
  ------------------
  821|      0|    }
  822|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
  ------------------
  |  |  214|      0|# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version"
  ------------------
  823|      0|    if (p != NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 0]
  ------------------
  824|      0|        if (!OSSL_PARAM_get_uint(p, &ctx->tlsversion)) {
  ------------------
  |  Branch (824:13): [True: 0, False: 0]
  ------------------
  825|      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)
  |  |  ------------------
  ------------------
  826|      0|            return 0;
  827|      0|        }
  828|      0|    }
  829|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_MAC_SIZE);
  ------------------
  |  |  213|      0|# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size"
  ------------------
  830|      0|    if (p != NULL) {
  ------------------
  |  Branch (830:9): [True: 0, False: 0]
  ------------------
  831|      0|        if (!OSSL_PARAM_get_size_t(p, &ctx->tlsmacsize)) {
  ------------------
  |  Branch (831:13): [True: 0, False: 0]
  ------------------
  832|      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)
  |  |  ------------------
  ------------------
  833|      0|            return 0;
  834|      0|        }
  835|      0|    }
  836|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  196|      0|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  837|      0|    if (p != NULL) {
  ------------------
  |  Branch (837:9): [True: 0, False: 0]
  ------------------
  838|      0|        unsigned int num;
  839|       |
  840|      0|        if (!OSSL_PARAM_get_uint(p, &num)) {
  ------------------
  |  Branch (840:13): [True: 0, False: 0]
  ------------------
  841|      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)
  |  |  ------------------
  ------------------
  842|      0|            return 0;
  843|      0|        }
  844|      0|        ctx->num = num;
  845|      0|    }
  846|      0|    return 1;
  847|      0|}
ossl_cipher_generic_initiv:
  851|    858|{
  852|    858|    if (ivlen != ctx->ivlen
  ------------------
  |  Branch (852:9): [True: 0, False: 858]
  ------------------
  853|    858|        || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (853:12): [True: 0, False: 858]
  ------------------
  854|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  855|      0|        return 0;
  856|      0|    }
  857|    858|    ctx->iv_set = 1;
  858|    858|    memcpy(ctx->iv, iv, ivlen);
  859|    858|    memcpy(ctx->oiv, iv, ivlen);
  860|    858|    return 1;
  861|    858|}
ossl_cipher_generic_initkey:
  867|      9|{
  868|      9|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  869|       |
  870|      9|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|      9|# define PROV_CIPHER_FLAG_INVERSE_CIPHER   0x0200
  ------------------
  |  Branch (870:9): [True: 0, False: 9]
  ------------------
  871|      0|        ctx->inverse_cipher = 1;
  872|      9|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|      9|# define PROV_CIPHER_FLAG_VARIABLE_LENGTH  0x0100
  ------------------
  |  Branch (872:9): [True: 0, False: 9]
  ------------------
  873|      0|        ctx->variable_keylength = 1;
  874|       |
  875|      9|    ctx->pad = 1;
  876|      9|    ctx->keylen = ((kbits) / 8);
  877|      9|    ctx->ivlen = ((ivbits) / 8);
  878|      9|    ctx->hw = hw;
  879|      9|    ctx->mode = mode;
  880|      9|    ctx->blocksize = blkbits / 8;
  881|      9|    if (provctx != NULL)
  ------------------
  |  Branch (881:9): [True: 9, False: 0]
  ------------------
  882|      9|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   31|      9|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  883|      9|}
ciphercommon.c:cipher_generic_init_internal:
  344|  2.61k|{
  345|  2.61k|    ctx->num = 0;
  346|  2.61k|    ctx->bufsz = 0;
  347|  2.61k|    ctx->updated = 0;
  348|  2.61k|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (348:16): [True: 2.61k, False: 0]
  ------------------
  349|       |
  350|  2.61k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (350:9): [True: 0, False: 2.61k]
  ------------------
  351|      0|        return 0;
  352|       |
  353|  2.61k|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  322|    858|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (353:9): [True: 858, False: 1.75k]
  |  Branch (353:23): [True: 858, False: 0]
  ------------------
  354|    858|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (354:13): [True: 0, False: 858]
  ------------------
  355|      0|            return 0;
  356|    858|    }
  357|  2.61k|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (357:9): [True: 1.75k, False: 858]
  |  Branch (357:23): [True: 861, False: 894]
  ------------------
  358|  2.61k|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  323|  1.72k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (358:13): [True: 0, False: 861]
  ------------------
  359|    861|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  324|  1.72k|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (359:16): [True: 0, False: 861]
  ------------------
  360|    861|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  325|    861|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (360:16): [True: 0, False: 861]
  ------------------
  361|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  362|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  363|       |
  364|  2.61k|    if (key != NULL) {
  ------------------
  |  Branch (364:9): [True: 1.74k, False: 864]
  ------------------
  365|  1.74k|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (365:13): [True: 1.74k, False: 0]
  ------------------
  366|  1.74k|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (366:17): [True: 0, False: 1.74k]
  ------------------
  367|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|  1.74k|        } else {
  371|      0|            ctx->keylen = keylen;
  372|      0|        }
  373|  1.74k|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (373:13): [True: 0, False: 1.74k]
  ------------------
  374|      0|            return 0;
  375|  1.74k|        ctx->key_set = 1;
  376|  1.74k|    }
  377|  2.61k|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  378|  2.61k|}

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

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

sha3_prov.c:generic_sha3_absorb:
  151|  42.0k|{
  152|  42.0k|    KECCAK1600_CTX *ctx = vctx;
  153|       |
  154|  42.0k|    if (!(ctx->xof_state == XOF_STATE_INIT ||
  ------------------
  |  |   35|  84.1k|#define XOF_STATE_INIT    0
  ------------------
  |  Branch (154:11): [True: 39.6k, False: 2.43k]
  ------------------
  155|  42.0k|          ctx->xof_state == XOF_STATE_ABSORB))
  ------------------
  |  |   36|  2.43k|#define XOF_STATE_ABSORB  1
  ------------------
  |  Branch (155:11): [True: 2.43k, False: 0]
  ------------------
  156|      0|        return 0;
  157|  42.0k|    ctx->xof_state = XOF_STATE_ABSORB;
  ------------------
  |  |   36|  42.0k|#define XOF_STATE_ABSORB  1
  ------------------
  158|  42.0k|    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
  159|  42.0k|}
sha3_prov.c:keccak_update:
   75|  42.1k|{
   76|  42.1k|    KECCAK1600_CTX *ctx = vctx;
   77|  42.1k|    const size_t bsz = ctx->block_size;
   78|  42.1k|    size_t num, rem;
   79|       |
   80|  42.1k|    if (len == 0)
  ------------------
  |  Branch (80:9): [True: 0, False: 42.1k]
  ------------------
   81|      0|        return 1;
   82|       |
   83|       |    /* Is there anything in the buffer already ? */
   84|  42.1k|    if ((num = ctx->bufsz) != 0) {
  ------------------
  |  Branch (84:9): [True: 2.52k, False: 39.6k]
  ------------------
   85|       |        /* Calculate how much space is left in the buffer */
   86|  2.52k|        rem = bsz - num;
   87|       |        /* If the new input does not fill the buffer then just add it */
   88|  2.52k|        if (len < rem) {
  ------------------
  |  Branch (88:13): [True: 1.30k, False: 1.21k]
  ------------------
   89|  1.30k|            memcpy(ctx->buf + num, inp, len);
   90|  1.30k|            ctx->bufsz += len;
   91|  1.30k|            return 1;
   92|  1.30k|        }
   93|       |        /* otherwise fill up the buffer and absorb the buffer */
   94|  1.21k|        memcpy(ctx->buf + num, inp, rem);
   95|       |        /* Update the input pointer */
   96|  1.21k|        inp += rem;
   97|  1.21k|        len -= rem;
   98|  1.21k|        ctx->meth.absorb(ctx, ctx->buf, bsz);
   99|  1.21k|        ctx->bufsz = 0;
  100|  1.21k|    }
  101|       |    /* Absorb the input - rem = leftover part of the input < blocksize) */
  102|  40.8k|    rem = ctx->meth.absorb(ctx, inp, len);
  103|       |    /* Copy the leftover bit of the input into the buffer */
  104|  40.8k|    if (rem) {
  ------------------
  |  Branch (104:9): [True: 40.5k, False: 270]
  ------------------
  105|  40.5k|        memcpy(ctx->buf, inp + len - rem, rem);
  106|  40.5k|        ctx->bufsz = rem;
  107|  40.5k|    }
  108|  40.8k|    return 1;
  109|  42.1k|}
sha3_prov.c:keccak_freectx:
  559|  2.47k|{
  560|  2.47k|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  561|       |
  562|  2.47k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  113|  2.47k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.47k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.47k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  563|  2.47k|}
sha3_prov.c:keccak_init:
   60|  39.6k|{
   61|  39.6k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (61:9): [True: 0, False: 39.6k]
  ------------------
   62|      0|        return 0;
   63|       |    /* The newctx() handles most of the ctx fixed setup. */
   64|  39.6k|    ossl_sha3_reset((KECCAK1600_CTX *)vctx);
   65|  39.6k|    return 1;
   66|  39.6k|}
sha3_prov.c:shake_128_newctx:
  502|    824|static void *name##_newctx(void *provctx)                                      \
  503|    824|{                                                                              \
  504|    824|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|    824|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    824|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    824|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (504:27): [True: 824, False: 0]
  ------------------
  505|    824|                                                : NULL;                        \
  506|    824|                                                                               \
  507|    824|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (507:9): [True: 0, False: 824]
  ------------------
  508|    824|        return NULL;                                                           \
  509|    824|    ossl_keccak_init(ctx, pad, bitlen, mdlen);                                 \
  510|    824|    if (mdlen == 0)                                                            \
  ------------------
  |  Branch (510:9): [Folded - Ignored]
  ------------------
  511|    824|        ctx->md_size = SIZE_MAX;                                               \
  512|    824|    SHAKE_SET_MD(uname, typ)                                                   \
  ------------------
  |  |  483|    824|# define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
  ------------------
  513|    824|    return ctx;                                                                \
  514|    824|}
sha3_prov.c:generic_sha3_squeeze:
  167|   151k|{
  168|   151k|    return ossl_sha3_squeeze((KECCAK1600_CTX *)vctx, out, outlen);
  169|   151k|}
sha3_prov.c:shake_squeeze:
  132|   151k|{
  133|   151k|    int ret = 1;
  134|   151k|    KECCAK1600_CTX *ctx = vctx;
  135|       |
  136|   151k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (136:9): [True: 0, False: 151k]
  ------------------
  137|      0|        return 0;
  138|   151k|    if (ctx->meth.squeeze == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 151k]
  ------------------
  139|      0|        return 0;
  140|   151k|    if (outlen > 0)
  ------------------
  |  Branch (140:9): [True: 151k, False: 0]
  ------------------
  141|   151k|        ret = ctx->meth.squeeze(ctx, out, outlen);
  142|       |
  143|   151k|    *outl = outlen;
  144|   151k|    return ret;
  145|   151k|}
sha3_prov.c:keccak_init_params:
   69|  39.6k|{
   70|  39.6k|    return keccak_init(vctx, NULL)
  ------------------
  |  Branch (70:12): [True: 39.6k, False: 0]
  ------------------
   71|  39.6k|            && shake_set_ctx_params(vctx, params);
  ------------------
  |  Branch (71:16): [True: 39.6k, False: 0]
  ------------------
   72|  39.6k|}
sha3_prov.c:shake_set_ctx_params:
  632|  39.6k|{
  633|  39.6k|    const OSSL_PARAM *p;
  634|  39.6k|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  635|       |
  636|  39.6k|    if (ctx == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 39.6k]
  ------------------
  637|      0|        return 0;
  638|  39.6k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (638:9): [True: 39.6k, False: 0]
  ------------------
  639|  39.6k|        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_256_newctx:
  502|  1.65k|static void *name##_newctx(void *provctx)                                      \
  503|  1.65k|{                                                                              \
  504|  1.65k|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|  1.65k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.65k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.65k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (504:27): [True: 1.65k, False: 0]
  ------------------
  505|  1.65k|                                                : NULL;                        \
  506|  1.65k|                                                                               \
  507|  1.65k|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (507:9): [True: 0, False: 1.65k]
  ------------------
  508|  1.65k|        return NULL;                                                           \
  509|  1.65k|    ossl_keccak_init(ctx, pad, bitlen, mdlen);                                 \
  510|  1.65k|    if (mdlen == 0)                                                            \
  ------------------
  |  Branch (510:9): [Folded - Ignored]
  ------------------
  511|  1.65k|        ctx->md_size = SIZE_MAX;                                               \
  512|  1.65k|    SHAKE_SET_MD(uname, typ)                                                   \
  ------------------
  |  |  483|  1.65k|# define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
  ------------------
  513|  1.65k|    return ctx;                                                                \
  514|  1.65k|}

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

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

md5_prov.c:md5_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
md5_sha1_prov.c:md5_sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
null_prov.c:nullmd_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
ripemd_prov.c:ripemd160_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha1_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_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_192_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sm3_prov.c:sm3_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}

ossl_prov_ml_dsa_new:
  103|    474|{
  104|    474|    ML_DSA_KEY *key;
  105|       |
  106|    474|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (106:9): [True: 0, False: 474]
  ------------------
  107|      0|        return 0;
  108|       |
  109|    474|    key = ossl_ml_dsa_key_new(PROV_LIBCTX_OF(ctx), propq, evp_type);
  ------------------
  |  |   31|    474|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  110|       |    /*
  111|       |     * When decoding, if the key ends up "loaded" into the same provider, these
  112|       |     * are the correct config settings, otherwise, new values will be assigned
  113|       |     * on import into a different provider.  The "load" API does not pass along
  114|       |     * the provider context.
  115|       |     */
  116|    474|    if (key != NULL) {
  ------------------
  |  Branch (116:9): [True: 474, False: 0]
  ------------------
  117|    474|        int flags_set = 0, flags_clr = 0;
  118|       |
  119|    474|        if (ossl_prov_ctx_get_bool_param(
  ------------------
  |  Branch (119:13): [True: 474, False: 0]
  ------------------
  120|    474|                ctx, OSSL_PKEY_PARAM_ML_DSA_RETAIN_SEED, 1))
  ------------------
  |  |  422|    474|# define OSSL_PKEY_PARAM_ML_DSA_RETAIN_SEED "ml-dsa.retain_seed"
  ------------------
  121|    474|            flags_set |= ML_DSA_KEY_RETAIN_SEED;
  ------------------
  |  |   48|    474|# define ML_DSA_KEY_RETAIN_SEED (1 << 1)
  ------------------
  122|      0|        else
  123|      0|            flags_clr = ML_DSA_KEY_RETAIN_SEED;
  ------------------
  |  |   48|      0|# define ML_DSA_KEY_RETAIN_SEED (1 << 1)
  ------------------
  124|       |
  125|    474|        if (ossl_prov_ctx_get_bool_param(
  ------------------
  |  Branch (125:13): [True: 474, False: 0]
  ------------------
  126|    474|                ctx, OSSL_PKEY_PARAM_ML_DSA_PREFER_SEED, 1))
  ------------------
  |  |  421|    474|# define OSSL_PKEY_PARAM_ML_DSA_PREFER_SEED "ml-dsa.prefer_seed"
  ------------------
  127|    474|            flags_set |= ML_DSA_KEY_PREFER_SEED;
  ------------------
  |  |   47|    474|# define ML_DSA_KEY_PREFER_SEED (1 << 0)
  ------------------
  128|      0|        else
  129|      0|            flags_clr |= ML_DSA_KEY_PREFER_SEED;
  ------------------
  |  |   47|      0|# define ML_DSA_KEY_PREFER_SEED (1 << 0)
  ------------------
  130|       |
  131|    474|        ossl_ml_dsa_set_prekey(key, flags_set, flags_clr, NULL, 0, NULL, 0);
  132|    474|    }
  133|    474|    return key;
  134|    474|}
ml_dsa_kmgmt.c:ml_dsa_44_new_key:
  720|      3|    {                                                                          \
  721|      3|        return ossl_prov_ml_dsa_new(provctx, NULL, EVP_PKEY_ML_DSA_##alg);     \
  722|      3|    }                                                                          \
ml_dsa_kmgmt.c:ml_dsa_free_key:
  137|    474|{
  138|    474|    ossl_ml_dsa_key_free((ML_DSA_KEY *)keydata);
  139|    474|}
ml_dsa_kmgmt.c:ml_dsa_has:
  149|     44|{
  150|     44|    const ML_DSA_KEY *key = keydata;
  151|       |
  152|     44|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 44]
  |  Branch (152:36): [True: 0, False: 44]
  ------------------
  153|      0|        return 0;
  154|     44|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|     44|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|     44|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|     44|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (154:9): [True: 0, False: 44]
  ------------------
  155|      0|        return 1; /* the selection is not missing */
  156|       |
  157|     44|    return ossl_ml_dsa_key_has(key, selection);
  158|     44|}
ml_dsa_kmgmt.c:ml_dsa_match:
  161|     20|{
  162|     20|    const ML_DSA_KEY *key1 = keydata1;
  163|     20|    const ML_DSA_KEY *key2 = keydata2;
  164|       |
  165|     20|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (165:9): [True: 0, False: 20]
  ------------------
  166|      0|        return 0;
  167|     20|    if (key1 == NULL || key2 == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 20]
  |  Branch (167:25): [True: 0, False: 20]
  ------------------
  168|      0|        return 0;
  169|     20|    return ossl_ml_dsa_key_equal(key1, key2, selection);
  170|     20|}
ml_dsa_kmgmt.c:ml_dsa_import:
  316|     30|{
  317|     30|    ML_DSA_KEY *key = keydata;
  318|     30|    int include_priv;
  319|       |
  320|     30|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (320:9): [True: 0, False: 30]
  |  Branch (320:36): [True: 0, False: 30]
  ------------------
  321|      0|        return 0;
  322|       |
  323|     30|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|     30|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|     30|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|     30|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (323:9): [True: 0, False: 30]
  ------------------
  324|      0|        return 0;
  325|       |
  326|     30|    include_priv = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);
  ------------------
  |  |  640|     30|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  327|     30|    return ml_dsa_key_fromdata(key, params, include_priv);
  328|     30|}
ml_dsa_kmgmt.c:ml_dsa_key_fromdata:
  230|     30|{
  231|     30|    const OSSL_PARAM *p = NULL;
  232|     30|    const ML_DSA_PARAMS *key_params = ossl_ml_dsa_key_params(key);
  233|     30|    const uint8_t *pk = NULL, *sk = NULL, *seed = NULL;
  234|     30|    size_t pk_len = 0, sk_len = 0, seed_len = 0;
  235|       |
  236|     47|    for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (236:22): [True: 30, False: 17]
  ------------------
  237|     30|        switch (ml_dsa_key_types_find_pidx(p->key)) {
  238|      0|        default:
  ------------------
  |  Branch (238:9): [True: 0, False: 30]
  ------------------
  239|      0|            break;
  240|       |
  241|     16|        case PIDX_PKEY_PARAM_PUB_KEY:
  ------------------
  |  |  329|     16|#define PIDX_PKEY_PARAM_PUB_KEY 236
  ------------------
  |  Branch (241:9): [True: 16, False: 14]
  ------------------
  242|     16|            if (!OSSL_PARAM_get_octet_string_ptr(p, (const void **)&pk, &pk_len))
  ------------------
  |  Branch (242:17): [True: 0, False: 16]
  ------------------
  243|      0|                return 0;
  244|     16|            if (pk != NULL && pk_len != key_params->pk_len) {
  ------------------
  |  Branch (244:17): [True: 16, False: 0]
  |  Branch (244:31): [True: 11, False: 5]
  ------------------
  245|     11|                ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
  ------------------
  |  |  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)
  ------------------
                              ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
  ------------------
  |  |  118|     11|# define ERR_LIB_PROV            57
  ------------------
                              ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
  ------------------
  |  |   74|     11|# define PROV_R_INVALID_KEY_LENGTH                        105
  ------------------
  246|     11|                               "Invalid %s public key length", key_params->alg);
  247|     11|                return 0;
  248|     11|            }
  249|      5|            break;
  250|       |
  251|       |        /* Private key seed is optional */
  252|      5|        case PIDX_PKEY_PARAM_ML_DSA_SEED:
  ------------------
  |  |  319|      0|#define PIDX_PKEY_PARAM_ML_DSA_SEED 142
  ------------------
  |  Branch (252:9): [True: 0, False: 30]
  ------------------
  253|      0|            if (include_private) {
  ------------------
  |  Branch (253:17): [True: 0, False: 0]
  ------------------
  254|      0|                if (!OSSL_PARAM_get_octet_string_ptr(p, (const void **)&seed,
  ------------------
  |  Branch (254:21): [True: 0, False: 0]
  ------------------
  255|      0|                                                     &seed_len))
  256|      0|                    return 0;
  257|      0|                if (seed != NULL && seed_len != ML_DSA_SEED_BYTES) {
  ------------------
  |  |   21|      0|# define ML_DSA_SEED_BYTES 32
  ------------------
  |  Branch (257:21): [True: 0, False: 0]
  |  Branch (257:37): [True: 0, False: 0]
  ------------------
  258|      0|                    ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SEED_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)
  |  |  ------------------
  ------------------
  259|      0|                    return 0;
  260|      0|                }
  261|      0|            }
  262|      0|            break;
  263|       |
  264|       |        /* Private key is optional */
  265|     14|        case PIDX_PKEY_PARAM_PRIV_KEY:
  ------------------
  |  |  327|     14|#define PIDX_PKEY_PARAM_PRIV_KEY 235
  ------------------
  |  Branch (265:9): [True: 14, False: 16]
  ------------------
  266|     14|            if (include_private) {
  ------------------
  |  Branch (266:17): [True: 14, False: 0]
  ------------------
  267|     14|                if (!OSSL_PARAM_get_octet_string_ptr(p, (const void **)&sk,
  ------------------
  |  Branch (267:21): [True: 0, False: 14]
  ------------------
  268|     14|                                                     &sk_len))
  269|      0|                    return 0;
  270|     14|                if (sk != NULL && sk_len != key_params->sk_len) {
  ------------------
  |  Branch (270:21): [True: 14, False: 0]
  |  Branch (270:35): [True: 2, False: 12]
  ------------------
  271|      2|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
  ------------------
  |  |  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_INVALID_KEY_LENGTH,
  ------------------
  |  |  118|      2|# define ERR_LIB_PROV            57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
  ------------------
  |  |   74|      2|# define PROV_R_INVALID_KEY_LENGTH                        105
  ------------------
  272|      2|                                   "Invalid %s private key length",
  273|      2|                                   key_params->alg);
  274|      2|                    return 0;
  275|      2|                }
  276|     14|            }
  277|     12|            break;
  278|     30|        }
  279|       |
  280|       |    /* The caller MUST specify at least one of seed, private or public keys. */
  281|     17|    if (seed_len == 0 && pk_len == 0 && sk_len == 0) {
  ------------------
  |  Branch (281:9): [True: 17, False: 0]
  |  Branch (281:26): [True: 12, False: 5]
  |  Branch (281:41): [True: 0, False: 12]
  ------------------
  282|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_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)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|       |
  286|     17|    if (seed_len != 0
  ------------------
  |  Branch (286:9): [True: 0, False: 17]
  ------------------
  287|     17|        && (sk_len == 0
  ------------------
  |  Branch (287:13): [True: 0, False: 0]
  ------------------
  288|      0|            || (ossl_ml_dsa_key_get_prov_flags(key) & ML_DSA_KEY_PREFER_SEED))) {
  ------------------
  |  |   47|      0|# define ML_DSA_KEY_PREFER_SEED (1 << 0)
  ------------------
  |  Branch (288:16): [True: 0, False: 0]
  ------------------
  289|      0|        if (!ossl_ml_dsa_set_prekey(key, 0, 0, seed, seed_len, sk, sk_len))
  ------------------
  |  Branch (289:13): [True: 0, False: 0]
  ------------------
  290|      0|            return 0;
  291|      0|        if (!ossl_ml_dsa_generate_key(key)) {
  ------------------
  |  Branch (291:13): [True: 0, False: 0]
  ------------------
  292|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_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)
  |  |  ------------------
  ------------------
  293|      0|            return 0;
  294|      0|        }
  295|     17|    } else if (sk_len > 0) {
  ------------------
  |  Branch (295:16): [True: 12, False: 5]
  ------------------
  296|     12|        if (!ossl_ml_dsa_sk_decode(key, sk, sk_len))
  ------------------
  |  Branch (296:13): [True: 12, False: 0]
  ------------------
  297|     12|            return 0;
  298|     12|    } else if (pk_len > 0) {
  ------------------
  |  Branch (298:16): [True: 5, False: 0]
  ------------------
  299|      5|        if (!ossl_ml_dsa_pk_decode(key, pk, pk_len))
  ------------------
  |  Branch (299:13): [True: 0, False: 5]
  ------------------
  300|      0|            return 0;
  301|      5|    }
  302|       |
  303|       |    /* Error if the supplied public key does not match the generated key */
  304|      5|    if (pk_len == 0
  ------------------
  |  Branch (304:9): [True: 0, False: 5]
  ------------------
  305|      5|        || seed_len + sk_len == 0
  ------------------
  |  Branch (305:12): [True: 5, False: 0]
  ------------------
  306|      5|        || memcmp(ossl_ml_dsa_key_get_pub(key), pk, pk_len) == 0)
  ------------------
  |  Branch (306:12): [True: 0, False: 0]
  ------------------
  307|      5|        return 1;
  308|      0|    ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                  ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
  ------------------
  |  |   73|      0|# define PROV_R_INVALID_KEY                               158
  ------------------
  309|      0|                   "explicit %s public key does not match private",
  310|      0|                   key_params->alg);
  311|      0|    ossl_ml_dsa_key_reset(key);
  312|      0|    return 0;
  313|      5|}
ml_dsa_kmgmt.c:ml_dsa_key_types_find_pidx:
  193|     30|{
  194|     30|    switch(s[0]) {
  195|      0|    default:
  ------------------
  |  Branch (195:5): [True: 0, False: 30]
  ------------------
  196|      0|        break;
  197|     30|    case 'p':
  ------------------
  |  Branch (197:5): [True: 30, False: 0]
  ------------------
  198|     30|        switch(s[1]) {
  199|      0|        default:
  ------------------
  |  Branch (199:9): [True: 0, False: 30]
  ------------------
  200|      0|            break;
  201|     14|        case 'r':
  ------------------
  |  Branch (201:9): [True: 14, False: 16]
  ------------------
  202|     14|            if (strcmp("iv", s + 2) == 0)
  ------------------
  |  Branch (202:17): [True: 14, False: 0]
  ------------------
  203|     14|                return PIDX_PKEY_PARAM_PRIV_KEY;
  ------------------
  |  |  327|     14|#define PIDX_PKEY_PARAM_PRIV_KEY 235
  ------------------
  204|      0|            break;
  205|     16|        case 'u':
  ------------------
  |  Branch (205:9): [True: 16, False: 14]
  ------------------
  206|     16|            if (strcmp("b", s + 2) == 0)
  ------------------
  |  Branch (206:17): [True: 16, False: 0]
  ------------------
  207|     16|                return PIDX_PKEY_PARAM_PUB_KEY;
  ------------------
  |  |  329|     16|#define PIDX_PKEY_PARAM_PUB_KEY 236
  ------------------
  208|     30|        }
  209|      0|        break;
  210|      0|    case 's':
  ------------------
  |  Branch (210:5): [True: 0, False: 30]
  ------------------
  211|      0|        if (strcmp("eed", s + 1) == 0)
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|            return PIDX_PKEY_PARAM_ML_DSA_SEED;
  ------------------
  |  |  319|      0|#define PIDX_PKEY_PARAM_ML_DSA_SEED 142
  ------------------
  213|     30|    }
  214|      0|    return -1;
  215|     30|}
ml_dsa_kmgmt.c:ml_dsa_export:
  527|      4|{
  528|      4|    ML_DSA_KEY *key = keydata;
  529|      4|    OSSL_PARAM params[4];
  530|      4|    const uint8_t *buf;
  531|      4|    int include_private, pnum = 0;
  532|       |
  533|      4|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (533:9): [True: 0, False: 4]
  |  Branch (533:36): [True: 0, False: 4]
  ------------------
  534|      0|        return 0;
  535|       |
  536|      4|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|      4|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|      4|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|      4|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (536:9): [True: 0, False: 4]
  ------------------
  537|      0|        return 0;
  538|       |
  539|      4|    include_private = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);
  ------------------
  |  |  640|      4|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  540|       |
  541|       |    /*
  542|       |     * Note that if the seed is present, both the seed and the private key are
  543|       |     * exported.  The recipient will have a choice.
  544|       |     */
  545|      4|    if (include_private) {
  ------------------
  |  Branch (545:9): [True: 4, False: 0]
  ------------------
  546|      4|        if ((buf = ossl_ml_dsa_key_get_seed(key)) != NULL) {
  ------------------
  |  Branch (546:13): [True: 4, False: 0]
  ------------------
  547|      4|            params[pnum++] = OSSL_PARAM_construct_octet_string
  548|      4|                (OSSL_PKEY_PARAM_ML_DSA_SEED, (void *)buf, ML_DSA_SEED_BYTES);
  ------------------
  |  |  423|      4|# define OSSL_PKEY_PARAM_ML_DSA_SEED "seed"
  ------------------
                              (OSSL_PKEY_PARAM_ML_DSA_SEED, (void *)buf, ML_DSA_SEED_BYTES);
  ------------------
  |  |   21|      4|# define ML_DSA_SEED_BYTES 32
  ------------------
  549|      4|        }
  550|      4|        if ((buf = ossl_ml_dsa_key_get_priv(key)) != NULL) {
  ------------------
  |  Branch (550:13): [True: 4, False: 0]
  ------------------
  551|      4|            params[pnum++] = OSSL_PARAM_construct_octet_string
  552|      4|                (OSSL_PKEY_PARAM_PRIV_KEY, (void *)buf,
  ------------------
  |  |  431|      4|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  553|      4|                 ossl_ml_dsa_key_get_priv_len(key));
  554|      4|        }
  555|      4|    }
  556|      4|    if (((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  641|      4|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (556:9): [True: 4, False: 0]
  ------------------
  557|      4|        && ((buf = ossl_ml_dsa_key_get_pub(key)) != NULL)) {
  ------------------
  |  Branch (557:12): [True: 4, False: 0]
  ------------------
  558|      4|        params[pnum++] = OSSL_PARAM_construct_octet_string
  559|      4|            (OSSL_PKEY_PARAM_PUB_KEY, (void *)buf,
  ------------------
  |  |  433|      4|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  560|      4|             ossl_ml_dsa_key_get_pub_len(key));
  561|      4|    }
  562|      4|    if (pnum == 0)
  ------------------
  |  Branch (562:9): [True: 0, False: 4]
  ------------------
  563|      0|        return 0;
  564|      4|    params[pnum] = OSSL_PARAM_construct_end();
  565|      4|    return param_cb(params, cbarg);
  566|      4|}
ml_dsa_kmgmt.c:ml_dsa_get_params:
  458|    591|{
  459|    591|    ML_DSA_KEY *key = keydata;
  460|    591|    OSSL_PARAM *p;
  461|    591|    const uint8_t *d;
  462|    591|    size_t len;
  463|       |
  464|  2.67k|    for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (464:22): [True: 2.08k, False: 591]
  ------------------
  465|  2.08k|        switch (ml_dsa_get_params_find_pidx(p->key)) {
  466|    142|        default:
  ------------------
  |  Branch (466:9): [True: 142, False: 1.93k]
  ------------------
  467|    142|            break;
  468|       |
  469|    449|        case PIDX_PKEY_PARAM_BITS:
  ------------------
  |  |  256|    449|#define PIDX_PKEY_PARAM_BITS 178
  ------------------
  |  Branch (469:9): [True: 449, False: 1.63k]
  ------------------
  470|    449|            if (!OSSL_PARAM_set_int(p, 8 * ossl_ml_dsa_key_get_pub_len(key)))
  ------------------
  |  Branch (470:17): [True: 0, False: 449]
  ------------------
  471|      0|                return 0;
  472|    449|            break;
  473|       |
  474|    449|        case PIDX_PKEY_PARAM_SECURITY_BITS:
  ------------------
  |  |  383|    449|#define PIDX_PKEY_PARAM_SECURITY_BITS 284
  ------------------
  |  Branch (474:9): [True: 449, False: 1.63k]
  ------------------
  475|    449|            if (!OSSL_PARAM_set_int(p, ossl_ml_dsa_key_get_collision_strength_bits(key)))
  ------------------
  |  Branch (475:17): [True: 0, False: 449]
  ------------------
  476|      0|                return 0;
  477|    449|            break;
  478|       |
  479|    449|        case PIDX_PKEY_PARAM_MAX_SIZE:
  ------------------
  |  |  312|    449|#define PIDX_PKEY_PARAM_MAX_SIZE 222
  ------------------
  |  Branch (479:9): [True: 449, False: 1.63k]
  ------------------
  480|    449|            if (!OSSL_PARAM_set_int(p, ossl_ml_dsa_key_get_sig_len(key)))
  ------------------
  |  Branch (480:17): [True: 0, False: 449]
  ------------------
  481|      0|                return 0;
  482|    449|            break;
  483|       |
  484|    449|        case PIDX_PKEY_PARAM_SECURITY_CATEGORY:
  ------------------
  |  |  384|    449|#define PIDX_PKEY_PARAM_SECURITY_CATEGORY PIDX_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |   23|    449|#define PIDX_ALG_PARAM_SECURITY_CATEGORY 8
  |  |  ------------------
  ------------------
  |  Branch (484:9): [True: 449, False: 1.63k]
  ------------------
  485|    449|            if (!OSSL_PARAM_set_int(p, ossl_ml_dsa_key_get_security_category(key)))
  ------------------
  |  Branch (485:17): [True: 0, False: 449]
  ------------------
  486|      0|                return 0;
  487|    449|            break;
  488|       |
  489|    449|        case PIDX_PKEY_PARAM_ML_DSA_SEED:
  ------------------
  |  |  319|      0|#define PIDX_PKEY_PARAM_ML_DSA_SEED 142
  ------------------
  |  Branch (489:9): [True: 0, False: 2.08k]
  ------------------
  490|      0|            d = ossl_ml_dsa_key_get_seed(key);
  491|      0|            if (d != NULL && !OSSL_PARAM_set_octet_string(p, d, ML_DSA_SEED_BYTES))
  ------------------
  |  |   21|      0|# define ML_DSA_SEED_BYTES 32
  ------------------
  |  Branch (491:17): [True: 0, False: 0]
  |  Branch (491:30): [True: 0, False: 0]
  ------------------
  492|      0|                return 0;
  493|      0|            break;
  494|       |
  495|      0|        case PIDX_PKEY_PARAM_PRIV_KEY:
  ------------------
  |  |  327|      0|#define PIDX_PKEY_PARAM_PRIV_KEY 235
  ------------------
  |  Branch (495:9): [True: 0, False: 2.08k]
  ------------------
  496|      0|            d = ossl_ml_dsa_key_get_priv(key);
  497|      0|            if (d != NULL) {
  ------------------
  |  Branch (497:17): [True: 0, False: 0]
  ------------------
  498|      0|                len = ossl_ml_dsa_key_get_priv_len(key);
  499|      0|                if (!OSSL_PARAM_set_octet_string(p, d, len))
  ------------------
  |  Branch (499:21): [True: 0, False: 0]
  ------------------
  500|      0|                    return 0;
  501|      0|            }
  502|      0|            break;
  503|       |
  504|      0|        case PIDX_PKEY_PARAM_PUB_KEY:
  ------------------
  |  |  329|      0|#define PIDX_PKEY_PARAM_PUB_KEY 236
  ------------------
  |  Branch (504:9): [True: 0, False: 2.08k]
  ------------------
  505|      0|            d = ossl_ml_dsa_key_get_pub(key);
  506|      0|            if (d != NULL) {
  ------------------
  |  Branch (506:17): [True: 0, False: 0]
  ------------------
  507|      0|                len = ossl_ml_dsa_key_get_pub_len(key);
  508|      0|                if (!OSSL_PARAM_set_octet_string(p, d, len))
  ------------------
  |  Branch (508:21): [True: 0, False: 0]
  ------------------
  509|      0|                    return 0;
  510|      0|            }
  511|      0|            break;
  512|       |
  513|       |        /*
  514|       |         * This allows apps to use an empty digest, so that the old API
  515|       |         * for digest signing can be used.
  516|       |         */
  517|    142|        case PIDX_PKEY_PARAM_MANDATORY_DIGEST:
  ------------------
  |  |  310|    142|#define PIDX_PKEY_PARAM_MANDATORY_DIGEST 220
  ------------------
  |  Branch (517:9): [True: 142, False: 1.93k]
  ------------------
  518|    142|            if (!OSSL_PARAM_set_utf8_string(p, ""))
  ------------------
  |  Branch (518:17): [True: 0, False: 142]
  ------------------
  519|      0|                return 0;
  520|    142|            break;
  521|  2.08k|        }
  522|    591|    return 1;
  523|    591|}
ml_dsa_kmgmt.c:ml_dsa_get_params_find_pidx:
  351|  2.08k|{
  352|  2.08k|    switch(s[0]) {
  353|    142|    default:
  ------------------
  |  Branch (353:5): [True: 142, False: 1.93k]
  ------------------
  354|    142|        break;
  355|    449|    case 'b':
  ------------------
  |  Branch (355:5): [True: 449, False: 1.63k]
  ------------------
  356|    449|        if (strcmp("its", s + 1) == 0)
  ------------------
  |  Branch (356:13): [True: 449, False: 0]
  ------------------
  357|    449|            return PIDX_PKEY_PARAM_BITS;
  ------------------
  |  |  256|    449|#define PIDX_PKEY_PARAM_BITS 178
  ------------------
  358|      0|        break;
  359|    591|    case 'm':
  ------------------
  |  Branch (359:5): [True: 591, False: 1.48k]
  ------------------
  360|    591|        switch(s[1]) {
  361|      0|        default:
  ------------------
  |  Branch (361:9): [True: 0, False: 591]
  ------------------
  362|      0|            break;
  363|    591|        case 'a':
  ------------------
  |  Branch (363:9): [True: 591, False: 0]
  ------------------
  364|    591|            switch(s[2]) {
  365|      0|            default:
  ------------------
  |  Branch (365:13): [True: 0, False: 591]
  ------------------
  366|      0|                break;
  367|    142|            case 'n':
  ------------------
  |  Branch (367:13): [True: 142, False: 449]
  ------------------
  368|    142|                if (strcmp("datory-digest", s + 3) == 0)
  ------------------
  |  Branch (368:21): [True: 142, False: 0]
  ------------------
  369|    142|                    return PIDX_PKEY_PARAM_MANDATORY_DIGEST;
  ------------------
  |  |  310|    142|#define PIDX_PKEY_PARAM_MANDATORY_DIGEST 220
  ------------------
  370|      0|                break;
  371|    449|            case 'x':
  ------------------
  |  Branch (371:13): [True: 449, False: 142]
  ------------------
  372|    449|                if (strcmp("-size", s + 3) == 0)
  ------------------
  |  Branch (372:21): [True: 449, False: 0]
  ------------------
  373|    449|                    return PIDX_PKEY_PARAM_MAX_SIZE;
  ------------------
  |  |  312|    449|#define PIDX_PKEY_PARAM_MAX_SIZE 222
  ------------------
  374|    591|            }
  375|    591|        }
  376|      0|        break;
  377|      0|    case 'p':
  ------------------
  |  Branch (377:5): [True: 0, False: 2.08k]
  ------------------
  378|      0|        switch(s[1]) {
  379|      0|        default:
  ------------------
  |  Branch (379:9): [True: 0, False: 0]
  ------------------
  380|      0|            break;
  381|      0|        case 'r':
  ------------------
  |  Branch (381:9): [True: 0, False: 0]
  ------------------
  382|      0|            if (strcmp("iv", s + 2) == 0)
  ------------------
  |  Branch (382:17): [True: 0, False: 0]
  ------------------
  383|      0|                return PIDX_PKEY_PARAM_PRIV_KEY;
  ------------------
  |  |  327|      0|#define PIDX_PKEY_PARAM_PRIV_KEY 235
  ------------------
  384|      0|            break;
  385|      0|        case 'u':
  ------------------
  |  Branch (385:9): [True: 0, False: 0]
  ------------------
  386|      0|            if (strcmp("b", s + 2) == 0)
  ------------------
  |  Branch (386:17): [True: 0, False: 0]
  ------------------
  387|      0|                return PIDX_PKEY_PARAM_PUB_KEY;
  ------------------
  |  |  329|      0|#define PIDX_PKEY_PARAM_PUB_KEY 236
  ------------------
  388|      0|        }
  389|      0|        break;
  390|    898|    case 's':
  ------------------
  |  Branch (390:5): [True: 898, False: 1.18k]
  ------------------
  391|    898|        switch(s[1]) {
  392|      0|        default:
  ------------------
  |  Branch (392:9): [True: 0, False: 898]
  ------------------
  393|      0|            break;
  394|    898|        case 'e':
  ------------------
  |  Branch (394:9): [True: 898, False: 0]
  ------------------
  395|    898|            switch(s[2]) {
  396|      0|            default:
  ------------------
  |  Branch (396:13): [True: 0, False: 898]
  ------------------
  397|      0|                break;
  398|    898|            case 'c':
  ------------------
  |  Branch (398:13): [True: 898, False: 0]
  ------------------
  399|    898|                switch(s[3]) {
  400|      0|                default:
  ------------------
  |  Branch (400:17): [True: 0, False: 898]
  ------------------
  401|      0|                    break;
  402|    898|                case 'u':
  ------------------
  |  Branch (402:17): [True: 898, False: 0]
  ------------------
  403|    898|                    switch(s[4]) {
  404|      0|                    default:
  ------------------
  |  Branch (404:21): [True: 0, False: 898]
  ------------------
  405|      0|                        break;
  406|    898|                    case 'r':
  ------------------
  |  Branch (406:21): [True: 898, False: 0]
  ------------------
  407|    898|                        switch(s[5]) {
  408|      0|                        default:
  ------------------
  |  Branch (408:25): [True: 0, False: 898]
  ------------------
  409|      0|                            break;
  410|    898|                        case 'i':
  ------------------
  |  Branch (410:25): [True: 898, False: 0]
  ------------------
  411|    898|                            switch(s[6]) {
  412|      0|                            default:
  ------------------
  |  Branch (412:29): [True: 0, False: 898]
  ------------------
  413|      0|                                break;
  414|    898|                            case 't':
  ------------------
  |  Branch (414:29): [True: 898, False: 0]
  ------------------
  415|    898|                                switch(s[7]) {
  416|      0|                                default:
  ------------------
  |  Branch (416:33): [True: 0, False: 898]
  ------------------
  417|      0|                                    break;
  418|    898|                                case 'y':
  ------------------
  |  Branch (418:33): [True: 898, False: 0]
  ------------------
  419|    898|                                    switch(s[8]) {
  420|      0|                                    default:
  ------------------
  |  Branch (420:37): [True: 0, False: 898]
  ------------------
  421|      0|                                        break;
  422|    898|                                    case '-':
  ------------------
  |  Branch (422:37): [True: 898, False: 0]
  ------------------
  423|    898|                                        switch(s[9]) {
  424|      0|                                        default:
  ------------------
  |  Branch (424:41): [True: 0, False: 898]
  ------------------
  425|      0|                                            break;
  426|    449|                                        case 'b':
  ------------------
  |  Branch (426:41): [True: 449, False: 449]
  ------------------
  427|    449|                                            if (strcmp("its", s + 10) == 0)
  ------------------
  |  Branch (427:49): [True: 449, False: 0]
  ------------------
  428|    449|                                                return PIDX_PKEY_PARAM_SECURITY_BITS;
  ------------------
  |  |  383|    449|#define PIDX_PKEY_PARAM_SECURITY_BITS 284
  ------------------
  429|      0|                                            break;
  430|    449|                                        case 'c':
  ------------------
  |  Branch (430:41): [True: 449, False: 449]
  ------------------
  431|    449|                                            if (strcmp("ategory", s + 10) == 0)
  ------------------
  |  Branch (431:49): [True: 449, False: 0]
  ------------------
  432|    449|                                                return PIDX_PKEY_PARAM_SECURITY_CATEGORY;
  ------------------
  |  |  384|    449|#define PIDX_PKEY_PARAM_SECURITY_CATEGORY PIDX_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |   23|    449|#define PIDX_ALG_PARAM_SECURITY_CATEGORY 8
  |  |  ------------------
  ------------------
  433|    898|                                        }
  434|    898|                                    }
  435|    898|                                }
  436|    898|                            }
  437|    898|                        }
  438|    898|                    }
  439|    898|                }
  440|      0|                break;
  441|      0|            case 'e':
  ------------------
  |  Branch (441:13): [True: 0, False: 898]
  ------------------
  442|      0|                if (strcmp("d", s + 3) == 0)
  ------------------
  |  Branch (442:21): [True: 0, False: 0]
  ------------------
  443|      0|                    return PIDX_PKEY_PARAM_ML_DSA_SEED;
  ------------------
  |  |  319|      0|#define PIDX_PKEY_PARAM_ML_DSA_SEED 142
  ------------------
  444|    898|            }
  445|    898|        }
  446|  2.08k|    }
  447|    142|    return -1;
  448|  2.08k|}
ml_dsa_kmgmt.c:ml_dsa_gen_init:
  611|    444|{
  612|    444|    struct ml_dsa_gen_ctx *gctx = NULL;
  613|       |
  614|    444|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (614:9): [True: 0, False: 444]
  ------------------
  615|      0|        return NULL;
  616|       |
  617|    444|    if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
  ------------------
  |  |  104|    444|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (617:9): [True: 444, False: 0]
  ------------------
  618|    444|        gctx->provctx = provctx;
  619|    444|        if (!ml_dsa_gen_set_params(gctx, params)) {
  ------------------
  |  Branch (619:13): [True: 0, False: 444]
  ------------------
  620|      0|            OPENSSL_free(gctx);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  621|      0|            gctx = NULL;
  622|      0|        }
  623|    444|    }
  624|    444|    return gctx;
  625|    444|}
ml_dsa_kmgmt.c:ml_dsa_44_gen:
  724|    176|    {                                                                          \
  725|    176|        return ml_dsa_gen(genctx, EVP_PKEY_ML_DSA_##alg);                      \
  726|    176|    }                                                                          \
ml_dsa_kmgmt.c:ml_dsa_gen:
  628|    444|{
  629|    444|    struct ml_dsa_gen_ctx *gctx = genctx;
  630|    444|    ML_DSA_KEY *key = NULL;
  631|       |
  632|    444|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (632:9): [True: 0, False: 444]
  ------------------
  633|      0|        return NULL;
  634|    444|    key = ossl_prov_ml_dsa_new(gctx->provctx, gctx->propq, evp_type);
  635|    444|    if (key == NULL)
  ------------------
  |  Branch (635:9): [True: 0, False: 444]
  ------------------
  636|      0|        return NULL;
  637|    444|    if (gctx->entropy_len != 0
  ------------------
  |  Branch (637:9): [True: 0, False: 444]
  ------------------
  638|    444|        && !ossl_ml_dsa_set_prekey(key, 0, 0,
  ------------------
  |  Branch (638:12): [True: 0, False: 0]
  ------------------
  639|      0|                                   gctx->entropy, gctx->entropy_len, NULL, 0))
  640|      0|        goto err;
  641|    444|    if (!ossl_ml_dsa_generate_key(key)) {
  ------------------
  |  Branch (641:9): [True: 0, False: 444]
  ------------------
  642|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_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)
  |  |  ------------------
  ------------------
  643|      0|        goto err;
  644|      0|    }
  645|       |#ifdef FIPS_MODULE
  646|       |    if (!ml_dsa_pairwise_test(key)) {
  647|       |        ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
  648|       |        goto err;
  649|       |    }
  650|       |#endif
  651|    444|    return key;
  652|      0| err:
  653|      0|    ossl_ml_dsa_key_free(key);
  654|      0|    return NULL;
  655|    444|}
ml_dsa_kmgmt.c:ml_dsa_gen_cleanup:
  698|    444|{
  699|    444|    struct ml_dsa_gen_ctx *gctx = genctx;
  700|       |
  701|    444|    if (gctx == NULL)
  ------------------
  |  Branch (701:9): [True: 0, False: 444]
  ------------------
  702|      0|        return;
  703|       |
  704|    444|    OPENSSL_cleanse(gctx->entropy, gctx->entropy_len);
  705|    444|    OPENSSL_free(gctx->propq);
  ------------------
  |  |  115|    444|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  706|    444|    OPENSSL_free(gctx);
  ------------------
  |  |  115|    444|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    444|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    444|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  707|    444|}
ml_dsa_kmgmt.c:ml_dsa_gen_set_params:
  658|    444|{
  659|    444|    struct ml_dsa_gen_ctx *gctx = genctx;
  660|    444|    const OSSL_PARAM *p;
  661|       |
  662|    444|    if (gctx == NULL)
  ------------------
  |  Branch (662:9): [True: 0, False: 444]
  ------------------
  663|      0|        return 0;
  664|       |
  665|    444|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ML_DSA_SEED);
  ------------------
  |  |  423|    444|# define OSSL_PKEY_PARAM_ML_DSA_SEED "seed"
  ------------------
  666|    444|    if (p != NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 444]
  ------------------
  667|      0|        void *vp = gctx->entropy;
  668|      0|        size_t len = sizeof(gctx->entropy);
  669|       |
  670|      0|        if (!OSSL_PARAM_get_octet_string(p, &vp, len, &(gctx->entropy_len))) {
  ------------------
  |  Branch (670:13): [True: 0, False: 0]
  ------------------
  671|      0|            gctx->entropy_len = 0;
  672|      0|            return 0;
  673|      0|        }
  674|      0|    }
  675|       |
  676|    444|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
  ------------------
  |  |  432|    444|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|    444|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  677|    444|    if (p != NULL) {
  ------------------
  |  Branch (677:9): [True: 0, False: 444]
  ------------------
  678|      0|        OPENSSL_free(gctx->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__
  |  |  ------------------
  ------------------
  679|      0|        gctx->propq = NULL;
  680|      0|        if (!OSSL_PARAM_get_utf8_string(p, &gctx->propq, 0))
  ------------------
  |  Branch (680:13): [True: 0, False: 0]
  ------------------
  681|      0|            return 0;
  682|      0|    }
  683|    444|    return 1;
  684|    444|}
ml_dsa_kmgmt.c:ml_dsa_65_new_key:
  720|     10|    {                                                                          \
  721|     10|        return ossl_prov_ml_dsa_new(provctx, NULL, EVP_PKEY_ML_DSA_##alg);     \
  722|     10|    }                                                                          \
ml_dsa_kmgmt.c:ml_dsa_65_gen:
  724|    126|    {                                                                          \
  725|    126|        return ml_dsa_gen(genctx, EVP_PKEY_ML_DSA_##alg);                      \
  726|    126|    }                                                                          \
ml_dsa_kmgmt.c:ml_dsa_87_new_key:
  720|     17|    {                                                                          \
  721|     17|        return ossl_prov_ml_dsa_new(provctx, NULL, EVP_PKEY_ML_DSA_##alg);     \
  722|     17|    }                                                                          \
ml_dsa_kmgmt.c:ml_dsa_87_gen:
  724|    142|    {                                                                          \
  725|    142|        return ml_dsa_gen(genctx, EVP_PKEY_ML_DSA_##alg);                      \
  726|    142|    }                                                                          \

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

drbg_ctr.c:drbg_ctr_new_wrapper:
  640|      3|{
  641|      3|    return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
  642|      3|                              &drbg_ctr_new, &drbg_ctr_free,
  643|      3|                              &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
  644|      3|                              &drbg_ctr_reseed, &drbg_ctr_generate);
  645|      3|}
drbg_ctr.c:drbg_ctr_new:
  625|      3|{
  626|      3|    PROV_DRBG_CTR *ctr;
  627|       |
  628|      3|    ctr = OPENSSL_secure_zalloc(sizeof(*ctr));
  ------------------
  |  |  125|      3|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  629|      3|    if (ctr == NULL)
  ------------------
  |  Branch (629:9): [True: 0, False: 3]
  ------------------
  630|      0|        return 0;
  631|       |
  632|      3|    ctr->use_df = 1;
  633|      3|    drbg->data = ctr;
  634|      3|    OSSL_FIPS_IND_INIT(drbg)
  635|      3|    return drbg_ctr_init_lengths(drbg);
  636|      3|}
drbg_ctr.c:drbg_ctr_init_lengths:
  531|      6|{
  532|      6|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  533|      6|    int res = 1;
  534|       |
  535|       |    /* Maximum number of bits per request = 2^19  = 2^16 bytes */
  536|      6|    drbg->max_request = 1 << 16;
  537|      6|    if (ctr->use_df) {
  ------------------
  |  Branch (537:9): [True: 6, False: 0]
  ------------------
  538|      6|        drbg->min_entropylen = 0;
  539|      6|        drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  540|      6|        drbg->min_noncelen = 0;
  541|      6|        drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  542|      6|        drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  543|      6|        drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  544|       |
  545|      6|        if (ctr->keylen > 0) {
  ------------------
  |  Branch (545:13): [True: 3, False: 3]
  ------------------
  546|      3|            drbg->min_entropylen = ctr->keylen;
  547|      3|            drbg->min_noncelen = drbg->min_entropylen / 2;
  548|      3|        }
  549|      6|    } else {
  550|      0|        const size_t len = ctr->keylen > 0 ? drbg->seedlen : DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      0|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  |  Branch (550:28): [True: 0, False: 0]
  ------------------
  551|       |
  552|      0|        drbg->min_entropylen = len;
  553|      0|        drbg->max_entropylen = len;
  554|       |        /* Nonce not used */
  555|      0|        drbg->min_noncelen = 0;
  556|      0|        drbg->max_noncelen = 0;
  557|      0|        drbg->max_perslen = len;
  558|      0|        drbg->max_adinlen = len;
  559|      0|    }
  560|      6|    return res;
  561|      6|}
drbg_ctr.c:drbg_ctr_instantiate:
  317|      3|{
  318|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  319|       |
  320|      3|    if (entropy == NULL)
  ------------------
  |  Branch (320:9): [True: 0, False: 3]
  ------------------
  321|      0|        return 0;
  322|       |
  323|      3|    memset(ctr->K, 0, sizeof(ctr->K));
  324|      3|    memset(ctr->V, 0, sizeof(ctr->V));
  325|      3|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (325:9): [True: 0, False: 3]
  ------------------
  326|      0|        return 0;
  327|       |
  328|      3|    inc_128(ctr);
  329|      3|    if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen))
  ------------------
  |  Branch (329:9): [True: 0, False: 3]
  ------------------
  330|      0|        return 0;
  331|      3|    return 1;
  332|      3|}
drbg_ctr.c:inc_128:
   65|  2.60k|{
   66|  2.60k|    unsigned char *p = &ctr->V[0];
   67|  2.60k|    u32 n = 16, c = 1;
   68|       |
   69|  41.6k|    do {
   70|  41.6k|        --n;
   71|  41.6k|        c += p[n];
   72|  41.6k|        p[n] = (u8)c;
   73|  41.6k|        c >>= 8;
   74|  41.6k|    } while (n);
  ------------------
  |  Branch (74:14): [True: 39.0k, False: 2.60k]
  ------------------
   75|  2.60k|}
drbg_ctr.c:ctr_update:
  271|    867|{
  272|    867|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  273|    867|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|    867|# define AES_BLOCK_SIZE 16
  ------------------
  274|    867|    unsigned char V_tmp[48], out[48];
  275|    867|    unsigned char len;
  276|       |
  277|       |    /* correct key is already set up. */
  278|    867|    memcpy(V_tmp, ctr->V, 16);
  279|    867|    inc_128(ctr);
  280|    867|    memcpy(V_tmp + 16, ctr->V, 16);
  281|    867|    if (ctr->keylen == 16) {
  ------------------
  |  Branch (281:9): [True: 0, False: 867]
  ------------------
  282|      0|        len = 32;
  283|    867|    } else {
  284|    867|        inc_128(ctr);
  285|    867|        memcpy(V_tmp + 32, ctr->V, 16);
  286|    867|        len = 48;
  287|    867|    }
  288|    867|    if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len)
  ------------------
  |  Branch (288:9): [True: 0, False: 867]
  ------------------
  289|    867|            || outlen != len)
  ------------------
  |  Branch (289:16): [True: 0, False: 867]
  ------------------
  290|      0|        return 0;
  291|    867|    memcpy(ctr->K, out, ctr->keylen);
  292|    867|    memcpy(ctr->V, out + ctr->keylen, 16);
  293|       |
  294|    867|    if (ctr->use_df) {
  ------------------
  |  Branch (294:9): [True: 867, False: 0]
  ------------------
  295|       |        /* If no input reuse existing derived value */
  296|    867|        if (in1 != NULL || nonce != NULL || in2 != NULL)
  ------------------
  |  Branch (296:13): [True: 9, False: 858]
  |  Branch (296:28): [True: 0, False: 858]
  |  Branch (296:45): [True: 0, False: 858]
  ------------------
  297|      9|            if (!ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len))
  ------------------
  |  Branch (297:17): [True: 0, False: 9]
  ------------------
  298|      0|                return 0;
  299|       |        /* If this a reuse input in1len != 0 */
  300|    867|        if (in1len)
  ------------------
  |  Branch (300:13): [True: 13, False: 854]
  ------------------
  301|     13|            ctr_XOR(ctr, ctr->KX, drbg->seedlen);
  302|    867|    } else {
  303|      0|        ctr_XOR(ctr, in1, in1len);
  304|      0|        ctr_XOR(ctr, in2, in2len);
  305|      0|    }
  306|       |
  307|    867|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)
  ------------------
  |  Branch (307:9): [True: 0, False: 867]
  ------------------
  308|    867|        || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (308:12): [True: 0, False: 867]
  ------------------
  309|      0|        return 0;
  310|    867|    return 1;
  311|    867|}
drbg_ctr.c:ctr_df:
  208|      9|{
  209|      9|    static unsigned char c80 = 0x80;
  210|      9|    size_t inlen;
  211|      9|    unsigned char *p = ctr->bltmp;
  212|      9|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  213|       |
  214|      9|    if (!ctr_BCC_init(ctr))
  ------------------
  |  Branch (214:9): [True: 0, False: 9]
  ------------------
  215|      0|        return 0;
  216|      9|    if (in1 == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 9]
  ------------------
  217|      0|        in1len = 0;
  218|      9|    if (in2 == NULL)
  ------------------
  |  Branch (218:9): [True: 9, False: 0]
  ------------------
  219|      9|        in2len = 0;
  220|      9|    if (in3 == NULL)
  ------------------
  |  Branch (220:9): [True: 6, False: 3]
  ------------------
  221|      6|        in3len = 0;
  222|      9|    inlen = in1len + in2len + in3len;
  223|       |    /* Initialise L||N in temporary block */
  224|      9|    *p++ = (inlen >> 24) & 0xff;
  225|      9|    *p++ = (inlen >> 16) & 0xff;
  226|      9|    *p++ = (inlen >> 8) & 0xff;
  227|      9|    *p++ = inlen & 0xff;
  228|       |
  229|       |    /* NB keylen is at most 32 bytes */
  230|      9|    *p++ = 0;
  231|      9|    *p++ = 0;
  232|      9|    *p++ = 0;
  233|      9|    *p = (unsigned char)((ctr->keylen + 16) & 0xff);
  234|      9|    ctr->bltmp_pos = 8;
  235|      9|    if (!ctr_BCC_update(ctr, in1, in1len)
  ------------------
  |  Branch (235:9): [True: 0, False: 9]
  ------------------
  236|      9|        || !ctr_BCC_update(ctr, in2, in2len)
  ------------------
  |  Branch (236:12): [True: 0, False: 9]
  ------------------
  237|      9|        || !ctr_BCC_update(ctr, in3, in3len)
  ------------------
  |  Branch (237:12): [True: 0, False: 9]
  ------------------
  238|      9|        || !ctr_BCC_update(ctr, &c80, 1)
  ------------------
  |  Branch (238:12): [True: 0, False: 9]
  ------------------
  239|      9|        || !ctr_BCC_final(ctr))
  ------------------
  |  Branch (239:12): [True: 0, False: 9]
  ------------------
  240|      0|        return 0;
  241|       |    /* Set up key K */
  242|      9|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->KX, NULL, -1))
  ------------------
  |  Branch (242:9): [True: 0, False: 9]
  ------------------
  243|      0|        return 0;
  244|       |    /* X follows key K */
  245|      9|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX, &outlen, ctr->KX + ctr->keylen,
  ------------------
  |  Branch (245:9): [True: 0, False: 9]
  ------------------
  246|      9|                          AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  247|      9|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (247:12): [True: 0, False: 9]
  ------------------
  248|      0|        return 0;
  249|      9|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 16, &outlen, ctr->KX,
  ------------------
  |  Branch (249:9): [True: 0, False: 9]
  ------------------
  250|      9|                          AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  251|      9|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (251:12): [True: 0, False: 9]
  ------------------
  252|      0|        return 0;
  253|      9|    if (ctr->keylen != 16)
  ------------------
  |  Branch (253:9): [True: 9, False: 0]
  ------------------
  254|      9|        if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 32, &outlen,
  ------------------
  |  Branch (254:13): [True: 0, False: 9]
  ------------------
  255|      9|                              ctr->KX + 16, AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  256|      9|            || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (256:16): [True: 0, False: 9]
  ------------------
  257|      0|            return 0;
  258|      9|    return 1;
  259|      9|}
drbg_ctr.c:ctr_BCC_init:
  145|      9|{
  146|      9|    unsigned char bltmp[48] = {0};
  147|      9|    unsigned char num_of_blk;
  148|       |
  149|      9|    memset(ctr->KX, 0, 48);
  150|      9|    num_of_blk = ctr->keylen == 16 ? 2 : 3;
  ------------------
  |  Branch (150:18): [True: 0, False: 9]
  ------------------
  151|      9|    bltmp[(AES_BLOCK_SIZE * 1) + 3] = 1;
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  152|      9|    bltmp[(AES_BLOCK_SIZE * 2) + 3] = 2;
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  153|      9|    return ctr_BCC_block(ctr, ctr->KX, bltmp, num_of_blk * AES_BLOCK_SIZE);
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  154|      9|}
drbg_ctr.c:ctr_BCC_block:
  110|     41|{
  111|     41|    int i, outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|     41|# define AES_BLOCK_SIZE 16
  ------------------
  112|       |
  113|  2.00k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (113:17): [True: 1.96k, False: 41]
  ------------------
  114|  1.96k|        out[i] ^= in[i];
  115|       |
  116|     41|    if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, len)
  ------------------
  |  Branch (116:9): [True: 0, False: 41]
  ------------------
  117|     41|        || outlen != len)
  ------------------
  |  Branch (117:12): [True: 0, False: 41]
  ------------------
  118|      0|        return 0;
  119|     41|    return 1;
  120|     41|}
drbg_ctr.c:ctr_BCC_update:
  161|     36|{
  162|     36|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (162:9): [True: 15, False: 21]
  |  Branch (162:23): [True: 0, False: 21]
  ------------------
  163|     15|        return 1;
  164|       |
  165|       |    /* If we have partial block handle it first */
  166|     21|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (166:9): [True: 17, False: 4]
  ------------------
  167|     17|        size_t left = 16 - ctr->bltmp_pos;
  168|       |
  169|       |        /* If we now have a complete block process it */
  170|     17|        if (inlen >= left) {
  ------------------
  |  Branch (170:13): [True: 12, False: 5]
  ------------------
  171|     12|            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
  172|     12|            if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (172:17): [True: 0, False: 12]
  ------------------
  173|      0|                return 0;
  174|     12|            ctr->bltmp_pos = 0;
  175|     12|            inlen -= left;
  176|     12|            in += left;
  177|     12|        }
  178|     17|    }
  179|       |
  180|       |    /* Process zero or more complete blocks */
  181|     32|    for (; inlen >= 16; in += 16, inlen -= 16) {
  ------------------
  |  Branch (181:12): [True: 11, False: 21]
  ------------------
  182|     11|        if (!ctr_BCC_blocks(ctr, in))
  ------------------
  |  Branch (182:13): [True: 0, False: 11]
  ------------------
  183|      0|            return 0;
  184|     11|    }
  185|       |
  186|       |    /* Copy any remaining partial block to the temporary buffer */
  187|     21|    if (inlen > 0) {
  ------------------
  |  Branch (187:9): [True: 17, False: 4]
  ------------------
  188|     17|        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
  189|     17|        ctr->bltmp_pos += inlen;
  190|     17|    }
  191|     21|    return 1;
  192|     21|}
drbg_ctr.c:ctr_BCC_blocks:
  127|     32|{
  128|     32|    unsigned char in_tmp[48];
  129|     32|    unsigned char num_of_blk = 2;
  130|       |
  131|     32|    memcpy(in_tmp, in, 16);
  132|     32|    memcpy(in_tmp + 16, in, 16);
  133|     32|    if (ctr->keylen != 16) {
  ------------------
  |  Branch (133:9): [True: 32, False: 0]
  ------------------
  134|     32|        memcpy(in_tmp + 32, in, 16);
  135|     32|        num_of_blk = 3;
  136|     32|    }
  137|     32|    return ctr_BCC_block(ctr, ctr->KX, in_tmp, AES_BLOCK_SIZE * num_of_blk);
  ------------------
  |  |   26|     32|# define AES_BLOCK_SIZE 16
  ------------------
  138|     32|}
drbg_ctr.c:ctr_BCC_final:
  195|      9|{
  196|      9|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (196:9): [True: 9, False: 0]
  ------------------
  197|      9|        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
  198|      9|        if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (198:13): [True: 0, False: 9]
  ------------------
  199|      0|            return 0;
  200|      9|    }
  201|      9|    return 1;
  202|      9|}
drbg_ctr.c:ctr_XOR:
   78|     13|{
   79|     13|    size_t i, n;
   80|       |
   81|     13|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (81:9): [True: 0, False: 13]
  |  Branch (81:23): [True: 0, False: 13]
  ------------------
   82|      0|        return;
   83|       |
   84|       |    /*
   85|       |     * Any zero padding will have no effect on the result as we
   86|       |     * are XORing. So just process however much input we have.
   87|       |     */
   88|     13|    n = inlen < ctr->keylen ? inlen : ctr->keylen;
  ------------------
  |  Branch (88:9): [True: 0, False: 13]
  ------------------
   89|     13|    if (!ossl_assert(n <= sizeof(ctr->K)))
  ------------------
  |  |   52|     13|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     13|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (89:9): [True: 0, False: 13]
  ------------------
   90|      0|        return;
   91|    429|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (91:17): [True: 416, False: 13]
  ------------------
   92|    416|        ctr->K[i] ^= in[i];
   93|     13|    if (inlen <= ctr->keylen)
  ------------------
  |  Branch (93:9): [True: 0, False: 13]
  ------------------
   94|      0|        return;
   95|       |
   96|     13|    n = inlen - ctr->keylen;
   97|     13|    if (n > 16) {
  ------------------
  |  Branch (97:9): [True: 0, False: 13]
  ------------------
   98|       |        /* Should never happen */
   99|      0|        n = 16;
  100|      0|    }
  101|    221|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (101:17): [True: 208, False: 13]
  ------------------
  102|    208|        ctr->V[i] ^= in[i + ctr->keylen];
  103|     13|}
drbg_ctr.c:drbg_ctr_reseed:
  360|      2|{
  361|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  362|       |
  363|      2|    if (entropy == NULL)
  ------------------
  |  Branch (363:9): [True: 0, False: 2]
  ------------------
  364|      0|        return 0;
  365|       |
  366|      2|    inc_128(ctr);
  367|      2|    if (!ctr_update(drbg, entropy, entropylen, adin, adinlen, NULL, 0))
  ------------------
  |  Branch (367:9): [True: 0, False: 2]
  ------------------
  368|      0|        return 0;
  369|      2|    return 1;
  370|      2|}
drbg_ctr.c:drbg_ctr_generate:
  397|    858|{
  398|    858|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  399|    858|    unsigned int ctr32, blocks;
  400|    858|    int outl, buflen;
  401|       |
  402|    858|    if (adin != NULL && adinlen != 0) {
  ------------------
  |  Branch (402:9): [True: 4, False: 854]
  |  Branch (402:25): [True: 4, False: 0]
  ------------------
  403|      4|        inc_128(ctr);
  404|       |
  405|      4|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (405:13): [True: 0, False: 4]
  ------------------
  406|      0|            return 0;
  407|       |        /* This means we reuse derived value */
  408|      4|        if (ctr->use_df) {
  ------------------
  |  Branch (408:13): [True: 4, False: 0]
  ------------------
  409|      4|            adin = NULL;
  410|      4|            adinlen = 1;
  411|      4|        }
  412|    854|    } else {
  413|    854|        adinlen = 0;
  414|    854|    }
  415|       |
  416|    858|    inc_128(ctr);
  417|       |
  418|    858|    if (outlen == 0) {
  ------------------
  |  Branch (418:9): [True: 0, False: 858]
  ------------------
  419|      0|        inc_128(ctr);
  420|       |
  421|      0|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (421:13): [True: 0, False: 0]
  ------------------
  422|      0|            return 0;
  423|      0|        return 1;
  424|      0|    }
  425|       |
  426|    858|    memset(out, 0, outlen);
  427|       |
  428|    858|    do {
  429|    858|        if (!EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (429:13): [True: 0, False: 858]
  ------------------
  430|    858|                               NULL, NULL, NULL, ctr->V, -1))
  431|      0|            return 0;
  432|       |
  433|       |        /*-
  434|       |         * outlen has type size_t while EVP_CipherUpdate takes an
  435|       |         * int argument and thus cannot be guaranteed to process more
  436|       |         * than 2^31-1 bytes at a time. We process such huge generate
  437|       |         * requests in 2^30 byte chunks, which is the greatest multiple
  438|       |         * of AES block size lower than or equal to 2^31-1.
  439|       |         */
  440|    858|        buflen = outlen > (1U << 30) ? (1U << 30) : outlen;
  ------------------
  |  Branch (440:18): [True: 0, False: 858]
  ------------------
  441|    858|        blocks = (buflen + 15) / 16;
  442|       |
  443|    858|        ctr32 = GETU32(ctr->V + 12) + blocks;
  ------------------
  |  |  103|    858|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  444|    858|        if (ctr32 < blocks) {
  ------------------
  |  Branch (444:13): [True: 0, False: 858]
  ------------------
  445|       |            /* 32-bit counter overflow into V. */
  446|      0|            if (ctr32 != 0) {
  ------------------
  |  Branch (446:17): [True: 0, False: 0]
  ------------------
  447|      0|                blocks -= ctr32;
  448|      0|                buflen = blocks * 16;
  449|      0|                ctr32 = 0;
  450|      0|            }
  451|      0|            ctr96_inc(ctr->V);
  452|      0|        }
  453|    858|        PUTU32(ctr->V + 12, ctr32);
  ------------------
  |  |  104|    858|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  454|       |
  455|    858|        if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen)
  ------------------
  |  Branch (455:13): [True: 0, False: 858]
  ------------------
  456|    858|            || outl != buflen)
  ------------------
  |  Branch (456:16): [True: 0, False: 858]
  ------------------
  457|      0|            return 0;
  458|       |
  459|    858|        out += buflen;
  460|    858|        outlen -= buflen;
  461|    858|    } while (outlen);
  ------------------
  |  Branch (461:14): [True: 0, False: 858]
  ------------------
  462|       |
  463|    858|    if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (463:9): [True: 0, False: 858]
  ------------------
  464|      0|        return 0;
  465|    858|    return 1;
  466|    858|}
drbg_ctr.c:drbg_ctr_free:
  648|      3|{
  649|      3|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  650|      3|    PROV_DRBG_CTR *ctr;
  651|       |
  652|      3|    if (drbg != NULL && (ctr = (PROV_DRBG_CTR *)drbg->data) != NULL) {
  ------------------
  |  Branch (652:9): [True: 3, False: 0]
  |  Branch (652:25): [True: 3, False: 0]
  ------------------
  653|      3|        EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  654|      3|        EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  655|      3|        EVP_CIPHER_CTX_free(ctr->ctx_df);
  656|      3|        EVP_CIPHER_free(ctr->cipher_ecb);
  657|      3|        EVP_CIPHER_free(ctr->cipher_ctr);
  658|       |
  659|      3|        OPENSSL_secure_clear_free(ctr, sizeof(*ctr));
  ------------------
  |  |  129|      3|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  660|      3|    }
  661|      3|    ossl_rand_drbg_free(drbg);
  662|      3|}
drbg_ctr.c:drbg_ctr_instantiate_wrapper:
  339|      3|{
  340|      3|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  341|      3|    int ret = 0;
  342|       |
  343|      3|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (343:9): [True: 0, False: 3]
  |  Branch (343:31): [True: 0, False: 0]
  ------------------
  344|      0|        return 0;
  345|       |
  346|      3|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (346:9): [True: 0, False: 3]
  ------------------
  347|      3|            || !drbg_ctr_set_ctx_params_locked(drbg, params))
  ------------------
  |  Branch (347:16): [True: 0, False: 3]
  ------------------
  348|      0|        goto err;
  349|      3|    ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
  350|      3|                                     pstr, pstr_len);
  351|      3| err:
  352|      3|    if (drbg->lock != NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 3]
  ------------------
  353|      0|        CRYPTO_THREAD_unlock(drbg->lock);
  354|      3|    return ret;
  355|      3|}
drbg_ctr.c:drbg_ctr_set_ctx_params_locked:
  714|      3|{
  715|      3|    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
  716|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
  717|      3|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|      3|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  718|      3|    OSSL_PROVIDER *prov = NULL;
  719|      3|    const OSSL_PARAM *p;
  720|      3|    char *ecb;
  721|      3|    const char *propquery = NULL;
  722|      3|    int i, cipher_init = 0;
  723|       |
  724|      3|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_USE_DF)) != NULL
  ------------------
  |  |  249|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (724:9): [True: 3, False: 0]
  ------------------
  725|      3|            && OSSL_PARAM_get_int(p, &i)) {
  ------------------
  |  Branch (725:16): [True: 3, False: 0]
  ------------------
  726|       |        /* FIPS errors out in the drbg_ctr_init() call later */
  727|      3|        ctr->use_df = i != 0;
  728|      3|        cipher_init = 1;
  729|      3|    }
  730|       |
  731|      3|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (731:9): [True: 0, False: 3]
  ------------------
  732|      3|                                     OSSL_DRBG_PARAM_PROPERTIES)) != NULL) {
  ------------------
  |  |  242|      3|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      3|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  733|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (733:13): [True: 0, False: 0]
  ------------------
  734|      0|            return 0;
  735|      0|        propquery = (const char *)p->data;
  736|      0|    }
  737|       |
  738|      3|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (738:9): [True: 3, False: 0]
  ------------------
  739|      3|                                     OSSL_PROV_PARAM_CORE_PROV_NAME)) != NULL) {
  ------------------
  |  |  494|      3|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  740|      3|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      3|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (740:13): [True: 0, False: 3]
  ------------------
  741|      0|            return 0;
  742|      3|        if ((prov = ossl_provider_find(libctx,
  ------------------
  |  Branch (742:13): [True: 0, False: 3]
  ------------------
  743|      3|                                       (const char *)p->data, 1)) == NULL)
  744|      0|            return 0;
  745|      3|    }
  746|       |
  747|      3|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_CIPHER)) != NULL) {
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (747:9): [True: 3, False: 0]
  ------------------
  748|      3|        const char *base = (const char *)p->data;
  749|      3|        size_t ctr_str_len = sizeof("CTR") - 1;
  750|      3|        size_t ecb_str_len = sizeof("ECB") - 1;
  751|       |
  752|      3|        if (p->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|      6|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (752:13): [True: 0, False: 3]
  ------------------
  753|      3|                || p->data_size < ctr_str_len) {
  ------------------
  |  Branch (753:20): [True: 0, False: 3]
  ------------------
  754|      0|            ossl_provider_free(prov);
  755|      0|            return 0;
  756|      0|        }
  757|      3|        if (OPENSSL_strcasecmp("CTR", base + p->data_size - ctr_str_len) != 0) {
  ------------------
  |  Branch (757:13): [True: 0, False: 3]
  ------------------
  758|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  759|      0|            ossl_provider_free(prov);
  760|      0|            return 0;
  761|      0|        }
  762|      3|        if ((ecb = OPENSSL_strndup(base, p->data_size)) == NULL) {
  ------------------
  |  |  121|      3|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (762:13): [True: 0, False: 3]
  ------------------
  763|      0|            ossl_provider_free(prov);
  764|      0|            return 0;
  765|      0|        }
  766|      3|        strcpy(ecb + p->data_size - ecb_str_len, "ECB");
  767|      3|        EVP_CIPHER_free(ctr->cipher_ecb);
  768|      3|        EVP_CIPHER_free(ctr->cipher_ctr);
  769|       |        /*
  770|       |         * Try to fetch algorithms from our own provider code, fallback
  771|       |         * to generic fetch only if that fails
  772|       |         */
  773|      3|        (void)ERR_set_mark();
  774|      3|        ctr->cipher_ctr = evp_cipher_fetch_from_prov(prov, base, NULL);
  775|      3|        if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (775:13): [True: 0, False: 3]
  ------------------
  776|      0|            (void)ERR_pop_to_mark();
  777|      0|            ctr->cipher_ctr = EVP_CIPHER_fetch(libctx, base, propquery);
  778|      3|        } else {
  779|      3|            (void)ERR_clear_last_mark();
  780|      3|        }
  781|      3|        (void)ERR_set_mark();
  782|      3|        ctr->cipher_ecb = evp_cipher_fetch_from_prov(prov, ecb, NULL);
  783|      3|        if (ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (783:13): [True: 0, False: 3]
  ------------------
  784|      0|            (void)ERR_pop_to_mark();
  785|      0|            ctr->cipher_ecb = EVP_CIPHER_fetch(libctx, ecb, propquery);
  786|      3|        } else {
  787|      3|            (void)ERR_clear_last_mark();
  788|      3|        }
  789|      3|        OPENSSL_free(ecb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  790|      3|        if (ctr->cipher_ctr == NULL || ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (790:13): [True: 0, False: 3]
  |  Branch (790:40): [True: 0, False: 3]
  ------------------
  791|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  792|      0|            ossl_provider_free(prov);
  793|      0|            return 0;
  794|      0|        }
  795|      3|        cipher_init = 1;
  796|      3|    }
  797|      3|    ossl_provider_free(prov);
  798|       |
  799|      3|    if (cipher_init && !drbg_ctr_init(ctx))
  ------------------
  |  Branch (799:9): [True: 3, False: 0]
  |  Branch (799:24): [True: 0, False: 3]
  ------------------
  800|      0|        return 0;
  801|       |
  802|      3|    return ossl_drbg_set_ctx_params(ctx, params);
  803|      3|}
drbg_ctr.c:drbg_ctr_init:
  564|      3|{
  565|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  566|      3|    size_t keylen;
  567|       |
  568|      3|    if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (568:9): [True: 0, False: 3]
  ------------------
  569|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  570|      0|        return 0;
  571|      0|    }
  572|      3|    ctr->keylen = keylen = EVP_CIPHER_get_key_length(ctr->cipher_ctr);
  573|      3|    if (ctr->ctx_ecb == NULL)
  ------------------
  |  Branch (573:9): [True: 3, False: 0]
  ------------------
  574|      3|        ctr->ctx_ecb = EVP_CIPHER_CTX_new();
  575|      3|    if (ctr->ctx_ctr == NULL)
  ------------------
  |  Branch (575:9): [True: 3, False: 0]
  ------------------
  576|      3|        ctr->ctx_ctr = EVP_CIPHER_CTX_new();
  577|      3|    if (ctr->ctx_ecb == NULL || ctr->ctx_ctr == NULL) {
  ------------------
  |  Branch (577:9): [True: 0, False: 3]
  |  Branch (577:33): [True: 0, False: 3]
  ------------------
  578|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  579|      0|        goto err;
  580|      0|    }
  581|       |
  582|      3|    if (!EVP_CipherInit_ex(ctr->ctx_ecb,
  ------------------
  |  Branch (582:9): [True: 0, False: 3]
  ------------------
  583|      3|                           ctr->cipher_ecb, NULL, NULL, NULL, 1)
  584|      3|        || !EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (584:12): [True: 0, False: 3]
  ------------------
  585|      3|                              ctr->cipher_ctr, NULL, NULL, NULL, 1)) {
  586|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  587|      0|        goto err;
  588|      0|    }
  589|       |
  590|      3|    drbg->strength = keylen * 8;
  591|      3|    drbg->seedlen = keylen + 16;
  592|       |
  593|      3|    if (ctr->use_df) {
  ------------------
  |  Branch (593:9): [True: 3, False: 0]
  ------------------
  594|       |        /* df initialisation */
  595|      3|        static const unsigned char df_key[32] = {
  596|      3|            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  597|      3|            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
  598|      3|            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  599|      3|            0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
  600|      3|        };
  601|       |
  602|      3|        if (ctr->ctx_df == NULL)
  ------------------
  |  Branch (602:13): [True: 3, False: 0]
  ------------------
  603|      3|            ctr->ctx_df = EVP_CIPHER_CTX_new();
  604|      3|        if (ctr->ctx_df == NULL) {
  ------------------
  |  Branch (604:13): [True: 0, False: 3]
  ------------------
  605|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  606|      0|            goto err;
  607|      0|        }
  608|       |        /* Set key schedule for df_key */
  609|      3|        if (!EVP_CipherInit_ex(ctr->ctx_df,
  ------------------
  |  Branch (609:13): [True: 0, False: 3]
  ------------------
  610|      3|                               ctr->cipher_ecb, NULL, df_key, NULL, 1)) {
  611|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  612|      0|            goto err;
  613|      0|        }
  614|      3|    }
  615|      3|    return drbg_ctr_init_lengths(drbg);
  616|       |
  617|      0|err:
  618|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  619|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  620|      0|    ctr->ctx_ecb = ctr->ctx_ctr = NULL;
  621|      0|    return 0;
  622|      3|}
drbg_ctr.c:drbg_ctr_generate_wrapper:
  472|    854|{
  473|    854|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  474|       |
  475|    854|    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  476|    854|                                   prediction_resistance, adin, adin_len);
  477|    854|}
drbg_ctr.c:drbg_ctr_settable_ctx_params:
  823|      3|{
  824|      3|    static const OSSL_PARAM known_settable_ctx_params[] = {
  825|      3|        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
  ------------------
  |  |   61|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|      3|        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_CIPHER, NULL, 0),
  ------------------
  |  |   61|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  827|      3|        OSSL_PARAM_int(OSSL_DRBG_PARAM_USE_DF, NULL),
  ------------------
  |  |   32|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
  |  |  ------------------
  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|      3|        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
  ------------------
  |  |  222|      3|    OSSL_PARAM_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS, NULL),             \
  |  |  ------------------
  |  |  |  |   34|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   35|      3|                    sizeof(unsigned int))
  |  |  ------------------
  |  |  223|      3|    OSSL_PARAM_uint64(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL, NULL)
  |  |  ------------------
  |  |  |  |   49|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   50|      3|                    sizeof(uint64_t))
  |  |  ------------------
  ------------------
  829|      3|        OSSL_PARAM_END
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
  830|      3|    };
  831|      3|    return known_settable_ctx_params;
  832|      3|}
drbg_ctr.c:drbg_ctr_get_ctx_params:
  665|  1.71k|{
  666|  1.71k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  667|  1.71k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  668|  1.71k|    OSSL_PARAM *p;
  669|  1.71k|    int ret = 0, complete = 0;
  670|       |
  671|  1.71k|    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
  ------------------
  |  Branch (671:9): [True: 0, False: 1.71k]
  ------------------
  672|      0|        return 0;
  673|       |
  674|  1.71k|    if (complete)
  ------------------
  |  Branch (674:9): [True: 1.71k, False: 6]
  ------------------
  675|  1.71k|        return 1;
  676|       |
  677|      6|    if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  ------------------
  |  Branch (677:9): [True: 6, False: 0]
  |  Branch (677:31): [True: 0, False: 6]
  ------------------
  678|      0|        return 0;
  679|       |
  680|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_USE_DF);
  ------------------
  |  |  249|      6|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  681|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, ctr->use_df))
  ------------------
  |  Branch (681:9): [True: 0, False: 6]
  |  Branch (681:22): [True: 0, False: 0]
  ------------------
  682|      0|        goto err;
  683|       |
  684|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_CIPHER);
  ------------------
  |  |  227|      6|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      6|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  685|      6|    if (p != NULL) {
  ------------------
  |  Branch (685:9): [True: 0, False: 6]
  ------------------
  686|      0|        if (ctr->cipher_ctr == NULL
  ------------------
  |  Branch (686:13): [True: 0, False: 0]
  ------------------
  687|      0|            || !OSSL_PARAM_set_utf8_string(p,
  ------------------
  |  Branch (687:16): [True: 0, False: 0]
  ------------------
  688|      0|                                           EVP_CIPHER_get0_name(ctr->cipher_ctr)))
  689|      0|            goto err;
  690|      0|    }
  691|       |
  692|      6|    ret = ossl_drbg_get_ctx_params(drbg, params);
  693|      6| err:
  694|      6|    if (drbg->lock != NULL)
  ------------------
  |  Branch (694:9): [True: 6, False: 0]
  ------------------
  695|      6|        CRYPTO_THREAD_unlock(drbg->lock);
  696|       |
  697|      6|    return ret;
  698|      6|}

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_enable_locking:
  216|      1|{
  217|      1|    return 1;
  218|      1|}
seed_src.c:seed_src_lock:
  221|      9|{
  222|      9|    return 1;
  223|      9|}
seed_src.c:seed_src_unlock:
  226|      9|{
  227|      9|}
seed_src.c:seed_src_get_ctx_params:
  145|      6|{
  146|      6|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
  147|      6|    OSSL_PARAM *p;
  148|       |
  149|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|      6|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  150|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, s->state))
  ------------------
  |  Branch (150:9): [True: 0, False: 6]
  |  Branch (150:22): [True: 0, False: 0]
  ------------------
  151|      0|        return 0;
  152|       |
  153|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|      6|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
  154|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, 1024))
  ------------------
  |  Branch (154:9): [True: 2, False: 4]
  |  Branch (154:22): [True: 0, False: 2]
  ------------------
  155|      0|        return 0;
  156|       |
  157|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|      6|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  158|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, 128))
  ------------------
  |  Branch (158:9): [True: 0, False: 6]
  |  Branch (158:22): [True: 0, False: 0]
  ------------------
  159|      0|        return 0;
  160|      6|    return 1;
  161|      6|}
seed_src.c:seed_get_seed:
  184|      1|{
  185|      1|    size_t ret = 0;
  186|      1|    size_t entropy_available = 0;
  187|      1|    RAND_POOL *pool;
  188|       |
  189|      1|    pool = ossl_rand_pool_new(entropy, 1, min_len, max_len);
  190|      1|    if (pool == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 1]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_RAND_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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 0;
  193|      0|    }
  194|       |
  195|       |    /* Get entropy by polling system entropy sources. */
  196|      1|    entropy_available = ossl_pool_acquire_entropy(pool);
  197|       |
  198|      1|    if (entropy_available > 0
  ------------------
  |  Branch (198:9): [True: 1, False: 0]
  ------------------
  199|      1|        && ossl_rand_pool_adin_mix_in(pool, adin, adin_len)) {
  ------------------
  |  Branch (199:12): [True: 1, False: 0]
  ------------------
  200|      1|        ret = ossl_rand_pool_length(pool);
  201|      1|        *pout = ossl_rand_pool_detach(pool);
  202|      1|    } else {
  203|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|    }
  205|      1|    ossl_rand_pool_free(pool);
  206|      1|    return ret;
  207|      1|}
seed_src.c:seed_clear_seed:
  211|      1|{
  212|      1|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  129|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|      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|}
ossl_pool_acquire_entropy:
  630|      1|{
  631|       |#  if defined(OPENSSL_RAND_SEED_NONE)
  632|       |    return ossl_rand_pool_entropy_available(pool);
  633|       |#  else
  634|      1|    size_t entropy_available = 0;
  635|       |
  636|      1|    (void)entropy_available;    /* avoid compiler warning */
  637|       |
  638|      1|#   if defined(OPENSSL_RAND_SEED_GETRANDOM)
  639|      1|    {
  640|      1|        size_t bytes_needed;
  641|      1|        unsigned char *buffer;
  642|      1|        ssize_t bytes;
  643|       |        /* Maximum allowed number of consecutive unsuccessful attempts */
  644|      1|        int attempts = 3;
  645|       |
  646|      1|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  647|      2|        while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (647:16): [True: 1, False: 1]
  |  Branch (647:37): [True: 1, False: 0]
  ------------------
  648|      1|            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  649|      1|            bytes = syscall_random(buffer, bytes_needed);
  650|      1|            if (bytes > 0) {
  ------------------
  |  Branch (650:17): [True: 1, False: 0]
  ------------------
  651|      1|                ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  652|      1|                bytes_needed -= bytes;
  653|      1|                attempts = 3; /* reset counter after successful attempt */
  654|      1|            } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (654:24): [True: 0, False: 0]
  |  Branch (654:37): [True: 0, False: 0]
  ------------------
  655|      0|                break;
  656|      0|            }
  657|      1|        }
  658|      1|    }
  659|      1|    entropy_available = ossl_rand_pool_entropy_available(pool);
  660|      1|    if (entropy_available > 0)
  ------------------
  |  Branch (660:9): [True: 1, False: 0]
  ------------------
  661|      1|        return entropy_available;
  662|      0|#   endif
  663|       |
  664|      0|#   if defined(OPENSSL_RAND_SEED_DEVRANDOM)
  665|      0|    if (wait_random_seeded()) {
  ------------------
  |  Branch (665:9): [True: 0, False: 0]
  ------------------
  666|      0|        size_t bytes_needed;
  667|      0|        unsigned char *buffer;
  668|      0|        size_t i;
  669|       |
  670|      0|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  671|      0|        for (i = 0; bytes_needed > 0 && i < OSSL_NELEM(random_device_paths);
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (671:21): [True: 0, False: 0]
  |  Branch (671:41): [True: 0, False: 0]
  ------------------
  672|      0|             i++) {
  673|      0|            ssize_t bytes = 0;
  674|       |            /* Maximum number of consecutive unsuccessful attempts */
  675|      0|            int attempts = 3;
  676|      0|            const int fd = get_random_device(i);
  677|       |
  678|      0|            if (fd == -1)
  ------------------
  |  Branch (678:17): [True: 0, False: 0]
  ------------------
  679|      0|                continue;
  680|       |
  681|      0|            while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (681:20): [True: 0, False: 0]
  |  Branch (681:41): [True: 0, False: 0]
  ------------------
  682|      0|                buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  683|      0|                bytes = read(fd, buffer, bytes_needed);
  684|       |
  685|      0|                if (bytes > 0) {
  ------------------
  |  Branch (685:21): [True: 0, False: 0]
  ------------------
  686|      0|                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  687|      0|                    bytes_needed -= bytes;
  688|      0|                    attempts = 3; /* reset counter on successful attempt */
  689|      0|                } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (689:28): [True: 0, False: 0]
  |  Branch (689:41): [True: 0, False: 0]
  ------------------
  690|      0|                    break;
  691|      0|                }
  692|      0|            }
  693|      0|            if (bytes < 0 || !keep_random_devices_open)
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  |  Branch (693:30): [True: 0, False: 0]
  ------------------
  694|      0|                close_random_device(i);
  695|       |
  696|      0|            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  697|      0|        }
  698|      0|        entropy_available = ossl_rand_pool_entropy_available(pool);
  699|      0|        if (entropy_available > 0)
  ------------------
  |  Branch (699:13): [True: 0, False: 0]
  ------------------
  700|      0|            return entropy_available;
  701|      0|    }
  702|      0|#   endif
  703|       |
  704|       |#   if defined(OPENSSL_RAND_SEED_RDTSC)
  705|       |    entropy_available = ossl_prov_acquire_entropy_from_tsc(pool);
  706|       |    if (entropy_available > 0)
  707|       |        return entropy_available;
  708|       |#   endif
  709|       |
  710|       |#   if defined(OPENSSL_RAND_SEED_RDCPU)
  711|       |    entropy_available = ossl_prov_acquire_entropy_from_cpu(pool);
  712|       |    if (entropy_available > 0)
  713|       |        return entropy_available;
  714|       |#   endif
  715|       |
  716|       |#   if defined(OPENSSL_RAND_SEED_EGD)
  717|       |    {
  718|       |        static const char *paths[] = { DEVRANDOM_EGD, NULL };
  719|       |        size_t bytes_needed;
  720|       |        unsigned char *buffer;
  721|       |        int i;
  722|       |
  723|       |        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  724|       |        for (i = 0; bytes_needed > 0 && paths[i] != NULL; i++) {
  725|       |            size_t bytes = 0;
  726|       |            int num;
  727|       |
  728|       |            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  729|       |            num = RAND_query_egd_bytes(paths[i],
  730|       |                                       buffer, (int)bytes_needed);
  731|       |            if (num == (int)bytes_needed)
  732|       |                bytes = bytes_needed;
  733|       |
  734|       |            ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  735|       |            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  736|       |        }
  737|       |        entropy_available = ossl_rand_pool_entropy_available(pool);
  738|       |        if (entropy_available > 0)
  739|       |            return entropy_available;
  740|       |    }
  741|       |#   endif
  742|       |
  743|      0|    return ossl_rand_pool_entropy_available(pool);
  744|      0|#  endif
  745|      0|}
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|}
rand_unix.c:syscall_random:
  334|      1|{
  335|       |    /*
  336|       |     * Note: 'buflen' equals the size of the buffer which is used by the
  337|       |     * get_entropy() callback of the RAND_DRBG. It is roughly bounded by
  338|       |     *
  339|       |     *   2 * RAND_POOL_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^14
  340|       |     *
  341|       |     * which is way below the OSSL_SSIZE_MAX limit. Therefore sign conversion
  342|       |     * between size_t and ssize_t is safe even without a range check.
  343|       |     */
  344|       |
  345|       |    /*
  346|       |     * Do runtime detection to find getentropy().
  347|       |     *
  348|       |     * Known OSs that should support this:
  349|       |     * - Darwin since 16 (OSX 10.12, IOS 10.0).
  350|       |     * - Solaris since 11.3
  351|       |     * - OpenBSD since 5.6
  352|       |     * - Linux since 3.17 with glibc 2.25
  353|       |     *
  354|       |     * Note: Sometimes getentropy() can be provided but not implemented
  355|       |     * internally. So we need to check errno for ENOSYS
  356|       |     */
  357|      1|#  if !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
  358|      1|#    if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux)
  359|      1|    extern int getentropy(void *buffer, size_t length) __attribute__((weak));
  360|       |
  361|      1|    if (getentropy != NULL) {
  ------------------
  |  Branch (361:9): [True: 1, False: 0]
  ------------------
  362|      1|        if (getentropy(buf, buflen) == 0)
  ------------------
  |  Branch (362:13): [True: 1, False: 0]
  ------------------
  363|      1|            return (ssize_t)buflen;
  364|      0|        if (errno != ENOSYS)
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  ------------------
  365|      0|            return -1;
  366|      0|    }
  367|       |#    elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
  368|       |
  369|       |    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
  370|       |	    return (ssize_t)buflen;
  371|       |
  372|       |    return -1;
  373|       |#    else
  374|       |    union {
  375|       |        void *p;
  376|       |        int (*f)(void *buffer, size_t length);
  377|       |    } p_getentropy;
  378|       |
  379|       |    /*
  380|       |     * We could cache the result of the lookup, but we normally don't
  381|       |     * call this function often.
  382|       |     */
  383|       |    ERR_set_mark();
  384|       |    p_getentropy.p = DSO_global_lookup("getentropy");
  385|       |    ERR_pop_to_mark();
  386|       |    if (p_getentropy.p != NULL)
  387|       |        return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
  388|       |#    endif
  389|      0|#  endif /* !__DragonFly__ && !__NetBSD__ && !__FreeBSD__ */
  390|       |
  391|       |    /* Linux supports this since version 3.17 */
  392|      0|#  if defined(__linux) && defined(__NR_getrandom)
  393|      0|    return syscall(__NR_getrandom, buf, buflen, 0);
  394|       |#  elif (defined(__DragonFly__)  && __DragonFly_version >= 500700) \
  395|       |     || (defined(__NetBSD__) && __NetBSD_Version >= 1000000000) \
  396|       |     || (defined(__FreeBSD__) && __FreeBSD_version >= 1200061)
  397|       |    return getrandom(buf, buflen, 0);
  398|       |#  elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
  399|       |    return sysctl_random(buf, buflen);
  400|       |#  elif defined(__wasi__)
  401|       |    if (getentropy(buf, buflen) == 0)
  402|       |      return (ssize_t)buflen;
  403|       |    return -1;
  404|       |#  else
  405|       |    errno = ENOSYS;
  406|       |    return -1;
  407|       |#  endif
  408|      1|}

ml_dsa_sig.c:ml_dsa_44_newctx:
  481|    134|    {                                                                          \
  482|    134|        return ml_dsa_newctx(provctx, EVP_PKEY_ML_DSA_##alg, propq);           \
  483|    134|    }                                                                          \
ml_dsa_sig.c:ml_dsa_newctx:
   79|    380|{
   80|    380|    PROV_ML_DSA_CTX *ctx;
   81|       |
   82|    380|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (82:9): [True: 0, False: 380]
  ------------------
   83|      0|        return NULL;
   84|       |
   85|    380|    ctx = OPENSSL_zalloc(sizeof(PROV_ML_DSA_CTX));
  ------------------
  |  |  104|    380|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    380|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    380|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|    380|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 380]
  ------------------
   87|      0|        return NULL;
   88|       |
   89|    380|    ctx->libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    380|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
   90|    380|    ctx->msg_encode = ML_DSA_MESSAGE_ENCODE_PURE;
  ------------------
  |  |   27|    380|#define ML_DSA_MESSAGE_ENCODE_PURE 1
  ------------------
   91|    380|    ctx->evp_type = evp_type;
   92|    380|    return ctx;
   93|    380|}
ml_dsa_sig.c:ml_dsa_sign_msg_init:
  190|    119|{
  191|    119|    return ml_dsa_signverify_msg_init(vctx, vkey, params,
  192|    119|                                      EVP_PKEY_OP_SIGNMSG, "ML_DSA Sign Init");
  ------------------
  |  | 1758|    119|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  193|    119|}
ml_dsa_sig.c:ml_dsa_signverify_msg_init:
  164|    380|{
  165|    380|    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
  166|    380|    ML_DSA_KEY *key = vkey;
  167|       |
  168|    380|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (168:9): [True: 0, False: 380]
  ------------------
  169|    380|            || ctx == NULL)
  ------------------
  |  Branch (169:16): [True: 0, False: 380]
  ------------------
  170|      0|        return 0;
  171|       |
  172|    380|    if (vkey == NULL && ctx->key == NULL) {
  ------------------
  |  Branch (172:9): [True: 0, False: 380]
  |  Branch (172:25): [True: 0, False: 0]
  ------------------
  173|      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)
  |  |  ------------------
  ------------------
  174|      0|        return 0;
  175|      0|    }
  176|       |
  177|    380|    if (key != NULL)
  ------------------
  |  Branch (177:9): [True: 380, False: 0]
  ------------------
  178|    380|        ctx->key = vkey;
  179|    380|    if (!ossl_ml_dsa_key_matches(ctx->key, ctx->evp_type))
  ------------------
  |  Branch (179:9): [True: 0, False: 380]
  ------------------
  180|      0|        return 0;
  181|       |
  182|    380|    set_alg_id_buffer(ctx);
  183|    380|    ctx->mu = 0;
  184|    380|    ctx->operation = operation;
  185|       |
  186|    380|    return ml_dsa_set_ctx_params(ctx, params);
  187|    380|}
ml_dsa_sig.c:set_alg_id_buffer:
  136|    380|{
  137|    380|    int ret;
  138|    380|    WPACKET pkt;
  139|    380|    uint8_t *aid = NULL;
  140|       |
  141|       |    /*
  142|       |     * We do not care about DER writing errors.
  143|       |     * All it really means is that for some reason, there's no
  144|       |     * AlgorithmIdentifier to be had, but the operation itself is
  145|       |     * still valid, just as long as it's not used to construct
  146|       |     * anything that needs an AlgorithmIdentifier.
  147|       |     */
  148|    380|    ctx->aid_len = 0;
  149|    380|    ret = WPACKET_init_der(&pkt, ctx->aid_buf, sizeof(ctx->aid_buf));
  150|    380|    ret = ret && ossl_DER_w_algorithmIdentifier_ML_DSA(&pkt, -1, ctx->key);
  ------------------
  |  Branch (150:11): [True: 380, False: 0]
  |  Branch (150:18): [True: 380, False: 0]
  ------------------
  151|    380|    if (ret && WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (151:9): [True: 380, False: 0]
  |  Branch (151:16): [True: 380, False: 0]
  ------------------
  152|    380|        WPACKET_get_total_written(&pkt, &ctx->aid_len);
  153|    380|        aid = WPACKET_get_curr(&pkt);
  154|    380|    }
  155|    380|    WPACKET_cleanup(&pkt);
  156|    380|    if (aid != NULL && ctx->aid_len != 0)
  ------------------
  |  Branch (156:9): [True: 380, False: 0]
  |  Branch (156:24): [True: 380, False: 0]
  ------------------
  157|    380|        memmove(ctx->aid_buf, aid, ctx->aid_len);
  158|    380|    return 1;
  159|    380|}
ml_dsa_sig.c:ml_dsa_sign:
  283|    380|{
  284|    380|    int ret = 0;
  285|    380|    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
  286|    380|    uint8_t rand_tmp[ML_DSA_ENTROPY_LEN], *rnd = NULL;
  287|       |
  288|    380|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (288:9): [True: 0, False: 380]
  ------------------
  289|      0|        return 0;
  290|       |
  291|    380|    if (sig != NULL) {
  ------------------
  |  Branch (291:9): [True: 190, False: 190]
  ------------------
  292|    190|        if (ctx->test_entropy_len != 0) {
  ------------------
  |  Branch (292:13): [True: 0, False: 190]
  ------------------
  293|      0|            rnd = ctx->test_entropy;
  294|    190|        } else {
  295|    190|            rnd = rand_tmp;
  296|       |
  297|    190|            if (ctx->deterministic == 1)
  ------------------
  |  Branch (297:17): [True: 0, False: 190]
  ------------------
  298|      0|                memset(rnd, 0, sizeof(rand_tmp));
  299|    190|            else if (RAND_priv_bytes_ex(ctx->libctx, rnd, sizeof(rand_tmp), 0) <= 0)
  ------------------
  |  Branch (299:22): [True: 0, False: 190]
  ------------------
  300|      0|                return 0;
  301|    190|        }
  302|    190|    }
  303|    380|    ret = ossl_ml_dsa_sign(ctx->key, ctx->mu, msg, msg_len,
  304|    380|                           ctx->context_string, ctx->context_string_len,
  305|    380|                           rnd, sizeof(rand_tmp), ctx->msg_encode,
  306|    380|                           sig, siglen, sigsize);
  307|    380|    if (rnd != ctx->test_entropy)
  ------------------
  |  Branch (307:9): [True: 380, False: 0]
  ------------------
  308|    380|        OPENSSL_cleanse(rand_tmp, sizeof(rand_tmp));
  309|    380|    return ret;
  310|    380|}
ml_dsa_sig.c:ml_dsa_verify_msg_init:
  319|    119|{
  320|    119|    return ml_dsa_signverify_msg_init(vctx, vkey, params, EVP_PKEY_OP_VERIFYMSG,
  ------------------
  |  | 1759|    119|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  321|    119|                                      "ML_DSA Verify Init");
  322|    119|}
ml_dsa_sig.c:ml_dsa_verify:
  344|    190|{
  345|    190|    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
  346|       |
  347|    190|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (347:9): [True: 0, False: 190]
  ------------------
  348|      0|        return 0;
  349|    190|    return ossl_ml_dsa_verify(ctx->key, ctx->mu, msg, msg_len,
  350|    190|                              ctx->context_string, ctx->context_string_len,
  351|    190|                              ctx->msg_encode, sig, siglen);
  352|    190|}
ml_dsa_sig.c:ml_dsa_digest_signverify_init:
  197|    142|{
  198|    142|    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
  199|       |
  200|    142|    if (mdname != NULL && mdname[0] != '\0') {
  ------------------
  |  Branch (200:9): [True: 0, False: 142]
  |  Branch (200:27): [True: 0, False: 0]
  ------------------
  201|      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
  ------------------
  202|      0|                       "Explicit digest not supported for ML-DSA operations");
  203|      0|        return 0;
  204|      0|    }
  205|       |
  206|    142|    ctx->mu = 0;
  207|       |
  208|    142|    if (vkey == NULL && ctx->key != NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 142]
  |  Branch (208:25): [True: 0, False: 0]
  ------------------
  209|      0|        return ml_dsa_set_ctx_params(ctx, params);
  210|       |
  211|    142|    return ml_dsa_signverify_msg_init(vctx, vkey, params,
  212|    142|                                      EVP_PKEY_OP_SIGN, "ML_DSA Sign Init");
  ------------------
  |  | 1748|    142|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  213|    142|}
ml_dsa_sig.c:ml_dsa_digest_sign:
  314|    142|{
  315|    142|    return ml_dsa_sign(vctx, sig, siglen, sigsize, tbs, tbslen);
  316|    142|}
ml_dsa_sig.c:ml_dsa_digest_verify:
  356|     71|{
  357|     71|    return ml_dsa_verify(vctx, sig, siglen, tbs, tbslen);
  358|     71|}
ml_dsa_sig.c:ml_dsa_freectx:
   69|    380|{
   70|    380|    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
   71|       |
   72|    380|    EVP_MD_CTX_free(ctx->md_ctx);
   73|    380|    OPENSSL_cleanse(ctx->test_entropy, ctx->test_entropy_len);
   74|    380|    OPENSSL_free(ctx->sig);
  ------------------
  |  |  115|    380|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    380|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    380|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|    380|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    380|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    380|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    380|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|    380|}
ml_dsa_sig.c:ml_dsa_set_ctx_params:
  361|    380|{
  362|    380|    PROV_ML_DSA_CTX *pctx = (PROV_ML_DSA_CTX *)vctx;
  363|    380|    const OSSL_PARAM *p;
  364|       |
  365|    380|    if (pctx == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 380]
  ------------------
  366|      0|        return 0;
  367|    380|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (367:9): [True: 0, False: 380]
  ------------------
  368|      0|        return 1;
  369|       |
  370|    380|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_CONTEXT_STRING);
  ------------------
  |  |  540|    380|# define OSSL_SIGNATURE_PARAM_CONTEXT_STRING "context-string"
  ------------------
  371|    380|    if (p != NULL) {
  ------------------
  |  Branch (371:9): [True: 380, False: 0]
  ------------------
  372|    380|        void *vp = pctx->context_string;
  373|       |
  374|    380|        if (!OSSL_PARAM_get_octet_string(p, &vp, sizeof(pctx->context_string),
  ------------------
  |  Branch (374:13): [True: 0, False: 380]
  ------------------
  375|    380|                                         &(pctx->context_string_len))) {
  376|      0|            pctx->context_string_len = 0;
  377|      0|            return 0;
  378|      0|        }
  379|    380|    }
  380|    380|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_TEST_ENTROPY);
  ------------------
  |  |  562|    380|# define OSSL_SIGNATURE_PARAM_TEST_ENTROPY "test-entropy"
  ------------------
  381|    380|    if (p != NULL) {
  ------------------
  |  Branch (381:9): [True: 0, False: 380]
  ------------------
  382|      0|        void *vp = pctx->test_entropy;
  383|       |
  384|      0|        pctx->test_entropy_len = 0;
  385|      0|        if (!OSSL_PARAM_get_octet_string(p, &vp, sizeof(pctx->test_entropy),
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  ------------------
  386|      0|                                         &(pctx->test_entropy_len)))
  387|      0|                return 0;
  388|      0|        if (pctx->test_entropy_len != sizeof(pctx->test_entropy)) {
  ------------------
  |  Branch (388:13): [True: 0, False: 0]
  ------------------
  389|      0|            pctx->test_entropy_len = 0;
  390|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SEED_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)
  |  |  ------------------
  ------------------
  391|      0|            return 0;
  392|      0|        }
  393|      0|    }
  394|    380|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DETERMINISTIC);
  ------------------
  |  |  541|    380|# define OSSL_SIGNATURE_PARAM_DETERMINISTIC "deterministic"
  ------------------
  395|    380|    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->deterministic))
  ------------------
  |  Branch (395:9): [True: 0, False: 380]
  |  Branch (395:22): [True: 0, False: 0]
  ------------------
  396|      0|        return 0;
  397|       |
  398|    380|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING);
  ------------------
  |  |  553|    380|# define OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING "message-encoding"
  ------------------
  399|    380|    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->msg_encode))
  ------------------
  |  Branch (399:9): [True: 0, False: 380]
  |  Branch (399:22): [True: 0, False: 0]
  ------------------
  400|      0|        return 0;
  401|       |
  402|    380|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MU);
  ------------------
  |  |  556|    380|# define OSSL_SIGNATURE_PARAM_MU "mu"
  ------------------
  403|    380|    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->mu))
  ------------------
  |  Branch (403:9): [True: 0, False: 380]
  |  Branch (403:22): [True: 0, False: 0]
  ------------------
  404|      0|        return 0;
  405|       |
  406|    380|    if (pctx->operation == EVP_PKEY_OP_VERIFYMSG) {
  ------------------
  |  | 1759|    380|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (406:9): [True: 119, False: 261]
  ------------------
  407|    119|        p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_SIGNATURE);
  ------------------
  |  |  561|    119|# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
  ------------------
  408|    119|        if (p != NULL) {
  ------------------
  |  Branch (408:13): [True: 0, False: 119]
  ------------------
  409|      0|            OPENSSL_free(pctx->sig);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  410|      0|            pctx->sig = NULL;
  411|      0|            pctx->siglen = 0;
  412|      0|            if (!OSSL_PARAM_get_octet_string(p, (void **)&pctx->sig,
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  ------------------
  413|      0|                                             0, &pctx->siglen))
  414|      0|                return 0;
  415|      0|        }
  416|    119|    }
  417|       |
  418|    380|    return 1;
  419|    380|}
ml_dsa_sig.c:ml_dsa_65_newctx:
  481|    132|    {                                                                          \
  482|    132|        return ml_dsa_newctx(provctx, EVP_PKEY_ML_DSA_##alg, propq);           \
  483|    132|    }                                                                          \
ml_dsa_sig.c:ml_dsa_87_newctx:
  481|    114|    {                                                                          \
  482|    114|        return ml_dsa_newctx(provctx, EVP_PKEY_ML_DSA_##alg, propq);           \
  483|    114|    }                                                                          \

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

