libspdm_get_scratch_buffer_secure_message_capacity:
   17|    354|uint32_t libspdm_get_scratch_buffer_secure_message_capacity(libspdm_context_t *spdm_context) {
   18|    354|    return spdm_context->local_context.capability.max_spdm_msg_size +
   19|    354|           spdm_context->local_context.capability.transport_header_size +
   20|    354|           spdm_context->local_context.capability.transport_tail_size;
   21|    354|}
libspdm_get_scratch_buffer_large_message_capacity:
   28|    354|uint32_t libspdm_get_scratch_buffer_large_message_capacity(libspdm_context_t *spdm_context) {
   29|    354|    return spdm_context->local_context.capability.max_spdm_msg_size;
   30|    354|}
libspdm_get_scratch_buffer_sender_receiver_capacity:
   43|    354|uint32_t libspdm_get_scratch_buffer_sender_receiver_capacity(libspdm_context_t *spdm_context) {
   44|    354|    return spdm_context->local_context.capability.max_spdm_msg_size +
   45|    354|           spdm_context->local_context.capability.transport_header_size +
   46|    354|           spdm_context->local_context.capability.transport_tail_size;
   47|    354|}
libspdm_get_scratch_buffer_large_sender_receiver_capacity:
   58|    354|{
   59|    354|    return spdm_context->local_context.capability.max_spdm_msg_size +
   60|    354|           spdm_context->local_context.capability.transport_header_size +
   61|    354|           spdm_context->local_context.capability.transport_tail_size;
   62|    354|}
libspdm_get_scratch_buffer_last_spdm_request_offset:
   66|    118|uint32_t libspdm_get_scratch_buffer_last_spdm_request_offset(libspdm_context_t *spdm_context) {
   67|    118|    return 0 +
   68|    118|#if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
   69|    118|           libspdm_get_scratch_buffer_secure_message_capacity(spdm_context) +
   70|    118|           libspdm_get_scratch_buffer_large_message_capacity(spdm_context) +
   71|    118|#endif
   72|    118|           libspdm_get_scratch_buffer_sender_receiver_capacity(spdm_context) +
   73|    118|#if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
   74|    118|           libspdm_get_scratch_buffer_large_sender_receiver_capacity(spdm_context) +
   75|    118|#endif
   76|    118|           0;
   77|    118|}
libspdm_get_scratch_buffer_last_spdm_request_capacity:
   79|    236|uint32_t libspdm_get_scratch_buffer_last_spdm_request_capacity(libspdm_context_t *spdm_context) {
   80|    236|    return spdm_context->local_context.capability.max_spdm_msg_size;
   81|    236|}
libspdm_get_scratch_buffer_cache_spdm_request_offset:
   85|    118|uint32_t libspdm_get_scratch_buffer_cache_spdm_request_offset(libspdm_context_t *spdm_context) {
   86|    118|    return 0 +
   87|    118|#if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
   88|    118|           libspdm_get_scratch_buffer_secure_message_capacity(spdm_context) +
   89|    118|           libspdm_get_scratch_buffer_large_message_capacity(spdm_context) +
   90|    118|#endif
   91|    118|           libspdm_get_scratch_buffer_sender_receiver_capacity(spdm_context) +
   92|    118|#if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
   93|    118|           libspdm_get_scratch_buffer_large_sender_receiver_capacity(spdm_context) +
   94|    118|#endif
   95|    118|           libspdm_get_scratch_buffer_last_spdm_request_capacity(spdm_context) +
   96|    118|           0;
   97|    118|}
libspdm_get_scratch_buffer_cache_spdm_request_capacity:
   99|    118|uint32_t libspdm_get_scratch_buffer_cache_spdm_request_capacity(libspdm_context_t *spdm_context) {
  100|    118|    return spdm_context->local_context.capability.max_spdm_msg_size;
  101|    118|}
libspdm_get_scratch_buffer_capacity:
  105|    118|uint32_t libspdm_get_scratch_buffer_capacity(libspdm_context_t *spdm_context) {
  106|    118|    return 0 +
  107|    118|#if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
  108|    118|           libspdm_get_scratch_buffer_secure_message_capacity(spdm_context) +
  109|    118|           libspdm_get_scratch_buffer_large_message_capacity(spdm_context) +
  110|    118|#endif
  111|    118|           libspdm_get_scratch_buffer_sender_receiver_capacity(spdm_context) +
  112|    118|#if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
  113|    118|           libspdm_get_scratch_buffer_large_sender_receiver_capacity(spdm_context) +
  114|    118|#endif
  115|    118|           libspdm_get_scratch_buffer_last_spdm_request_capacity(spdm_context) +
  116|    118|#if LIBSPDM_RESPOND_IF_READY_SUPPORT
  117|    118|           libspdm_get_scratch_buffer_cache_spdm_request_capacity(spdm_context) +
  118|    118|#endif
  119|    118|           0;
  120|    118|}
libspdm_reset_message_b:
 1280|     16|{
 1281|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1282|       |    libspdm_reset_managed_buffer(&spdm_context->transcript.message_b);
 1283|       |#else
 1284|     16|    if (spdm_context->transcript.digest_context_m1m2 != NULL) {
  ------------------
  |  Branch (1284:9): [True: 0, False: 16]
  ------------------
 1285|      0|        libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1286|      0|                           spdm_context->transcript.digest_context_m1m2);
 1287|      0|        spdm_context->transcript.digest_context_m1m2 = NULL;
 1288|      0|    }
 1289|     16|#endif
 1290|     16|}
libspdm_reset_message_c:
 1298|     15|{
 1299|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1300|       |    libspdm_reset_managed_buffer(&spdm_context->transcript.message_c);
 1301|       |#else
 1302|     15|    if (spdm_context->transcript.digest_context_m1m2 != NULL) {
  ------------------
  |  Branch (1302:9): [True: 0, False: 15]
  ------------------
 1303|      0|        libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1304|      0|                           spdm_context->transcript.digest_context_m1m2);
 1305|      0|        spdm_context->transcript.digest_context_m1m2 = NULL;
 1306|      0|    }
 1307|     15|#endif
 1308|     15|}
libspdm_reset_message_mut_b:
 1316|    129|{
 1317|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1318|       |    libspdm_reset_managed_buffer(&spdm_context->transcript.message_mut_b);
 1319|       |#else
 1320|    129|    if (spdm_context->transcript.digest_context_mut_m1m2 != NULL) {
  ------------------
  |  Branch (1320:9): [True: 28, False: 101]
  ------------------
 1321|     28|        libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1322|     28|                           spdm_context->transcript.digest_context_mut_m1m2);
 1323|     28|        spdm_context->transcript.digest_context_mut_m1m2 = NULL;
 1324|     28|    }
 1325|    129|#endif
 1326|    129|}
libspdm_reset_message_mut_c:
 1334|     11|{
 1335|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1336|       |    libspdm_reset_managed_buffer(&spdm_context->transcript.message_mut_c);
 1337|       |#else
 1338|     11|    if (spdm_context->transcript.digest_context_mut_m1m2 != NULL) {
  ------------------
  |  Branch (1338:9): [True: 0, False: 11]
  ------------------
 1339|      0|        libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1340|      0|                           spdm_context->transcript.digest_context_mut_m1m2);
 1341|      0|        spdm_context->transcript.digest_context_mut_m1m2 = NULL;
 1342|      0|    }
 1343|     11|#endif
 1344|     11|}
libspdm_reset_message_m:
 1355|     27|{
 1356|     27|    libspdm_session_info_t *spdm_session_info;
 1357|       |
 1358|     27|    spdm_session_info = session_info;
 1359|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1360|       |    if (spdm_session_info == NULL) {
 1361|       |        libspdm_reset_managed_buffer(&spdm_context->transcript.message_m);
 1362|       |    } else {
 1363|       |        libspdm_reset_managed_buffer(&spdm_session_info->session_transcript.message_m);
 1364|       |    }
 1365|       |#else
 1366|     27|    if (spdm_session_info == NULL) {
  ------------------
  |  Branch (1366:9): [True: 27, False: 0]
  ------------------
 1367|     27|        if (spdm_context->transcript.digest_context_l1l2 != NULL) {
  ------------------
  |  Branch (1367:13): [True: 0, False: 27]
  ------------------
 1368|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1369|      0|                               spdm_context->transcript.digest_context_l1l2);
 1370|      0|            spdm_context->transcript.digest_context_l1l2 = NULL;
 1371|      0|        }
 1372|     27|    } else {
 1373|      0|        if (spdm_session_info->session_transcript.digest_context_l1l2 != NULL) {
  ------------------
  |  Branch (1373:13): [True: 0, False: 0]
  ------------------
 1374|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1375|      0|                               spdm_session_info->session_transcript.digest_context_l1l2);
 1376|      0|            spdm_session_info->session_transcript.digest_context_l1l2 = NULL;
 1377|      0|        }
 1378|      0|    }
 1379|     27|#endif
 1380|     27|}
libspdm_reset_message_e:
 1461|      1|{
 1462|      1|    libspdm_session_info_t *spdm_session_info;
 1463|       |
 1464|      1|    spdm_session_info = session_info;
 1465|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1466|       |    if (spdm_session_info == NULL) {
 1467|       |        libspdm_reset_managed_buffer(&spdm_context->transcript.message_e);
 1468|       |    } else {
 1469|       |        libspdm_reset_managed_buffer(&spdm_session_info->session_transcript.message_e);
 1470|       |    }
 1471|       |#else
 1472|      1|    if (spdm_session_info == NULL) {
  ------------------
  |  Branch (1472:9): [True: 1, False: 0]
  ------------------
 1473|      1|        if (spdm_context->transcript.digest_context_il1il2 != NULL) {
  ------------------
  |  Branch (1473:13): [True: 0, False: 1]
  ------------------
 1474|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1475|      0|                               spdm_context->transcript.digest_context_il1il2);
 1476|      0|            spdm_context->transcript.digest_context_il1il2 = NULL;
 1477|      0|        }
 1478|      1|    } else {
 1479|      0|        if (spdm_session_info->session_transcript.digest_context_il1il2 != NULL) {
  ------------------
  |  Branch (1479:13): [True: 0, False: 0]
  ------------------
 1480|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1481|      0|                               spdm_session_info->session_transcript.digest_context_il1il2);
 1482|      0|            spdm_session_info->session_transcript.digest_context_il1il2 = NULL;
 1483|      0|        }
 1484|      0|    }
 1485|      1|#endif
 1486|      1|}
libspdm_reset_message_encap_e:
 1497|      1|{
 1498|      1|    libspdm_session_info_t *spdm_session_info;
 1499|       |
 1500|      1|    spdm_session_info = session_info;
 1501|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1502|       |    if (spdm_session_info == NULL) {
 1503|       |        libspdm_reset_managed_buffer(&spdm_context->transcript.message_encap_e);
 1504|       |    } else {
 1505|       |        libspdm_reset_managed_buffer(&spdm_session_info->session_transcript.message_encap_e);
 1506|       |    }
 1507|       |#else
 1508|      1|    if (spdm_session_info == NULL) {
  ------------------
  |  Branch (1508:9): [True: 1, False: 0]
  ------------------
 1509|      1|        if (spdm_context->transcript.digest_context_encap_il1il2 != NULL) {
  ------------------
  |  Branch (1509:13): [True: 0, False: 1]
  ------------------
 1510|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1511|      0|                               spdm_context->transcript.digest_context_encap_il1il2);
 1512|      0|            spdm_context->transcript.digest_context_encap_il1il2 = NULL;
 1513|      0|        }
 1514|      1|    } else {
 1515|      0|        if (spdm_session_info->session_transcript.digest_context_encap_il1il2 != NULL) {
  ------------------
  |  Branch (1515:13): [True: 0, False: 0]
  ------------------
 1516|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1517|      0|                               spdm_session_info->session_transcript.digest_context_encap_il1il2);
 1518|      0|            spdm_session_info->session_transcript.digest_context_encap_il1il2 = NULL;
 1519|      0|        }
 1520|      0|    }
 1521|      1|#endif
 1522|      1|}
libspdm_reset_message_buffer_via_request_code:
 1533|     28|{
 1534|     28|    libspdm_context_t *spdm_context;
 1535|       |
 1536|     28|    spdm_context = context;
 1537|       |    /**
 1538|       |     * Any request other than SPDM_GET_MEASUREMENTS resets L1/L2
 1539|       |     */
 1540|     28|    if (request_code != SPDM_GET_MEASUREMENTS) {
  ------------------
  |  |   70|     28|#define SPDM_GET_MEASUREMENTS 0xE0
  ------------------
  |  Branch (1540:9): [True: 27, False: 1]
  ------------------
 1541|     27|        libspdm_reset_message_m(spdm_context, session_info);
 1542|     27|    }
 1543|       |    /**
 1544|       |     * If the Requester issued GET_MEASUREMENTS or KEY_EXCHANGE or FINISH or PSK_EXCHANGE
 1545|       |     * or PSK_FINISH or KEY_UPDATE or HEARTBEAT or GET_ENCAPSULATED_REQUEST or DELIVER_ENCAPSULATED_RESPONSE
 1546|       |     * or END_SESSION request(s) or SPDM_GET_MEASUREMENT_EXTENSION_LOG and skipped CHALLENGE completion, M1 and M2 are reset to null.
 1547|       |     */
 1548|     28|    switch (request_code)
 1549|     28|    {
 1550|      1|    case SPDM_KEY_EXCHANGE:
  ------------------
  |  |   77|      1|#define SPDM_KEY_EXCHANGE 0xE4
  ------------------
  |  Branch (1550:5): [True: 1, False: 27]
  ------------------
 1551|      2|    case SPDM_GET_MEASUREMENTS:
  ------------------
  |  |   70|      2|#define SPDM_GET_MEASUREMENTS 0xE0
  ------------------
  |  Branch (1551:5): [True: 1, False: 27]
  ------------------
 1552|      3|    case SPDM_FINISH:
  ------------------
  |  |   78|      3|#define SPDM_FINISH 0xE5
  ------------------
  |  Branch (1552:5): [True: 1, False: 27]
  ------------------
 1553|      4|    case SPDM_PSK_EXCHANGE:
  ------------------
  |  |   79|      4|#define SPDM_PSK_EXCHANGE 0xE6
  ------------------
  |  Branch (1553:5): [True: 1, False: 27]
  ------------------
 1554|      5|    case SPDM_PSK_FINISH:
  ------------------
  |  |   80|      5|#define SPDM_PSK_FINISH 0xE7
  ------------------
  |  Branch (1554:5): [True: 1, False: 27]
  ------------------
 1555|      6|    case SPDM_KEY_UPDATE:
  ------------------
  |  |   82|      6|#define SPDM_KEY_UPDATE 0xE9
  ------------------
  |  Branch (1555:5): [True: 1, False: 27]
  ------------------
 1556|      7|    case SPDM_HEARTBEAT:
  ------------------
  |  |   81|      7|#define SPDM_HEARTBEAT 0xE8
  ------------------
  |  Branch (1556:5): [True: 1, False: 27]
  ------------------
 1557|      8|    case SPDM_GET_ENCAPSULATED_REQUEST:
  ------------------
  |  |   83|      8|#define SPDM_GET_ENCAPSULATED_REQUEST 0xEA
  ------------------
  |  Branch (1557:5): [True: 1, False: 27]
  ------------------
 1558|      9|    case SPDM_END_SESSION:
  ------------------
  |  |   85|      9|#define SPDM_END_SESSION 0xEC
  ------------------
  |  Branch (1558:5): [True: 1, False: 27]
  ------------------
 1559|     11|    case SPDM_GET_MEASUREMENT_EXTENSION_LOG:
  ------------------
  |  |   98|     11|#define SPDM_GET_MEASUREMENT_EXTENSION_LOG 0xEF
  ------------------
  |  Branch (1559:5): [True: 2, False: 26]
  ------------------
 1560|     11|        if (spdm_context->connection_info.connection_state <
  ------------------
  |  Branch (1560:13): [True: 11, False: 0]
  ------------------
 1561|     11|            LIBSPDM_CONNECTION_STATE_AUTHENTICATED) {
 1562|     11|            libspdm_reset_message_b(spdm_context);
 1563|     11|            libspdm_reset_message_c(spdm_context);
 1564|     11|            libspdm_reset_message_mut_b(spdm_context);
 1565|     11|            libspdm_reset_message_mut_c(spdm_context);
 1566|     11|        }
 1567|     11|        break;
 1568|      4|    case SPDM_DELIVER_ENCAPSULATED_RESPONSE:
  ------------------
  |  |   84|      4|#define SPDM_DELIVER_ENCAPSULATED_RESPONSE 0xEB
  ------------------
  |  Branch (1568:5): [True: 4, False: 24]
  ------------------
 1569|      4|        if (spdm_context->connection_info.connection_state <
  ------------------
  |  Branch (1569:13): [True: 4, False: 0]
  ------------------
 1570|      4|            LIBSPDM_CONNECTION_STATE_AUTHENTICATED) {
 1571|      4|            libspdm_reset_message_b(spdm_context);
 1572|      4|            libspdm_reset_message_c(spdm_context);
 1573|      4|        }
 1574|      4|        break;
 1575|      1|    case SPDM_GET_DIGESTS:
  ------------------
  |  |   66|      1|#define SPDM_GET_DIGESTS 0x81
  ------------------
  |  Branch (1575:5): [True: 1, False: 27]
  ------------------
 1576|      1|        libspdm_reset_message_b(spdm_context);
 1577|      1|        break;
 1578|      1|    case SPDM_GET_ENDPOINT_INFO:
  ------------------
  |  |   94|      1|#define SPDM_GET_ENDPOINT_INFO 0x87
  ------------------
  |  Branch (1578:5): [True: 1, False: 27]
  ------------------
 1579|      1|        libspdm_reset_message_e(spdm_context, session_info);
 1580|      1|        libspdm_reset_message_encap_e(spdm_context, session_info);
 1581|      1|        break;
 1582|     11|    default:
  ------------------
  |  Branch (1582:5): [True: 11, False: 17]
  ------------------
 1583|     11|        break;
 1584|     28|    }
 1585|     28|}
libspdm_append_message_mut_b:
 1762|     56|{
 1763|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 1764|       |    return libspdm_append_managed_buffer(&spdm_context->transcript.message_mut_b,
 1765|       |                                         message, message_size);
 1766|       |#else
 1767|     56|    {
 1768|     56|        bool result;
 1769|       |
 1770|     56|        if (spdm_context->transcript.digest_context_mut_m1m2 == NULL) {
  ------------------
  |  Branch (1770:13): [True: 28, False: 28]
  ------------------
 1771|     28|            spdm_context->transcript.digest_context_mut_m1m2 = libspdm_hash_new (
 1772|     28|                spdm_context->connection_info.algorithm.base_hash_algo);
 1773|     28|            if (spdm_context->transcript.digest_context_mut_m1m2 == NULL) {
  ------------------
  |  Branch (1773:17): [True: 0, False: 28]
  ------------------
 1774|      0|                return LIBSPDM_STATUS_CRYPTO_ERROR;
  ------------------
  |  |  156|      0|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_ERROR, LIBSPDM_SOURCE_CRYPTO, 0x0000)
  |  |  ------------------
  |  |  |  |   55|      0|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 1775|      0|            }
 1776|     28|            result = libspdm_hash_init (spdm_context->connection_info.algorithm.base_hash_algo,
 1777|     28|                                        spdm_context->transcript.digest_context_mut_m1m2);
 1778|     28|            if (!result) {
  ------------------
  |  Branch (1778:17): [True: 0, False: 28]
  ------------------
 1779|      0|                libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1780|      0|                                   spdm_context->transcript.digest_context_mut_m1m2);
 1781|      0|                spdm_context->transcript.digest_context_mut_m1m2 = NULL;
 1782|      0|                return LIBSPDM_STATUS_CRYPTO_ERROR;
  ------------------
  |  |  156|      0|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_ERROR, LIBSPDM_SOURCE_CRYPTO, 0x0000)
  |  |  ------------------
  |  |  |  |   55|      0|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 1783|      0|            }
 1784|     28|            if ((spdm_context->connection_info.version >> SPDM_VERSION_NUMBER_SHIFT_BIT) >
  ------------------
  |  |  140|     28|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
  |  Branch (1784:17): [True: 0, False: 28]
  ------------------
 1785|     28|                SPDM_MESSAGE_VERSION_11) {
  ------------------
  |  |  111|     28|#define SPDM_MESSAGE_VERSION_11 0x11
  ------------------
 1786|       |
 1787|       |                /* Need append VCA since 1.2 script */
 1788|      0|                result = libspdm_hash_update (
 1789|      0|                    spdm_context->connection_info.algorithm.base_hash_algo,
 1790|      0|                    spdm_context->transcript.digest_context_mut_m1m2,
 1791|      0|                    libspdm_get_managed_buffer(&spdm_context->transcript.message_a),
 1792|      0|                    libspdm_get_managed_buffer_size(&spdm_context->transcript.
 1793|      0|                                                    message_a));
 1794|      0|                if (!result) {
  ------------------
  |  Branch (1794:21): [True: 0, False: 0]
  ------------------
 1795|      0|                    libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1796|      0|                                       spdm_context->transcript.digest_context_mut_m1m2);
 1797|      0|                    spdm_context->transcript.digest_context_mut_m1m2 = NULL;
 1798|      0|                    return LIBSPDM_STATUS_CRYPTO_ERROR;
  ------------------
  |  |  156|      0|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_ERROR, LIBSPDM_SOURCE_CRYPTO, 0x0000)
  |  |  ------------------
  |  |  |  |   55|      0|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 1799|      0|                }
 1800|      0|            }
 1801|     28|        }
 1802|       |
 1803|     56|        result = libspdm_hash_update (spdm_context->connection_info.algorithm.base_hash_algo,
 1804|     56|                                      spdm_context->transcript.digest_context_mut_m1m2, message,
 1805|     56|                                      message_size);
 1806|     56|        if (!result) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 56]
  ------------------
 1807|      0|            libspdm_hash_free (spdm_context->connection_info.algorithm.base_hash_algo,
 1808|      0|                               spdm_context->transcript.digest_context_mut_m1m2);
 1809|      0|            spdm_context->transcript.digest_context_mut_m1m2 = NULL;
 1810|      0|            return LIBSPDM_STATUS_CRYPTO_ERROR;
  ------------------
  |  |  156|      0|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_ERROR, LIBSPDM_SOURCE_CRYPTO, 0x0000)
  |  |  ------------------
  |  |  |  |   55|      0|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 1811|      0|        }
 1812|       |
 1813|     56|        return LIBSPDM_STATUS_SUCCESS;
  ------------------
  |  |   59|     56|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_SUCCESS, LIBSPDM_SOURCE_SUCCESS, 0x0000)
  |  |  ------------------
  |  |  |  |   55|     56|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 1814|     56|    }
 1815|     56|#endif
 1816|     56|}
libspdm_get_connection_version:
 2632|    326|{
 2633|    326|    return (uint8_t)(spdm_context->connection_info.version >> SPDM_VERSION_NUMBER_SHIFT_BIT);
  ------------------
  |  |  140|    326|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 2634|    326|}
libspdm_is_capabilities_flag_supported:
 2651|     28|{
 2652|     28|    uint32_t negotiated_requester_capabilities_flag;
 2653|     28|    uint32_t negotiated_responder_capabilities_flag;
 2654|       |
 2655|     28|    if (is_requester) {
  ------------------
  |  Branch (2655:9): [True: 28, False: 0]
  ------------------
 2656|     28|        negotiated_requester_capabilities_flag = spdm_context->local_context.capability.flags;
 2657|     28|        negotiated_responder_capabilities_flag = spdm_context->connection_info.capability.flags;
 2658|     28|    } else {
 2659|      0|        negotiated_requester_capabilities_flag = spdm_context->connection_info.capability.flags;
 2660|      0|        negotiated_responder_capabilities_flag = spdm_context->local_context.capability.flags;
 2661|      0|    }
 2662|       |
 2663|     28|    if (((requester_capabilities_flag == 0) ||
  ------------------
  |  Branch (2663:10): [True: 0, False: 28]
  ------------------
 2664|     28|         ((negotiated_requester_capabilities_flag &
  ------------------
  |  Branch (2664:10): [True: 28, False: 0]
  ------------------
 2665|     28|           requester_capabilities_flag) != 0)) &&
 2666|     28|        ((responder_capabilities_flag == 0) ||
  ------------------
  |  Branch (2666:10): [True: 28, False: 0]
  ------------------
 2667|     28|         ((negotiated_responder_capabilities_flag &
  ------------------
  |  Branch (2667:10): [True: 0, False: 0]
  ------------------
 2668|     28|           responder_capabilities_flag) != 0))) {
 2669|     28|        return true;
 2670|     28|    } else {
 2671|      0|        return false;
 2672|      0|    }
 2673|     28|}
libspdm_register_device_io_func:
 2720|    118|{
 2721|    118|    libspdm_context_t *context;
 2722|       |
 2723|    118|    context = spdm_context;
 2724|    118|    context->send_message = send_message;
 2725|    118|    context->receive_message = receive_message;
 2726|    118|}
libspdm_register_device_buffer_func:
 2779|    118|{
 2780|    118|    libspdm_context_t *context;
 2781|       |
 2782|    118|    context = spdm_context;
 2783|    118|    context->sender_buffer_size = sender_buffer_size;
 2784|    118|    context->receiver_buffer_size = receiver_buffer_size;
 2785|    118|    context->acquire_sender_buffer = acquire_sender_buffer;
 2786|    118|    context->release_sender_buffer = release_sender_buffer;
 2787|    118|    context->acquire_receiver_buffer = acquire_receiver_buffer;
 2788|    118|    context->release_receiver_buffer = release_receiver_buffer;
 2789|       |
 2790|    118|    LIBSPDM_ASSERT (sender_buffer_size >=
 2791|    118|                    context->local_context.capability.transport_header_size +
 2792|    118|                    context->local_context.capability.transport_tail_size);
 2793|    118|    sender_buffer_size -= (context->local_context.capability.transport_header_size +
 2794|    118|                           context->local_context.capability.transport_tail_size);
 2795|    118|    LIBSPDM_ASSERT (sender_buffer_size >= SPDM_MIN_DATA_TRANSFER_SIZE_VERSION_12);
 2796|    118|    context->local_context.capability.sender_data_transfer_size = sender_buffer_size;
 2797|       |
 2798|    118|    LIBSPDM_ASSERT(receiver_buffer_size >=
 2799|    118|                   context->local_context.capability.transport_header_size +
 2800|    118|                   context->local_context.capability.transport_tail_size);
 2801|    118|    receiver_buffer_size -= (context->local_context.capability.transport_header_size +
 2802|    118|                             context->local_context.capability.transport_tail_size);
 2803|    118|    LIBSPDM_ASSERT (receiver_buffer_size >= SPDM_MIN_DATA_TRANSFER_SIZE_VERSION_12);
 2804|    118|    context->local_context.capability.data_transfer_size = receiver_buffer_size;
 2805|    118|}
libspdm_register_transport_layer_func:
 2823|    118|{
 2824|    118|    libspdm_context_t *context;
 2825|       |
 2826|    118|    context = spdm_context;
 2827|       |
 2828|       |    /* fix the data_transfer_size if it is set before */
 2829|    118|    if ((context->local_context.capability.data_transfer_size != 0) &&
  ------------------
  |  Branch (2829:9): [True: 0, False: 118]
  ------------------
 2830|    118|        (context->local_context.capability.data_transfer_size ==
  ------------------
  |  Branch (2830:9): [True: 0, False: 0]
  ------------------
 2831|      0|         context->receiver_buffer_size)) {
 2832|      0|        context->local_context.capability.data_transfer_size =
 2833|      0|            (uint32_t)(context->receiver_buffer_size -
 2834|      0|                       (transport_header_size + transport_tail_size));
 2835|      0|    }
 2836|    118|    if ((context->local_context.capability.sender_data_transfer_size != 0) &&
  ------------------
  |  Branch (2836:9): [True: 0, False: 118]
  ------------------
 2837|    118|        (context->local_context.capability.sender_data_transfer_size ==
  ------------------
  |  Branch (2837:9): [True: 0, False: 0]
  ------------------
 2838|      0|         context->sender_buffer_size)) {
 2839|      0|        context->local_context.capability.sender_data_transfer_size =
 2840|      0|            (uint32_t)(context->sender_buffer_size -
 2841|      0|                       (transport_header_size + transport_tail_size));
 2842|      0|    }
 2843|       |
 2844|    118|    context->local_context.capability.max_spdm_msg_size = max_spdm_msg_size;
 2845|    118|    context->local_context.capability.transport_header_size = transport_header_size;
 2846|    118|    context->local_context.capability.transport_tail_size = transport_tail_size;
 2847|    118|    context->transport_encode_message = transport_encode_message;
 2848|    118|    context->transport_decode_message = transport_decode_message;
 2849|    118|}
libspdm_get_sizeof_required_scratch_buffer:
 2886|    118|{
 2887|    118|    libspdm_context_t *context;
 2888|    118|    size_t scratch_buffer_size;
 2889|       |
 2890|    118|    context = spdm_context;
 2891|    118|    LIBSPDM_ASSERT (context->local_context.capability.max_spdm_msg_size != 0);
 2892|       |
 2893|    118|    scratch_buffer_size = libspdm_get_scratch_buffer_capacity(context);
 2894|    118|    return scratch_buffer_size;
 2895|    118|}
libspdm_set_scratch_buffer:
 2911|    118|{
 2912|    118|    libspdm_context_t *context;
 2913|       |
 2914|    118|    context = spdm_context;
 2915|    118|    LIBSPDM_ASSERT (context->local_context.capability.max_spdm_msg_size != 0);
 2916|    118|    LIBSPDM_ASSERT (scratch_buffer_size >= libspdm_get_scratch_buffer_capacity(spdm_context));
 2917|    118|    context->scratch_buffer = scratch_buffer;
 2918|    118|    context->scratch_buffer_size = scratch_buffer_size;
 2919|    118|    context->last_spdm_request = (uint8_t *)scratch_buffer +
 2920|    118|                                 libspdm_get_scratch_buffer_last_spdm_request_offset(spdm_context);
 2921|    118|#if LIBSPDM_RESPOND_IF_READY_SUPPORT
 2922|    118|    context->cache_spdm_request = (uint8_t *)scratch_buffer +
 2923|    118|                                  libspdm_get_scratch_buffer_cache_spdm_request_offset(spdm_context);
 2924|    118|#endif
 2925|    118|}
libspdm_init_context_with_secured_context:
 3240|    118|{
 3241|    118|    libspdm_context_t *context;
 3242|    118|    size_t index;
 3243|       |
 3244|    118|    LIBSPDM_ASSERT(spdm_context != NULL);
 3245|    118|    LIBSPDM_ASSERT(secured_contexts != NULL);
 3246|    118|    LIBSPDM_ASSERT(num_secured_contexts == LIBSPDM_MAX_SESSION_COUNT);
 3247|       |
 3248|    118|    context = spdm_context;
 3249|    118|    libspdm_zero_mem(context, sizeof(libspdm_context_t));
 3250|    118|    context->version = LIBSPDM_CONTEXT_STRUCT_VERSION;
  ------------------
  |  |  527|    118|#define LIBSPDM_CONTEXT_STRUCT_VERSION 0x3
  ------------------
 3251|    118|    context->transcript.message_a.max_buffer_size =
 3252|    118|        sizeof(context->transcript.message_a.buffer);
 3253|    118|    context->transcript.message_d.max_buffer_size =
 3254|    118|        sizeof(context->transcript.message_d.buffer);
 3255|       |#if LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT
 3256|       |    context->transcript.message_b.max_buffer_size =
 3257|       |        sizeof(context->transcript.message_b.buffer);
 3258|       |    context->transcript.message_c.max_buffer_size =
 3259|       |        sizeof(context->transcript.message_c.buffer);
 3260|       |    context->transcript.message_mut_b.max_buffer_size =
 3261|       |        sizeof(context->transcript.message_mut_b.buffer);
 3262|       |    context->transcript.message_mut_c.max_buffer_size =
 3263|       |        sizeof(context->transcript.message_mut_c.buffer);
 3264|       |    context->transcript.message_m.max_buffer_size =
 3265|       |        sizeof(context->transcript.message_m.buffer);
 3266|       |    context->transcript.message_e.max_buffer_size =
 3267|       |        sizeof(context->transcript.message_e.buffer);
 3268|       |    context->transcript.message_encap_e.max_buffer_size =
 3269|       |        sizeof(context->transcript.message_encap_e.buffer);
 3270|       |#endif
 3271|    118|    context->response_state = LIBSPDM_RESPONSE_STATE_NORMAL;
 3272|    118|    context->local_context.version.spdm_version_count = SPDM_MAX_VERSION_COUNT;
  ------------------
  |  |   17|    118|#define SPDM_MAX_VERSION_COUNT 4
  ------------------
 3273|    118|    context->local_context.version.spdm_version[0] = SPDM_MESSAGE_VERSION_10 <<
  ------------------
  |  |  110|    118|#define SPDM_MESSAGE_VERSION_10 0x10
  ------------------
 3274|    118|                                                     SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3275|    118|    context->local_context.version.spdm_version[1] = SPDM_MESSAGE_VERSION_11 <<
  ------------------
  |  |  111|    118|#define SPDM_MESSAGE_VERSION_11 0x11
  ------------------
 3276|    118|                                                     SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3277|    118|    context->local_context.version.spdm_version[2] = SPDM_MESSAGE_VERSION_12 <<
  ------------------
  |  |  112|    118|#define SPDM_MESSAGE_VERSION_12 0x12
  ------------------
 3278|    118|                                                     SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3279|    118|    context->local_context.version.spdm_version[3] = SPDM_MESSAGE_VERSION_13 <<
  ------------------
  |  |  113|    118|#define SPDM_MESSAGE_VERSION_13 0x13
  ------------------
 3280|    118|                                                     SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3281|    118|    context->local_context.secured_message_version.spdm_version_count =
 3282|    118|        SECURED_SPDM_MAX_VERSION_COUNT;
  ------------------
  |  |   55|    118|#define SECURED_SPDM_MAX_VERSION_COUNT 3
  ------------------
 3283|    118|    context->local_context.secured_message_version.spdm_version[0] =
 3284|    118|        SECURED_SPDM_VERSION_10 << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |   57|    118|#define SECURED_SPDM_VERSION_10 0x10
  ------------------
                      SECURED_SPDM_VERSION_10 << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3285|    118|    context->local_context.secured_message_version.spdm_version[1] =
 3286|    118|        SECURED_SPDM_VERSION_11 << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |   58|    118|#define SECURED_SPDM_VERSION_11 0x11
  ------------------
                      SECURED_SPDM_VERSION_11 << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3287|    118|    context->local_context.secured_message_version.spdm_version[2] =
 3288|    118|        SECURED_SPDM_VERSION_12 << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |   59|    118|#define SECURED_SPDM_VERSION_12 0x12
  ------------------
                      SECURED_SPDM_VERSION_12 << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
 3289|    118|    context->local_context.capability.st1 = SPDM_ST1_VALUE_US;
  ------------------
  |  | 1514|    118|#define SPDM_ST1_VALUE_US 100000
  ------------------
 3290|       |
 3291|    118|    context->mut_auth_cert_chain_buffer_size = 0;
 3292|       |
 3293|    118|    context->max_spdm_session_sequence_number = LIBSPDM_MAX_SPDM_SESSION_SEQUENCE_NUMBER;
  ------------------
  |  |   39|    118|#define LIBSPDM_MAX_SPDM_SESSION_SEQUENCE_NUMBER 0xFFFFFFFFFFFFFFFFull
  ------------------
 3294|       |
 3295|    118|    context->latest_session_id = INVALID_SESSION_ID;
  ------------------
  |  |   28|    118|#define INVALID_SESSION_ID 0
  ------------------
 3296|    118|    context->last_spdm_request_session_id = INVALID_SESSION_ID;
  ------------------
  |  |   28|    118|#define INVALID_SESSION_ID 0
  ------------------
 3297|    118|    context->last_spdm_request_session_id_valid = false;
 3298|    118|    context->last_spdm_request_size = 0;
 3299|       |
 3300|       |    /* To be updated in libspdm_register_device_buffer_func */
 3301|    118|    context->local_context.capability.data_transfer_size = 0;
 3302|    118|    context->local_context.capability.sender_data_transfer_size = 0;
 3303|    118|    context->local_context.capability.max_spdm_msg_size = 0;
 3304|       |
 3305|    590|    for (index = 0; index < num_secured_contexts; index++) {
  ------------------
  |  Branch (3305:21): [True: 472, False: 118]
  ------------------
 3306|    472|        if (secured_contexts[index] == NULL) {
  ------------------
  |  Branch (3306:13): [True: 0, False: 472]
  ------------------
 3307|      0|            return LIBSPDM_STATUS_INVALID_PARAMETER;
  ------------------
  |  |   73|      0|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_ERROR, LIBSPDM_SOURCE_CORE, 0x0001)
  |  |  ------------------
  |  |  |  |   55|      0|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 3308|      0|        }
 3309|       |
 3310|    472|        context->session_info[index].secured_message_context = secured_contexts[index];
 3311|    472|        libspdm_secured_message_init_context(
 3312|    472|            context->session_info[index].secured_message_context);
 3313|    472|    }
 3314|       |
 3315|    118|    return LIBSPDM_STATUS_SUCCESS;
  ------------------
  |  |   59|    118|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_SUCCESS, LIBSPDM_SOURCE_SUCCESS, 0x0000)
  |  |  ------------------
  |  |  |  |   55|    118|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
 3316|    118|}
libspdm_init_context:
 3331|    118|{
 3332|    118|    libspdm_context_t *context;
 3333|    118|    void *secured_context;
 3334|    118|    void *secured_contexts[LIBSPDM_MAX_SESSION_COUNT];
 3335|    118|    size_t secured_context_size;
 3336|    118|    size_t index;
 3337|       |
 3338|    118|    LIBSPDM_ASSERT(spdm_context != NULL);
 3339|       |
 3340|       |    /* libspdm_get_context_size() allocates space for all secured message
 3341|       |     * contexts. They are appended to the general SPDM context. */
 3342|    118|    context = spdm_context;
 3343|    118|    secured_context = (void *)((size_t)(context + 1));
 3344|    118|    secured_context_size = libspdm_secured_message_get_context_size();
 3345|       |
 3346|    590|    for (index = 0; index < LIBSPDM_MAX_SESSION_COUNT; index++)
  ------------------
  |  |  198|    590|#define LIBSPDM_MAX_SESSION_COUNT 4
  ------------------
  |  Branch (3346:21): [True: 472, False: 118]
  ------------------
 3347|    472|    {
 3348|    472|        secured_contexts[index] = (uint8_t *)secured_context + secured_context_size * index;
 3349|    472|    }
 3350|       |
 3351|    118|    return libspdm_init_context_with_secured_context(spdm_context,
 3352|    118|                                                     secured_contexts,
 3353|    118|                                                     LIBSPDM_MAX_SESSION_COUNT);
  ------------------
  |  |  198|    118|#define LIBSPDM_MAX_SESSION_COUNT 4
  ------------------
 3354|    118|}
libspdm_get_context_size:
 3467|    118|{
 3468|    118|    size_t size;
 3469|       |
 3470|    118|    size = sizeof(libspdm_context_t) +
 3471|    118|           libspdm_secured_message_get_context_size() * LIBSPDM_MAX_SESSION_COUNT;
  ------------------
  |  |  198|    118|#define LIBSPDM_MAX_SESSION_COUNT 4
  ------------------
 3472|    118|    LIBSPDM_ASSERT (size == LIBSPDM_CONTEXT_SIZE_ALL);
 3473|    118|    return size;
 3474|    118|}

libspdm_generate_cert_chain_hash:
  702|     28|{
  703|     28|    LIBSPDM_ASSERT(slot_id < SPDM_MAX_SLOT_COUNT);
  704|     28|    return libspdm_hash_all(
  705|     28|        spdm_context->connection_info.algorithm.base_hash_algo,
  706|     28|        spdm_context->local_context.local_cert_chain_provision[slot_id],
  707|     28|        spdm_context->local_context.local_cert_chain_provision_size[slot_id], hash);
  708|     28|}
libspdm_get_cert_slot_count:
  758|     28|{
  759|     28|    size_t index;
  760|     28|    uint8_t slot_count;
  761|       |
  762|     28|    slot_count = 0;
  763|    252|    for (index = 0; index < SPDM_MAX_SLOT_COUNT; index++) {
  ------------------
  |  |   18|    252|#define SPDM_MAX_SLOT_COUNT 8
  ------------------
  |  Branch (763:21): [True: 224, False: 28]
  ------------------
  764|    224|        if (spdm_context->local_context.local_cert_chain_provision[index] != NULL) {
  ------------------
  |  Branch (764:13): [True: 28, False: 196]
  ------------------
  765|     28|            slot_count++;
  766|     28|        }
  767|    224|    }
  768|       |
  769|     28|    return slot_count;
  770|     28|}

libspdm_get_hash_size:
   10|     28|{
   11|     28|    switch (base_hash_algo) {
   12|     28|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256:
  ------------------
  |  |  391|     28|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 0x00000001
  ------------------
  |  Branch (12:5): [True: 28, False: 0]
  ------------------
   13|     28|#if LIBSPDM_SHA256_SUPPORT
   14|     28|        return 32;
   15|       |#else
   16|       |        return 0;
   17|       |#endif
   18|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
  ------------------
  |  |  394|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 0x00000008
  ------------------
  |  Branch (18:5): [True: 0, False: 28]
  ------------------
   19|      0|#if LIBSPDM_SHA3_256_SUPPORT
   20|      0|        return 32;
   21|       |#else
   22|       |        return 0;
   23|       |#endif
   24|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
  ------------------
  |  |  392|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 0x00000002
  ------------------
  |  Branch (24:5): [True: 0, False: 28]
  ------------------
   25|      0|#if LIBSPDM_SHA384_SUPPORT
   26|      0|        return 48;
   27|       |#else
   28|       |        return 0;
   29|       |#endif
   30|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
  ------------------
  |  |  395|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 0x00000010
  ------------------
  |  Branch (30:5): [True: 0, False: 28]
  ------------------
   31|      0|#if LIBSPDM_SHA3_384_SUPPORT
   32|      0|        return 48;
   33|       |#else
   34|       |        return 0;
   35|       |#endif
   36|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
  ------------------
  |  |  393|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 0x00000004
  ------------------
  |  Branch (36:5): [True: 0, False: 28]
  ------------------
   37|      0|#if LIBSPDM_SHA512_SUPPORT
   38|      0|        return 64;
   39|       |#else
   40|       |        return 0;
   41|       |#endif
   42|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
  ------------------
  |  |  396|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 0x00000020
  ------------------
  |  Branch (42:5): [True: 0, False: 28]
  ------------------
   43|      0|#if LIBSPDM_SHA3_512_SUPPORT
   44|      0|        return 64;
   45|       |#else
   46|       |        return 0;
   47|       |#endif
   48|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
  ------------------
  |  |  401|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 0x00000040
  ------------------
  |  Branch (48:5): [True: 0, False: 28]
  ------------------
   49|       |#if LIBSPDM_SM3_256_SUPPORT
   50|       |        return 32;
   51|       |#else
   52|      0|        return 0;
   53|      0|#endif
   54|      0|    default:
  ------------------
  |  Branch (54:5): [True: 0, False: 28]
  ------------------
   55|      0|        return 0;
   56|     28|    }
   57|     28|}
libspdm_hash_new:
   82|     28|{
   83|     28|    switch (base_hash_algo) {
   84|     28|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256:
  ------------------
  |  |  391|     28|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 0x00000001
  ------------------
  |  Branch (84:5): [True: 28, False: 0]
  ------------------
   85|     28|#if LIBSPDM_SHA256_SUPPORT
   86|     28|        return libspdm_sha256_new();
   87|       |#else
   88|       |        LIBSPDM_ASSERT(false);
   89|       |        return NULL;
   90|       |#endif
   91|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
  ------------------
  |  |  392|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 0x00000002
  ------------------
  |  Branch (91:5): [True: 0, False: 28]
  ------------------
   92|      0|#if LIBSPDM_SHA384_SUPPORT
   93|      0|        return libspdm_sha384_new();
   94|       |#else
   95|       |        LIBSPDM_ASSERT(false);
   96|       |        return NULL;
   97|       |#endif
   98|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
  ------------------
  |  |  393|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 0x00000004
  ------------------
  |  Branch (98:5): [True: 0, False: 28]
  ------------------
   99|      0|#if LIBSPDM_SHA512_SUPPORT
  100|      0|        return libspdm_sha512_new();
  101|       |#else
  102|       |        LIBSPDM_ASSERT(false);
  103|       |        return NULL;
  104|       |#endif
  105|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
  ------------------
  |  |  394|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 0x00000008
  ------------------
  |  Branch (105:5): [True: 0, False: 28]
  ------------------
  106|      0|#if LIBSPDM_SHA3_256_SUPPORT
  107|      0|        return libspdm_sha3_256_new();
  108|       |#else
  109|       |        LIBSPDM_ASSERT(false);
  110|       |        return NULL;
  111|       |#endif
  112|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
  ------------------
  |  |  395|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 0x00000010
  ------------------
  |  Branch (112:5): [True: 0, False: 28]
  ------------------
  113|      0|#if LIBSPDM_SHA3_384_SUPPORT
  114|      0|        return libspdm_sha3_384_new();
  115|       |#else
  116|       |        LIBSPDM_ASSERT(false);
  117|       |        return NULL;
  118|       |#endif
  119|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
  ------------------
  |  |  396|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 0x00000020
  ------------------
  |  Branch (119:5): [True: 0, False: 28]
  ------------------
  120|      0|#if LIBSPDM_SHA3_512_SUPPORT
  121|      0|        return libspdm_sha3_512_new();
  122|       |#else
  123|       |        LIBSPDM_ASSERT(false);
  124|       |        return NULL;
  125|       |#endif
  126|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
  ------------------
  |  |  401|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 0x00000040
  ------------------
  |  Branch (126:5): [True: 0, False: 28]
  ------------------
  127|       |#if LIBSPDM_SM3_256_SUPPORT
  128|       |        return libspdm_sm3_256_new();
  129|       |#else
  130|      0|        LIBSPDM_ASSERT(false);
  131|      0|        return NULL;
  132|      0|#endif
  133|      0|    default:
  ------------------
  |  Branch (133:5): [True: 0, False: 28]
  ------------------
  134|      0|        LIBSPDM_ASSERT(false);
  135|      0|        return NULL;
  136|     28|    }
  137|     28|}
libspdm_hash_free:
  140|     28|{
  141|     28|    if (hash_context == NULL) {
  ------------------
  |  Branch (141:9): [True: 0, False: 28]
  ------------------
  142|      0|        return;
  143|      0|    }
  144|     28|    switch (base_hash_algo) {
  145|     28|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256:
  ------------------
  |  |  391|     28|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 0x00000001
  ------------------
  |  Branch (145:5): [True: 28, False: 0]
  ------------------
  146|     28|#if LIBSPDM_SHA256_SUPPORT
  147|     28|        libspdm_sha256_free(hash_context);
  148|       |#else
  149|       |        LIBSPDM_ASSERT(false);
  150|       |#endif
  151|     28|        break;
  152|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
  ------------------
  |  |  392|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 0x00000002
  ------------------
  |  Branch (152:5): [True: 0, False: 28]
  ------------------
  153|      0|#if LIBSPDM_SHA384_SUPPORT
  154|      0|        libspdm_sha384_free(hash_context);
  155|       |#else
  156|       |        LIBSPDM_ASSERT(false);
  157|       |#endif
  158|      0|        break;
  159|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
  ------------------
  |  |  393|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 0x00000004
  ------------------
  |  Branch (159:5): [True: 0, False: 28]
  ------------------
  160|      0|#if LIBSPDM_SHA512_SUPPORT
  161|      0|        libspdm_sha512_free(hash_context);
  162|       |#else
  163|       |        LIBSPDM_ASSERT(false);
  164|       |#endif
  165|      0|        break;
  166|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
  ------------------
  |  |  394|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 0x00000008
  ------------------
  |  Branch (166:5): [True: 0, False: 28]
  ------------------
  167|      0|#if LIBSPDM_SHA3_256_SUPPORT
  168|      0|        libspdm_sha3_256_free(hash_context);
  169|       |#else
  170|       |        LIBSPDM_ASSERT(false);
  171|       |#endif
  172|      0|        break;
  173|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
  ------------------
  |  |  395|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 0x00000010
  ------------------
  |  Branch (173:5): [True: 0, False: 28]
  ------------------
  174|      0|#if LIBSPDM_SHA3_384_SUPPORT
  175|      0|        libspdm_sha3_384_free(hash_context);
  176|       |#else
  177|       |        LIBSPDM_ASSERT(false);
  178|       |#endif
  179|      0|        break;
  180|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
  ------------------
  |  |  396|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 0x00000020
  ------------------
  |  Branch (180:5): [True: 0, False: 28]
  ------------------
  181|      0|#if LIBSPDM_SHA3_512_SUPPORT
  182|      0|        libspdm_sha3_512_free(hash_context);
  183|       |#else
  184|       |        LIBSPDM_ASSERT(false);
  185|       |#endif
  186|      0|        break;
  187|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
  ------------------
  |  |  401|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 0x00000040
  ------------------
  |  Branch (187:5): [True: 0, False: 28]
  ------------------
  188|       |#if LIBSPDM_SM3_256_SUPPORT
  189|       |        libspdm_sm3_256_free(hash_context);
  190|       |#else
  191|      0|        LIBSPDM_ASSERT(false);
  192|      0|#endif
  193|      0|        break;
  194|      0|    default:
  ------------------
  |  Branch (194:5): [True: 0, False: 28]
  ------------------
  195|      0|        LIBSPDM_ASSERT(false);
  196|      0|        break;
  197|     28|    }
  198|     28|}
libspdm_hash_init:
  201|     28|{
  202|     28|    switch (base_hash_algo) {
  203|     28|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256:
  ------------------
  |  |  391|     28|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 0x00000001
  ------------------
  |  Branch (203:5): [True: 28, False: 0]
  ------------------
  204|     28|#if LIBSPDM_SHA256_SUPPORT
  205|     28|        return libspdm_sha256_init(hash_context);
  206|       |#else
  207|       |        LIBSPDM_ASSERT(false);
  208|       |        return false;
  209|       |#endif
  210|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
  ------------------
  |  |  392|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 0x00000002
  ------------------
  |  Branch (210:5): [True: 0, False: 28]
  ------------------
  211|      0|#if LIBSPDM_SHA384_SUPPORT
  212|      0|        return libspdm_sha384_init(hash_context);
  213|       |#else
  214|       |        LIBSPDM_ASSERT(false);
  215|       |        return false;
  216|       |#endif
  217|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
  ------------------
  |  |  393|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 0x00000004
  ------------------
  |  Branch (217:5): [True: 0, False: 28]
  ------------------
  218|      0|#if LIBSPDM_SHA512_SUPPORT
  219|      0|        return libspdm_sha512_init(hash_context);
  220|       |#else
  221|       |        LIBSPDM_ASSERT(false);
  222|       |        return false;
  223|       |#endif
  224|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
  ------------------
  |  |  394|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 0x00000008
  ------------------
  |  Branch (224:5): [True: 0, False: 28]
  ------------------
  225|      0|#if LIBSPDM_SHA3_256_SUPPORT
  226|      0|        return libspdm_sha3_256_init(hash_context);
  227|       |#else
  228|       |        LIBSPDM_ASSERT(false);
  229|       |        return false;
  230|       |#endif
  231|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
  ------------------
  |  |  395|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 0x00000010
  ------------------
  |  Branch (231:5): [True: 0, False: 28]
  ------------------
  232|      0|#if LIBSPDM_SHA3_384_SUPPORT
  233|      0|        return libspdm_sha3_384_init(hash_context);
  234|       |#else
  235|       |        LIBSPDM_ASSERT(false);
  236|       |        return false;
  237|       |#endif
  238|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
  ------------------
  |  |  396|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 0x00000020
  ------------------
  |  Branch (238:5): [True: 0, False: 28]
  ------------------
  239|      0|#if LIBSPDM_SHA3_512_SUPPORT
  240|      0|        return libspdm_sha3_512_init(hash_context);
  241|       |#else
  242|       |        LIBSPDM_ASSERT(false);
  243|       |        return false;
  244|       |#endif
  245|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
  ------------------
  |  |  401|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 0x00000040
  ------------------
  |  Branch (245:5): [True: 0, False: 28]
  ------------------
  246|       |#if LIBSPDM_SM3_256_SUPPORT
  247|       |        return libspdm_sm3_256_init(hash_context);
  248|       |#else
  249|      0|        LIBSPDM_ASSERT(false);
  250|      0|        return false;
  251|      0|#endif
  252|      0|    default:
  ------------------
  |  Branch (252:5): [True: 0, False: 28]
  ------------------
  253|      0|        LIBSPDM_ASSERT(false);
  254|      0|        return false;
  255|     28|    }
  256|     28|}
libspdm_hash_update:
  318|     56|{
  319|     56|    switch (base_hash_algo) {
  320|     56|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256:
  ------------------
  |  |  391|     56|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 0x00000001
  ------------------
  |  Branch (320:5): [True: 56, False: 0]
  ------------------
  321|     56|#if LIBSPDM_SHA256_SUPPORT
  322|     56|        return libspdm_sha256_update(hash_context, data, data_size);
  323|       |#else
  324|       |        LIBSPDM_ASSERT(false);
  325|       |        return false;
  326|       |#endif
  327|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
  ------------------
  |  |  392|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 0x00000002
  ------------------
  |  Branch (327:5): [True: 0, False: 56]
  ------------------
  328|      0|#if LIBSPDM_SHA384_SUPPORT
  329|      0|        return libspdm_sha384_update(hash_context, data, data_size);
  330|       |#else
  331|       |        LIBSPDM_ASSERT(false);
  332|       |        return false;
  333|       |#endif
  334|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
  ------------------
  |  |  393|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 0x00000004
  ------------------
  |  Branch (334:5): [True: 0, False: 56]
  ------------------
  335|      0|#if LIBSPDM_SHA512_SUPPORT
  336|      0|        return libspdm_sha512_update(hash_context, data, data_size);
  337|       |#else
  338|       |        LIBSPDM_ASSERT(false);
  339|       |        return false;
  340|       |#endif
  341|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
  ------------------
  |  |  394|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 0x00000008
  ------------------
  |  Branch (341:5): [True: 0, False: 56]
  ------------------
  342|      0|#if LIBSPDM_SHA3_256_SUPPORT
  343|      0|        return libspdm_sha3_256_update(hash_context, data, data_size);
  344|       |#else
  345|       |        LIBSPDM_ASSERT(false);
  346|       |        return false;
  347|       |#endif
  348|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
  ------------------
  |  |  395|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 0x00000010
  ------------------
  |  Branch (348:5): [True: 0, False: 56]
  ------------------
  349|      0|#if LIBSPDM_SHA3_384_SUPPORT
  350|      0|        return libspdm_sha3_384_update(hash_context, data, data_size);
  351|       |#else
  352|       |        LIBSPDM_ASSERT(false);
  353|       |        return false;
  354|       |#endif
  355|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
  ------------------
  |  |  396|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 0x00000020
  ------------------
  |  Branch (355:5): [True: 0, False: 56]
  ------------------
  356|      0|#if LIBSPDM_SHA3_512_SUPPORT
  357|      0|        return libspdm_sha3_512_update(hash_context, data, data_size);
  358|       |#else
  359|       |        LIBSPDM_ASSERT(false);
  360|       |        return false;
  361|       |#endif
  362|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
  ------------------
  |  |  401|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 0x00000040
  ------------------
  |  Branch (362:5): [True: 0, False: 56]
  ------------------
  363|       |#if LIBSPDM_SM3_256_SUPPORT
  364|       |        return libspdm_sm3_256_update(hash_context, data, data_size);
  365|       |#else
  366|      0|        LIBSPDM_ASSERT(false);
  367|      0|        return false;
  368|      0|#endif
  369|      0|    default:
  ------------------
  |  Branch (369:5): [True: 0, False: 56]
  ------------------
  370|      0|        LIBSPDM_ASSERT(false);
  371|      0|        return false;
  372|     56|    }
  373|     56|}
libspdm_hash_all:
  435|     28|{
  436|     28|    switch (base_hash_algo) {
  437|     28|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256:
  ------------------
  |  |  391|     28|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 0x00000001
  ------------------
  |  Branch (437:5): [True: 28, False: 0]
  ------------------
  438|     28|#if LIBSPDM_SHA256_SUPPORT
  439|     28|        return libspdm_sha256_hash_all(data, data_size, hash_value);
  440|       |#else
  441|       |        LIBSPDM_ASSERT(false);
  442|       |        return false;
  443|       |#endif
  444|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384:
  ------------------
  |  |  392|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 0x00000002
  ------------------
  |  Branch (444:5): [True: 0, False: 28]
  ------------------
  445|      0|#if LIBSPDM_SHA384_SUPPORT
  446|      0|        return libspdm_sha384_hash_all(data, data_size, hash_value);
  447|       |#else
  448|       |        LIBSPDM_ASSERT(false);
  449|       |        return false;
  450|       |#endif
  451|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512:
  ------------------
  |  |  393|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 0x00000004
  ------------------
  |  Branch (451:5): [True: 0, False: 28]
  ------------------
  452|      0|#if LIBSPDM_SHA512_SUPPORT
  453|      0|        return libspdm_sha512_hash_all(data, data_size, hash_value);
  454|       |#else
  455|       |        LIBSPDM_ASSERT(false);
  456|       |        return false;
  457|       |#endif
  458|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256:
  ------------------
  |  |  394|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 0x00000008
  ------------------
  |  Branch (458:5): [True: 0, False: 28]
  ------------------
  459|      0|#if LIBSPDM_SHA3_256_SUPPORT
  460|      0|        return libspdm_sha3_256_hash_all(data, data_size, hash_value);
  461|       |#else
  462|       |        LIBSPDM_ASSERT(false);
  463|       |        return false;
  464|       |#endif
  465|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384:
  ------------------
  |  |  395|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 0x00000010
  ------------------
  |  Branch (465:5): [True: 0, False: 28]
  ------------------
  466|      0|#if LIBSPDM_SHA3_384_SUPPORT
  467|      0|        return libspdm_sha3_384_hash_all(data, data_size, hash_value);
  468|       |#else
  469|       |        LIBSPDM_ASSERT(false);
  470|       |        return false;
  471|       |#endif
  472|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512:
  ------------------
  |  |  396|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 0x00000020
  ------------------
  |  Branch (472:5): [True: 0, False: 28]
  ------------------
  473|      0|#if LIBSPDM_SHA3_512_SUPPORT
  474|      0|        return libspdm_sha3_512_hash_all(data, data_size, hash_value);
  475|       |#else
  476|       |        LIBSPDM_ASSERT(false);
  477|       |        return false;
  478|       |#endif
  479|      0|    case SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256:
  ------------------
  |  |  401|      0|#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 0x00000040
  ------------------
  |  Branch (479:5): [True: 0, False: 28]
  ------------------
  480|       |#if LIBSPDM_SM3_256_SUPPORT
  481|       |        return libspdm_sm3_256_hash_all(data, data_size, hash_value);
  482|       |#else
  483|      0|        LIBSPDM_ASSERT(false);
  484|      0|        return false;
  485|      0|#endif
  486|      0|    default:
  ------------------
  |  Branch (486:5): [True: 0, False: 28]
  ------------------
  487|      0|        LIBSPDM_ASSERT(false);
  488|      0|        return false;
  489|     28|    }
  490|     28|}

libspdm_get_encap_response_digest:
   17|    118|{
   18|    118|    spdm_get_digest_request_t *spdm_request;
   19|    118|    spdm_digest_response_t *spdm_response;
   20|    118|    size_t index;
   21|    118|    uint32_t hash_size;
   22|    118|    uint8_t *digest;
   23|    118|    libspdm_context_t *context;
   24|    118|    libspdm_return_t status;
   25|    118|    bool result;
   26|       |    /*total populated slot count*/
   27|    118|    uint8_t slot_count;
   28|       |    /*populated slot index*/
   29|    118|    uint8_t slot_index;
   30|    118|    uint32_t session_id;
   31|    118|    libspdm_session_info_t *session_info;
   32|    118|    size_t additional_size;
   33|    118|    spdm_key_pair_id_t *key_pair_id;
   34|    118|    spdm_certificate_info_t *cert_info;
   35|    118|    spdm_key_usage_bit_mask_t *key_usage_bit_mask;
   36|       |
   37|    118|    context = spdm_context;
   38|    118|    spdm_request = request;
   39|       |
   40|    118|    if (libspdm_get_connection_version(context) < SPDM_MESSAGE_VERSION_11) {
  ------------------
  |  |  111|    118|#define SPDM_MESSAGE_VERSION_11 0x11
  ------------------
  |  Branch (40:9): [True: 0, False: 118]
  ------------------
   41|      0|        return libspdm_generate_encap_error_response(
   42|      0|            context, SPDM_ERROR_CODE_UNSUPPORTED_REQUEST,
  ------------------
  |  |  859|      0|#define SPDM_ERROR_CODE_UNSUPPORTED_REQUEST 0x07
  ------------------
   43|      0|            SPDM_GET_DIGESTS, response_size, response);
  ------------------
  |  |   66|      0|#define SPDM_GET_DIGESTS 0x81
  ------------------
   44|      0|    }
   45|       |
   46|    118|    if (spdm_request->header.spdm_version != libspdm_get_connection_version(context)) {
  ------------------
  |  Branch (46:9): [True: 90, False: 28]
  ------------------
   47|     90|        return libspdm_generate_encap_error_response(
   48|     90|            context, SPDM_ERROR_CODE_VERSION_MISMATCH,
  ------------------
  |  |  860|     90|#define SPDM_ERROR_CODE_VERSION_MISMATCH 0x41
  ------------------
   49|     90|            0, response_size, response);
   50|     90|    }
   51|       |
   52|     28|    if (!libspdm_is_capabilities_flag_supported(
  ------------------
  |  Branch (52:9): [True: 0, False: 28]
  ------------------
   53|     28|            context, true,
   54|     28|            SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CERT_CAP, 0)) {
  ------------------
  |  |  185|     28|#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CERT_CAP 0x00000002
  ------------------
   55|      0|        return libspdm_generate_encap_error_response(
   56|      0|            context, SPDM_ERROR_CODE_UNSUPPORTED_REQUEST,
  ------------------
  |  |  859|      0|#define SPDM_ERROR_CODE_UNSUPPORTED_REQUEST 0x07
  ------------------
   57|      0|            SPDM_GET_DIGESTS, response_size, response);
  ------------------
  |  |   66|      0|#define SPDM_GET_DIGESTS 0x81
  ------------------
   58|      0|    }
   59|       |
   60|     28|    if (request_size < sizeof(spdm_get_digest_request_t)) {
  ------------------
  |  Branch (60:9): [True: 0, False: 28]
  ------------------
   61|      0|        return libspdm_generate_encap_error_response(
   62|      0|            context, SPDM_ERROR_CODE_INVALID_REQUEST, 0,
  ------------------
  |  |  855|      0|#define SPDM_ERROR_CODE_INVALID_REQUEST 0x01
  ------------------
   63|      0|            response_size, response);
   64|      0|    }
   65|       |
   66|     28|    libspdm_reset_message_buffer_via_request_code(context, NULL,
   67|     28|                                                  spdm_request->header.request_response_code);
   68|       |
   69|     28|    hash_size = libspdm_get_hash_size(
   70|     28|        context->connection_info.algorithm.base_hash_algo);
   71|       |
   72|     28|    slot_count = libspdm_get_cert_slot_count(context);
   73|     28|    additional_size = 0;
   74|     28|    if ((spdm_request->header.spdm_version >= SPDM_MESSAGE_VERSION_13) &&
  ------------------
  |  |  113|     28|#define SPDM_MESSAGE_VERSION_13 0x13
  ------------------
  |  Branch (74:9): [True: 0, False: 28]
  ------------------
   75|     28|        context->connection_info.multi_key_conn_req) {
  ------------------
  |  Branch (75:9): [True: 0, False: 0]
  ------------------
   76|      0|        additional_size = sizeof(spdm_key_pair_id_t) + sizeof(spdm_certificate_info_t) +
   77|      0|                          sizeof(spdm_key_usage_bit_mask_t);
   78|      0|    }
   79|     28|    LIBSPDM_ASSERT(*response_size >=
   80|     28|                   sizeof(spdm_digest_response_t) + (hash_size + additional_size) * slot_count);
   81|     28|    *response_size = sizeof(spdm_digest_response_t) + (hash_size + additional_size) * slot_count;
   82|     28|    libspdm_zero_mem(response, *response_size);
   83|     28|    spdm_response = response;
   84|       |
   85|     28|    spdm_response->header.spdm_version = spdm_request->header.spdm_version;
   86|     28|    spdm_response->header.request_response_code = SPDM_DIGESTS;
  ------------------
  |  |   29|     28|#define SPDM_DIGESTS 0x01
  ------------------
   87|     28|    spdm_response->header.param1 = 0;
   88|     28|    spdm_response->header.param2 = 0;
   89|       |
   90|     28|    if (spdm_request->header.spdm_version >= SPDM_MESSAGE_VERSION_13) {
  ------------------
  |  |  113|     28|#define SPDM_MESSAGE_VERSION_13 0x13
  ------------------
  |  Branch (90:9): [True: 0, False: 28]
  ------------------
   91|      0|        spdm_response->header.param1 = context->local_context.local_supported_slot_mask;
   92|      0|    }
   93|       |
   94|     28|    digest = (void *)(spdm_response + 1);
   95|     28|    key_pair_id = (spdm_key_pair_id_t *)((uint8_t *)digest + hash_size * slot_count);
   96|     28|    cert_info = (spdm_certificate_info_t *)((uint8_t *)key_pair_id +
   97|     28|                                            sizeof(spdm_key_pair_id_t) * slot_count);
   98|     28|    key_usage_bit_mask = (spdm_key_usage_bit_mask_t *)((uint8_t *)cert_info +
   99|     28|                                                       sizeof(spdm_certificate_info_t) *
  100|     28|                                                       slot_count);
  101|       |
  102|     28|    slot_index = 0;
  103|    252|    for (index = 0; index < SPDM_MAX_SLOT_COUNT; index++) {
  ------------------
  |  |   18|    252|#define SPDM_MAX_SLOT_COUNT 8
  ------------------
  |  Branch (103:21): [True: 224, False: 28]
  ------------------
  104|    224|        if (context->local_context
  ------------------
  |  Branch (104:13): [True: 28, False: 196]
  ------------------
  105|    224|            .local_cert_chain_provision[index] != NULL) {
  106|     28|            spdm_response->header.param2 |= (1 << index);
  107|     28|            result = libspdm_generate_cert_chain_hash(context, index,
  108|     28|                                                      &digest[hash_size * slot_index]);
  109|     28|            if ((spdm_request->header.spdm_version >= SPDM_MESSAGE_VERSION_13) &&
  ------------------
  |  |  113|     28|#define SPDM_MESSAGE_VERSION_13 0x13
  ------------------
  |  Branch (109:17): [True: 0, False: 28]
  ------------------
  110|     28|                context->connection_info.multi_key_conn_req) {
  ------------------
  |  Branch (110:17): [True: 0, False: 0]
  ------------------
  111|      0|                key_pair_id[slot_index] = context->local_context.local_key_pair_id[index];
  112|      0|                cert_info[slot_index] = context->local_context.local_cert_info[index];
  113|      0|                key_usage_bit_mask[slot_index] =
  114|      0|                    context->local_context.local_key_usage_bit_mask[index];
  115|      0|            }
  116|     28|            slot_index++;
  117|     28|            if (!result) {
  ------------------
  |  Branch (117:17): [True: 0, False: 28]
  ------------------
  118|      0|                return libspdm_generate_encap_error_response(
  119|      0|                    context, SPDM_ERROR_CODE_UNSPECIFIED,
  ------------------
  |  |  858|      0|#define SPDM_ERROR_CODE_UNSPECIFIED 0x05
  ------------------
  120|      0|                    0, response_size, response);
  121|      0|            }
  122|     28|        }
  123|    224|    }
  124|       |
  125|       |    /* Cache*/
  126|       |
  127|     28|    status = libspdm_append_message_mut_b(context, spdm_request,
  128|     28|                                          request_size);
  129|     28|    if (LIBSPDM_STATUS_IS_ERROR(status)) {
  ------------------
  |  |   30|     28|    (LIBSPDM_STATUS_SEVERITY(status) == LIBSPDM_SEVERITY_ERROR)
  |  |  ------------------
  |  |  |  |   37|     28|#define LIBSPDM_STATUS_SEVERITY(status) (((status) >> 28) & 0xf)
  |  |  ------------------
  |  |                   (LIBSPDM_STATUS_SEVERITY(status) == LIBSPDM_SEVERITY_ERROR)
  |  |  ------------------
  |  |  |  |   44|     28|#define LIBSPDM_SEVERITY_ERROR 0x8
  |  |  ------------------
  |  |  |  Branch (30:5): [True: 0, False: 28]
  |  |  ------------------
  ------------------
  130|      0|        return libspdm_generate_encap_error_response(
  131|      0|            context, SPDM_ERROR_CODE_UNSPECIFIED, 0,
  ------------------
  |  |  858|      0|#define SPDM_ERROR_CODE_UNSPECIFIED 0x05
  ------------------
  132|      0|            response_size, response);
  133|      0|    }
  134|       |
  135|     28|    status = libspdm_append_message_mut_b(context, spdm_response,
  136|     28|                                          *response_size);
  137|     28|    if (LIBSPDM_STATUS_IS_ERROR(status)) {
  ------------------
  |  |   30|     28|    (LIBSPDM_STATUS_SEVERITY(status) == LIBSPDM_SEVERITY_ERROR)
  |  |  ------------------
  |  |  |  |   37|     28|#define LIBSPDM_STATUS_SEVERITY(status) (((status) >> 28) & 0xf)
  |  |  ------------------
  |  |                   (LIBSPDM_STATUS_SEVERITY(status) == LIBSPDM_SEVERITY_ERROR)
  |  |  ------------------
  |  |  |  |   44|     28|#define LIBSPDM_SEVERITY_ERROR 0x8
  |  |  ------------------
  |  |  |  Branch (30:5): [True: 0, False: 28]
  |  |  ------------------
  ------------------
  138|      0|        return libspdm_generate_encap_error_response(
  139|      0|            context, SPDM_ERROR_CODE_UNSPECIFIED, 0,
  ------------------
  |  |  858|      0|#define SPDM_ERROR_CODE_UNSPECIFIED 0x05
  ------------------
  140|      0|            response_size, response);
  141|      0|    }
  142|       |
  143|     28|    if (context->last_spdm_request_session_id_valid) {
  ------------------
  |  Branch (143:9): [True: 0, False: 28]
  ------------------
  144|      0|        session_id = context->last_spdm_request_session_id;
  145|     28|    } else {
  146|     28|        session_id = context->latest_session_id;
  147|     28|    }
  148|     28|    if (session_id != INVALID_SESSION_ID) {
  ------------------
  |  |   28|     28|#define INVALID_SESSION_ID 0
  ------------------
  |  Branch (148:9): [True: 0, False: 28]
  ------------------
  149|      0|        session_info = libspdm_get_session_info_via_session_id(context, session_id);
  150|     28|    } else {
  151|     28|        session_info = NULL;
  152|     28|    }
  153|     28|    if (session_info != NULL) {
  ------------------
  |  Branch (153:9): [True: 0, False: 28]
  ------------------
  154|      0|        if (context->connection_info.multi_key_conn_req) {
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            status = libspdm_append_message_encap_d(context, session_info, true,
  156|      0|                                                    spdm_response, *response_size);
  157|      0|            if (LIBSPDM_STATUS_IS_ERROR(status)) {
  ------------------
  |  |   30|      0|    (LIBSPDM_STATUS_SEVERITY(status) == LIBSPDM_SEVERITY_ERROR)
  |  |  ------------------
  |  |  |  |   37|      0|#define LIBSPDM_STATUS_SEVERITY(status) (((status) >> 28) & 0xf)
  |  |  ------------------
  |  |                   (LIBSPDM_STATUS_SEVERITY(status) == LIBSPDM_SEVERITY_ERROR)
  |  |  ------------------
  |  |  |  |   44|      0|#define LIBSPDM_SEVERITY_ERROR 0x8
  |  |  ------------------
  |  |  |  Branch (30:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  158|      0|                return libspdm_generate_encap_error_response(
  159|      0|                    context, SPDM_ERROR_CODE_UNSPECIFIED, 0,
  ------------------
  |  |  858|      0|#define SPDM_ERROR_CODE_UNSPECIFIED 0x05
  ------------------
  160|      0|                    response_size, response);
  161|      0|            }
  162|      0|        }
  163|      0|    }
  164|       |
  165|     28|    return LIBSPDM_STATUS_SUCCESS;
  ------------------
  |  |   59|     28|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_SUCCESS, LIBSPDM_SOURCE_SUCCESS, 0x0000)
  |  |  ------------------
  |  |  |  |   55|     28|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
  166|     28|}

libspdm_generate_encap_error_response:
   16|     90|{
   17|     90|    spdm_error_response_t *spdm_response;
   18|       |
   19|     90|    LIBSPDM_ASSERT(*response_size >= sizeof(spdm_error_response_t));
   20|     90|    *response_size = sizeof(spdm_error_response_t);
   21|     90|    spdm_response = response;
   22|       |
   23|     90|    spdm_response->header.spdm_version = libspdm_get_connection_version (spdm_context);
   24|     90|    spdm_response->header.request_response_code = SPDM_ERROR;
  ------------------
  |  |   37|     90|#define SPDM_ERROR 0x7F
  ------------------
   25|     90|    spdm_response->header.param1 = error_code;
   26|     90|    spdm_response->header.param2 = error_data;
   27|       |
   28|     90|    return LIBSPDM_STATUS_SUCCESS;
  ------------------
  |  |   59|     90|    LIBSPDM_STATUS_CONSTRUCT(LIBSPDM_SEVERITY_SUCCESS, LIBSPDM_SOURCE_SUCCESS, 0x0000)
  |  |  ------------------
  |  |  |  |   55|     90|    ((libspdm_return_t)(((severity) << 28) | ((source) << 16) | (code)))
  |  |  ------------------
  ------------------
   29|     90|}

libspdm_secured_message_get_context_size:
   15|    236|{
   16|    236|    return sizeof(libspdm_secured_message_context_t);
   17|    236|}
libspdm_secured_message_init_context:
   27|    472|{
   28|    472|    libspdm_secured_message_context_t *secured_message_context;
   29|       |
   30|    472|    secured_message_context = spdm_secured_message_context;
   31|    472|    libspdm_zero_mem(secured_message_context, sizeof(libspdm_secured_message_context_t));
   32|    472|}

libspdm_sha256_new:
   23|     28|{
   24|     28|    void *hmac_md_ctx;
   25|       |
   26|     28|    hmac_md_ctx = allocate_zero_pool(sizeof(mbedtls_sha256_context));
   27|     28|    if (hmac_md_ctx == NULL) {
  ------------------
  |  Branch (27:9): [True: 0, False: 28]
  ------------------
   28|      0|        return NULL;
   29|      0|    }
   30|       |
   31|     28|    return hmac_md_ctx;
   32|     28|}
libspdm_sha256_free:
   41|     28|{
   42|     28|    mbedtls_sha256_free(sha256_ctx);
   43|     28|    free_pool (sha256_ctx);
   44|     28|}
libspdm_sha256_init:
   59|     28|{
   60|     28|    int ret;
   61|       |
   62|     28|    if (sha256_context == NULL) {
  ------------------
  |  Branch (62:9): [True: 0, False: 28]
  ------------------
   63|      0|        return false;
   64|      0|    }
   65|       |
   66|     28|    mbedtls_sha256_init(sha256_context);
   67|       |
   68|     28|    ret = mbedtls_sha256_starts(sha256_context, false);
   69|     28|    if (ret != 0) {
  ------------------
  |  Branch (69:9): [True: 0, False: 28]
  ------------------
   70|      0|        return false;
   71|      0|    }
   72|     28|    return true;
   73|     28|}
libspdm_sha256_update:
  120|     56|{
  121|     56|    int ret;
  122|       |
  123|     56|    if (sha256_context == NULL) {
  ------------------
  |  Branch (123:9): [True: 0, False: 56]
  ------------------
  124|      0|        return false;
  125|      0|    }
  126|       |
  127|     56|    if (data == NULL && data_size != 0) {
  ------------------
  |  Branch (127:9): [True: 0, False: 56]
  |  Branch (127:25): [True: 0, False: 0]
  ------------------
  128|      0|        return false;
  129|      0|    }
  130|     56|    if (data_size > INT_MAX) {
  ------------------
  |  Branch (130:9): [True: 0, False: 56]
  ------------------
  131|      0|        return false;
  132|      0|    }
  133|       |
  134|     56|    ret = mbedtls_sha256_update(sha256_context, data, data_size);
  135|     56|    if (ret != 0) {
  ------------------
  |  Branch (135:9): [True: 0, False: 56]
  ------------------
  136|      0|        return false;
  137|      0|    }
  138|     56|    return true;
  139|     56|}
libspdm_sha256_hash_all:
  197|     28|{
  198|     28|    int ret;
  199|       |
  200|     28|    if (hash_value == NULL) {
  ------------------
  |  Branch (200:9): [True: 0, False: 28]
  ------------------
  201|      0|        return false;
  202|      0|    }
  203|     28|    if (data == NULL && data_size != 0) {
  ------------------
  |  Branch (203:9): [True: 0, False: 28]
  |  Branch (203:25): [True: 0, False: 0]
  ------------------
  204|      0|        return false;
  205|      0|    }
  206|     28|    if (data_size > INT_MAX) {
  ------------------
  |  Branch (206:9): [True: 0, False: 28]
  ------------------
  207|      0|        return false;
  208|      0|    }
  209|       |
  210|     28|    ret = mbedtls_sha256(data, data_size, hash_value, false);
  211|     28|    if (ret != 0) {
  ------------------
  |  Branch (211:9): [True: 0, False: 28]
  ------------------
  212|      0|        return false;
  213|      0|    }
  214|     28|    return true;
  215|     28|}

mbedtls_platform_zeroize:
   29|  1.90k|{
   30|  1.90k|    libspdm_zero_mem(buf, len);
   31|  1.90k|}

allocate_zero_pool:
   20|    146|{
   21|    146|    void *buffer;
   22|    146|    buffer = malloc(AllocationSize);
   23|    146|    if (buffer == NULL) {
  ------------------
  |  Branch (23:9): [True: 0, False: 146]
  ------------------
   24|      0|        return NULL;
   25|      0|    }
   26|    146|    memset(buffer, 0, AllocationSize);
   27|    146|    return buffer;
   28|    146|}
free_pool:
   31|     28|{
   32|     28|    free(buffer);
   33|     28|}

sha256.c:mbedtls_get_unaligned_uint32:
  168|  29.1k|{
  169|  29.1k|    uint32_t r;
  170|       |#if defined(UINT_UNALIGNED)
  171|       |    mbedtls_uint32_unaligned_t *p32 = (mbedtls_uint32_unaligned_t *) p;
  172|       |    r = *p32;
  173|       |#elif defined(UINT_UNALIGNED_STRUCT)
  174|       |    mbedtls_uint32_unaligned_t *p32 = (mbedtls_uint32_unaligned_t *) p;
  175|       |    r = p32->x;
  176|       |#else
  177|  29.1k|    memcpy(&r, p, sizeof(r));
  178|  29.1k|#endif
  179|  29.1k|    return r;
  180|  29.1k|}
sha256.c:mbedtls_put_unaligned_uint32:
  195|    280|{
  196|       |#if defined(UINT_UNALIGNED)
  197|       |    mbedtls_uint32_unaligned_t *p32 = (mbedtls_uint32_unaligned_t *) p;
  198|       |    *p32 = x;
  199|       |#elif defined(UINT_UNALIGNED_STRUCT)
  200|       |    mbedtls_uint32_unaligned_t *p32 = (mbedtls_uint32_unaligned_t *) p;
  201|       |    p32->x = x;
  202|       |#else
  203|    280|    memcpy(p, &x, sizeof(x));
  204|    280|#endif
  205|    280|}

mbedtls_sha256_init:
  226|     56|{
  227|     56|    memset(ctx, 0, sizeof(mbedtls_sha256_context));
  228|     56|}
mbedtls_sha256_free:
  231|     84|{
  232|     84|    if (ctx == NULL) {
  ------------------
  |  Branch (232:9): [True: 0, False: 84]
  ------------------
  233|      0|        return;
  234|      0|    }
  235|       |
  236|     84|    mbedtls_platform_zeroize(ctx, sizeof(mbedtls_sha256_context));
  237|     84|}
mbedtls_sha256_starts:
  249|     56|{
  250|       |#if defined(MBEDTLS_SHA224_C) && defined(MBEDTLS_SHA256_C)
  251|       |    if (is224 != 0 && is224 != 1) {
  252|       |        return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA;
  253|       |    }
  254|       |#elif defined(MBEDTLS_SHA256_C)
  255|     56|    if (is224 != 0) {
  ------------------
  |  Branch (255:9): [True: 0, False: 56]
  ------------------
  256|      0|        return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA;
  ------------------
  |  |   23|      0|#define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA                 -0x0074
  ------------------
  257|      0|    }
  258|       |#else /* defined MBEDTLS_SHA224_C only */
  259|       |    if (is224 == 0) {
  260|       |        return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA;
  261|       |    }
  262|       |#endif
  263|       |
  264|     56|    ctx->total[0] = 0;
  265|     56|    ctx->total[1] = 0;
  266|       |
  267|     56|    if (is224 == 0) {
  ------------------
  |  Branch (267:9): [True: 56, False: 0]
  ------------------
  268|     56|#if defined(MBEDTLS_SHA256_C)
  269|     56|        ctx->state[0] = 0x6A09E667;
  270|     56|        ctx->state[1] = 0xBB67AE85;
  271|     56|        ctx->state[2] = 0x3C6EF372;
  272|     56|        ctx->state[3] = 0xA54FF53A;
  273|     56|        ctx->state[4] = 0x510E527F;
  274|     56|        ctx->state[5] = 0x9B05688C;
  275|     56|        ctx->state[6] = 0x1F83D9AB;
  276|     56|        ctx->state[7] = 0x5BE0CD19;
  277|     56|#endif
  278|     56|    } else {
  279|       |#if defined(MBEDTLS_SHA224_C)
  280|       |        ctx->state[0] = 0xC1059ED8;
  281|       |        ctx->state[1] = 0x367CD507;
  282|       |        ctx->state[2] = 0x3070DD17;
  283|       |        ctx->state[3] = 0xF70E5939;
  284|       |        ctx->state[4] = 0xFFC00B31;
  285|       |        ctx->state[5] = 0x68581511;
  286|       |        ctx->state[6] = 0x64F98FA7;
  287|       |        ctx->state[7] = 0xBEFA4FA4;
  288|       |#endif
  289|      0|    }
  290|       |
  291|       |#if defined(MBEDTLS_SHA224_C)
  292|       |    ctx->is224 = is224;
  293|       |#endif
  294|       |
  295|     56|    return 0;
  296|     56|}
mbedtls_internal_sha256_process:
  494|  1.82k|{
  495|  1.82k|    struct {
  496|  1.82k|        uint32_t temp1, temp2, W[64];
  497|  1.82k|        uint32_t A[8];
  498|  1.82k|    } local;
  499|       |
  500|  1.82k|    unsigned int i;
  501|       |
  502|  16.3k|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (502:17): [True: 14.5k, False: 1.82k]
  ------------------
  503|  14.5k|        local.A[i] = ctx->state[i];
  504|  14.5k|    }
  505|       |
  506|       |#if defined(MBEDTLS_SHA256_SMALLER)
  507|       |    for (i = 0; i < 64; i++) {
  508|       |        if (i < 16) {
  509|       |            local.W[i] = MBEDTLS_GET_UINT32_BE(data, 4 * i);
  510|       |        } else {
  511|       |            R(i);
  512|       |        }
  513|       |
  514|       |        P(local.A[0], local.A[1], local.A[2], local.A[3], local.A[4],
  515|       |          local.A[5], local.A[6], local.A[7], local.W[i], K[i]);
  516|       |
  517|       |        local.temp1 = local.A[7]; local.A[7] = local.A[6];
  518|       |        local.A[6] = local.A[5]; local.A[5] = local.A[4];
  519|       |        local.A[4] = local.A[3]; local.A[3] = local.A[2];
  520|       |        local.A[2] = local.A[1]; local.A[1] = local.A[0];
  521|       |        local.A[0] = local.temp1;
  522|       |    }
  523|       |#else /* MBEDTLS_SHA256_SMALLER */
  524|  30.9k|    for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (524:17): [True: 29.1k, False: 1.82k]
  ------------------
  525|  29.1k|        local.W[i] = MBEDTLS_GET_UINT32_BE(data, 4 * i);
  ------------------
  |  |  413|  29.1k|    ((MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|  29.1k|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  ------------------
  |  |  |  Branch (413:6): [Folded - Ignored]
  |  |  ------------------
  |  |  414|  29.1k|        ? mbedtls_get_unaligned_uint32((data) + (offset))                  \
  |  |  415|  29.1k|        : MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \
  |  |  ------------------
  |  |  |  |  298|  29.1k|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  416|  29.1k|    )
  ------------------
  526|  29.1k|    }
  527|       |
  528|  5.46k|    for (i = 0; i < 16; i += 8) {
  ------------------
  |  Branch (528:17): [True: 3.64k, False: 1.82k]
  ------------------
  529|  3.64k|        P(local.A[0], local.A[1], local.A[2], local.A[3], local.A[4],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  530|  3.64k|          local.A[5], local.A[6], local.A[7], local.W[i+0], K[i+0]);
  531|  3.64k|        P(local.A[7], local.A[0], local.A[1], local.A[2], local.A[3],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  532|  3.64k|          local.A[4], local.A[5], local.A[6], local.W[i+1], K[i+1]);
  533|  3.64k|        P(local.A[6], local.A[7], local.A[0], local.A[1], local.A[2],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  534|  3.64k|          local.A[3], local.A[4], local.A[5], local.W[i+2], K[i+2]);
  535|  3.64k|        P(local.A[5], local.A[6], local.A[7], local.A[0], local.A[1],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  536|  3.64k|          local.A[2], local.A[3], local.A[4], local.W[i+3], K[i+3]);
  537|  3.64k|        P(local.A[4], local.A[5], local.A[6], local.A[7], local.A[0],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  538|  3.64k|          local.A[1], local.A[2], local.A[3], local.W[i+4], K[i+4]);
  539|  3.64k|        P(local.A[3], local.A[4], local.A[5], local.A[6], local.A[7],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  540|  3.64k|          local.A[0], local.A[1], local.A[2], local.W[i+5], K[i+5]);
  541|  3.64k|        P(local.A[2], local.A[3], local.A[4], local.A[5], local.A[6],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  542|  3.64k|          local.A[7], local.A[0], local.A[1], local.W[i+6], K[i+6]);
  543|  3.64k|        P(local.A[1], local.A[2], local.A[3], local.A[4], local.A[5],
  ------------------
  |  |  478|  3.64k|    do                                                              \
  |  |  479|  3.64k|    {                                                               \
  |  |  480|  3.64k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  3.64k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  3.64k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  3.64k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  3.64k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.64k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  3.64k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  3.64k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  3.64k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  544|  3.64k|          local.A[6], local.A[7], local.A[0], local.W[i+7], K[i+7]);
  545|  3.64k|    }
  546|       |
  547|  12.7k|    for (i = 16; i < 64; i += 8) {
  ------------------
  |  Branch (547:18): [True: 10.9k, False: 1.82k]
  ------------------
  548|  10.9k|        P(local.A[0], local.A[1], local.A[2], local.A[3], local.A[4],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  549|  10.9k|          local.A[5], local.A[6], local.A[7], R(i+0), K[i+0]);
  550|  10.9k|        P(local.A[7], local.A[0], local.A[1], local.A[2], local.A[3],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  551|  10.9k|          local.A[4], local.A[5], local.A[6], R(i+1), K[i+1]);
  552|  10.9k|        P(local.A[6], local.A[7], local.A[0], local.A[1], local.A[2],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  553|  10.9k|          local.A[3], local.A[4], local.A[5], R(i+2), K[i+2]);
  554|  10.9k|        P(local.A[5], local.A[6], local.A[7], local.A[0], local.A[1],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  555|  10.9k|          local.A[2], local.A[3], local.A[4], R(i+3), K[i+3]);
  556|  10.9k|        P(local.A[4], local.A[5], local.A[6], local.A[7], local.A[0],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  557|  10.9k|          local.A[1], local.A[2], local.A[3], R(i+4), K[i+4]);
  558|  10.9k|        P(local.A[3], local.A[4], local.A[5], local.A[6], local.A[7],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  559|  10.9k|          local.A[0], local.A[1], local.A[2], R(i+5), K[i+5]);
  560|  10.9k|        P(local.A[2], local.A[3], local.A[4], local.A[5], local.A[6],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  561|  10.9k|          local.A[7], local.A[0], local.A[1], R(i+6), K[i+6]);
  562|  10.9k|        P(local.A[1], local.A[2], local.A[3], local.A[4], local.A[5],
  ------------------
  |  |  478|  10.9k|    do                                                              \
  |  |  479|  10.9k|    {                                                               \
  |  |  480|  10.9k|        local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  466|  10.9k|#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp1 = (h) + S3(e) + F1((e), (f), (g)) + (K) + (x);    \
  |  |  ------------------
  |  |  |  |  469|  10.9k|#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |  481|  10.9k|        local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  465|  10.9k|#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  10.9k|#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  459|  10.9k|#define  SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       local.temp2 = S2(a) + F0((a), (b), (c));                      \
  |  |  ------------------
  |  |  |  |  468|  10.9k|#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |  482|  10.9k|        (d) += local.temp1; (h) = local.temp1 + local.temp2;        \
  |  |  483|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (483:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  563|  10.9k|          local.A[6], local.A[7], local.A[0], R(i+7), K[i+7]);
  564|  10.9k|    }
  565|  1.82k|#endif /* MBEDTLS_SHA256_SMALLER */
  566|       |
  567|  16.3k|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (567:17): [True: 14.5k, False: 1.82k]
  ------------------
  568|  14.5k|        ctx->state[i] += local.A[i];
  569|  14.5k|    }
  570|       |
  571|       |    /* Zeroise buffers and variables to clear sensitive data from memory. */
  572|  1.82k|    mbedtls_platform_zeroize(&local, sizeof(local));
  573|       |
  574|  1.82k|    return 0;
  575|  1.82k|}
mbedtls_sha256_update:
  648|     84|{
  649|     84|    int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
  ------------------
  |  |  100|     84|#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E
  ------------------
  650|     84|    size_t fill;
  651|     84|    uint32_t left;
  652|       |
  653|     84|    if (ilen == 0) {
  ------------------
  |  Branch (653:9): [True: 0, False: 84]
  ------------------
  654|      0|        return 0;
  655|      0|    }
  656|       |
  657|     84|    left = ctx->total[0] & 0x3F;
  658|     84|    fill = SHA256_BLOCK_SIZE - left;
  ------------------
  |  |  223|     84|#define SHA256_BLOCK_SIZE 64
  ------------------
  659|       |
  660|     84|    ctx->total[0] += (uint32_t) ilen;
  661|     84|    ctx->total[0] &= 0xFFFFFFFF;
  662|       |
  663|     84|    if (ctx->total[0] < (uint32_t) ilen) {
  ------------------
  |  Branch (663:9): [True: 0, False: 84]
  ------------------
  664|      0|        ctx->total[1]++;
  665|      0|    }
  666|       |
  667|     84|    if (left && ilen >= fill) {
  ------------------
  |  Branch (667:9): [True: 28, False: 56]
  |  Branch (667:17): [True: 0, False: 28]
  ------------------
  668|      0|        memcpy((void *) (ctx->buffer + left), input, fill);
  669|       |
  670|      0|        if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) {
  ------------------
  |  Branch (670:13): [True: 0, False: 0]
  ------------------
  671|      0|            return ret;
  672|      0|        }
  673|       |
  674|      0|        input += fill;
  675|      0|        ilen  -= fill;
  676|      0|        left = 0;
  677|      0|    }
  678|       |
  679|    112|    while (ilen >= SHA256_BLOCK_SIZE) {
  ------------------
  |  |  223|    112|#define SHA256_BLOCK_SIZE 64
  ------------------
  |  Branch (679:12): [True: 28, False: 84]
  ------------------
  680|     28|        size_t processed =
  681|     28|            mbedtls_internal_sha256_process_many(ctx, input, ilen);
  682|     28|        if (processed < SHA256_BLOCK_SIZE) {
  ------------------
  |  |  223|     28|#define SHA256_BLOCK_SIZE 64
  ------------------
  |  Branch (682:13): [True: 0, False: 28]
  ------------------
  683|      0|            return MBEDTLS_ERR_ERROR_GENERIC_ERROR;
  ------------------
  |  |   98|      0|#define MBEDTLS_ERR_ERROR_GENERIC_ERROR       -0x0001
  ------------------
  684|      0|        }
  685|       |
  686|     28|        input += processed;
  687|     28|        ilen  -= processed;
  688|     28|    }
  689|       |
  690|     84|    if (ilen > 0) {
  ------------------
  |  Branch (690:9): [True: 56, False: 28]
  ------------------
  691|     56|        memcpy((void *) (ctx->buffer + left), input, ilen);
  692|     56|    }
  693|       |
  694|     84|    return 0;
  695|     84|}
mbedtls_sha256_finish:
  702|     28|{
  703|     28|    int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
  ------------------
  |  |  100|     28|#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E
  ------------------
  704|     28|    uint32_t used;
  705|     28|    uint32_t high, low;
  706|     28|    int truncated = 0;
  707|       |
  708|       |    /*
  709|       |     * Add padding: 0x80 then 0x00 until 8 bytes remain for the length
  710|       |     */
  711|     28|    used = ctx->total[0] & 0x3F;
  712|       |
  713|     28|    ctx->buffer[used++] = 0x80;
  714|       |
  715|     28|    if (used <= 56) {
  ------------------
  |  Branch (715:9): [True: 28, False: 0]
  ------------------
  716|       |        /* Enough room for padding + length in current block */
  717|     28|        memset(ctx->buffer + used, 0, 56 - used);
  718|     28|    } else {
  719|       |        /* We'll need an extra block */
  720|      0|        memset(ctx->buffer + used, 0, SHA256_BLOCK_SIZE - used);
  ------------------
  |  |  223|      0|#define SHA256_BLOCK_SIZE 64
  ------------------
  721|       |
  722|      0|        if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) {
  ------------------
  |  Branch (722:13): [True: 0, False: 0]
  ------------------
  723|      0|            goto exit;
  724|      0|        }
  725|       |
  726|      0|        memset(ctx->buffer, 0, 56);
  727|      0|    }
  728|       |
  729|       |    /*
  730|       |     * Add message length
  731|       |     */
  732|     28|    high = (ctx->total[0] >> 29)
  733|     28|           | (ctx->total[1] <<  3);
  734|     28|    low  = (ctx->total[0] <<  3);
  735|       |
  736|     28|    MBEDTLS_PUT_UINT32_BE(high, ctx->buffer, 56);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  737|     28|    MBEDTLS_PUT_UINT32_BE(low,  ctx->buffer, 60);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  738|       |
  739|     28|    if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) {
  ------------------
  |  Branch (739:9): [True: 0, False: 28]
  ------------------
  740|      0|        goto exit;
  741|      0|    }
  742|       |
  743|       |    /*
  744|       |     * Output final state
  745|       |     */
  746|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[0], output,  0);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  747|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[1], output,  4);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  748|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[2], output,  8);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  749|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[3], output, 12);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  750|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[4], output, 16);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  751|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[5], output, 20);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  752|     28|    MBEDTLS_PUT_UINT32_BE(ctx->state[6], output, 24);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  753|       |
  754|       |#if defined(MBEDTLS_SHA224_C)
  755|       |    truncated = ctx->is224;
  756|       |#endif
  757|     28|    if (!truncated) {
  ------------------
  |  Branch (757:9): [True: 28, False: 0]
  ------------------
  758|     28|        MBEDTLS_PUT_UINT32_BE(ctx->state[7], output, 28);
  ------------------
  |  |  428|     28|    {                                                                            \
  |  |  429|     28|        if (MBEDTLS_IS_BIG_ENDIAN)                                               \
  |  |  ------------------
  |  |  |  |  398|     28|#define MBEDTLS_IS_BIG_ENDIAN 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (398:31): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  430|     28|        {                                                                        \
  |  |  431|      0|            mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n));     \
  |  |  432|      0|        }                                                                        \
  |  |  433|     28|        else                                                                     \
  |  |  434|     28|        {                                                                        \
  |  |  435|     28|            mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
  |  |  ------------------
  |  |  |  |  298|     28|#define MBEDTLS_BSWAP32 __builtin_bswap32
  |  |  ------------------
  |  |  436|     28|        }                                                                        \
  |  |  437|     28|    }
  ------------------
  759|     28|    }
  760|       |
  761|     28|    ret = 0;
  762|       |
  763|     28|exit:
  764|     28|    mbedtls_sha256_free(ctx);
  765|     28|    return ret;
  766|     28|}
mbedtls_sha256:
  777|     28|{
  778|     28|    int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
  ------------------
  |  |  100|     28|#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E
  ------------------
  779|     28|    mbedtls_sha256_context ctx;
  780|       |
  781|       |#if defined(MBEDTLS_SHA224_C) && defined(MBEDTLS_SHA256_C)
  782|       |    if (is224 != 0 && is224 != 1) {
  783|       |        return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA;
  784|       |    }
  785|       |#elif defined(MBEDTLS_SHA256_C)
  786|     28|    if (is224 != 0) {
  ------------------
  |  Branch (786:9): [True: 0, False: 28]
  ------------------
  787|      0|        return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA;
  ------------------
  |  |   23|      0|#define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA                 -0x0074
  ------------------
  788|      0|    }
  789|       |#else /* defined MBEDTLS_SHA224_C only */
  790|       |    if (is224 == 0) {
  791|       |        return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA;
  792|       |    }
  793|       |#endif
  794|       |
  795|     28|    mbedtls_sha256_init(&ctx);
  796|       |
  797|     28|    if ((ret = mbedtls_sha256_starts(&ctx, is224)) != 0) {
  ------------------
  |  Branch (797:9): [True: 0, False: 28]
  ------------------
  798|      0|        goto exit;
  799|      0|    }
  800|       |
  801|     28|    if ((ret = mbedtls_sha256_update(&ctx, input, ilen)) != 0) {
  ------------------
  |  Branch (801:9): [True: 0, False: 28]
  ------------------
  802|      0|        goto exit;
  803|      0|    }
  804|       |
  805|     28|    if ((ret = mbedtls_sha256_finish(&ctx, output)) != 0) {
  ------------------
  |  Branch (805:9): [True: 0, False: 28]
  ------------------
  806|      0|        goto exit;
  807|      0|    }
  808|       |
  809|     28|exit:
  810|     28|    mbedtls_sha256_free(&ctx);
  811|       |
  812|     28|    return ret;
  813|     28|}
sha256.c:mbedtls_internal_sha256_process_many:
  584|     28|{
  585|     28|    size_t processed = 0;
  586|       |
  587|  1.82k|    while (len >= SHA256_BLOCK_SIZE) {
  ------------------
  |  |  223|  1.82k|#define SHA256_BLOCK_SIZE 64
  ------------------
  |  Branch (587:12): [True: 1.79k, False: 28]
  ------------------
  588|  1.79k|        if (mbedtls_internal_sha256_process_c(ctx, data) != 0) {
  ------------------
  |  |  452|  1.79k|#define mbedtls_internal_sha256_process_c      mbedtls_internal_sha256_process
  ------------------
  |  Branch (588:13): [True: 0, False: 1.79k]
  ------------------
  589|      0|            return 0;
  590|      0|        }
  591|       |
  592|  1.79k|        data += SHA256_BLOCK_SIZE;
  ------------------
  |  |  223|  1.79k|#define SHA256_BLOCK_SIZE 64
  ------------------
  593|  1.79k|        len  -= SHA256_BLOCK_SIZE;
  ------------------
  |  |  223|  1.79k|#define SHA256_BLOCK_SIZE 64
  ------------------
  594|       |
  595|  1.79k|        processed += SHA256_BLOCK_SIZE;
  ------------------
  |  |  223|  1.79k|#define SHA256_BLOCK_SIZE 64
  ------------------
  596|  1.79k|    }
  597|       |
  598|     28|    return processed;
  599|     28|}

libspdm_copy_mem:
   12|     77|{
   13|     77|    volatile uint8_t* dst;
   14|     77|    const volatile uint8_t* src;
   15|       |
   16|     77|    dst = (volatile uint8_t*) dst_buf;
   17|     77|    src = (const volatile uint8_t*) src_buf;
   18|       |
   19|     77|    if ((dst == NULL) || (src == NULL)) {
  ------------------
  |  Branch (19:9): [True: 0, False: 77]
  |  Branch (19:26): [True: 0, False: 77]
  ------------------
   20|      0|        LIBSPDM_ASSERT(0);
   21|      0|    }
   22|     77|    if (((src < dst) && ((src + src_len) > dst)) || ((dst < src) && ((dst + src_len) > src))) {
  ------------------
  |  Branch (22:10): [True: 77, False: 0]
  |  Branch (22:25): [True: 0, False: 77]
  |  Branch (22:54): [True: 0, False: 77]
  |  Branch (22:69): [True: 0, False: 0]
  ------------------
   23|      0|        LIBSPDM_ASSERT(0);
   24|      0|    }
   25|     77|    if (src_len > dst_len) {
  ------------------
  |  Branch (25:9): [True: 0, False: 77]
  ------------------
   26|      0|        LIBSPDM_ASSERT(0);
   27|      0|    }
   28|       |
   29|  52.3k|    while (src_len-- != 0) {
  ------------------
  |  Branch (29:12): [True: 52.3k, False: 77]
  ------------------
   30|  52.3k|        *(dst++) = *(src++);
   31|  52.3k|    }
   32|     77|}

libspdm_set_mem:
   10|    118|{
   11|    118|    volatile uint8_t *pointer;
   12|       |
   13|    118|    pointer = (uint8_t *)buffer;
   14|   483k|    while (length-- != 0) {
  ------------------
  |  Branch (14:12): [True: 483k, False: 118]
  ------------------
   15|   483k|        *(pointer++) = value;
   16|   483k|    }
   17|    118|}

libspdm_zero_mem:
   17|  2.52k|{
   18|       |
   19|       |#if defined(__STDC_LIB_EXT1__)
   20|       |    memset_s(buffer, length, 0, length);
   21|       |#elif defined(_WIN32)
   22|       |    SecureZeroMemory(buffer, length);
   23|       |#elif defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
   24|       |    explicit_bzero(buffer, length);
   25|       |#else
   26|  2.52k|    volatile uint8_t *pointer;
   27|       |
   28|  2.52k|    pointer = (uint8_t *)buffer;
   29|  2.02M|    while (length-- != 0) {
  ------------------
  |  Branch (29:12): [True: 2.02M, False: 2.52k]
  ------------------
   30|  2.02M|        *(pointer++) = 0;
   31|  2.02M|    }
   32|       |
   33|       |#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
   34|       |    _ReadWriteBarrier();
   35|       |#elif defined(__GNUC__)
   36|       |    __asm__ __volatile__ ("" : : : "memory");
   37|  2.52k|#endif
   38|       |
   39|  2.52k|#endif
   40|  2.52k|}

libspdm_setup_test_context:
   59|    118|{
   60|    118|    m_libspdm_test_context = spdm_test_context;
   61|    118|}
libspdm_unit_test_group_setup:
   64|    118|{
   65|    118|    libspdm_test_context_t *spdm_test_context;
   66|    118|    void *spdm_context;
   67|       |
   68|    118|    spdm_test_context = m_libspdm_test_context;
   69|    118|    spdm_test_context->spdm_context =
   70|    118|        (void *)malloc(libspdm_get_context_size());
   71|    118|    if (spdm_test_context->spdm_context == NULL) {
  ------------------
  |  Branch (71:9): [True: 0, False: 118]
  ------------------
   72|      0|        return (size_t)-1;
   73|      0|    }
   74|    118|    spdm_context = spdm_test_context->spdm_context;
   75|       |
   76|    118|    libspdm_init_context(spdm_context);
   77|       |
   78|    118|    libspdm_register_device_io_func(spdm_context,
   79|    118|                                    spdm_test_context->send_message,
   80|    118|                                    spdm_test_context->receive_message);
   81|    118|    libspdm_register_transport_layer_func(spdm_context,
   82|    118|                                          LIBSPDM_MAX_SPDM_MSG_SIZE,
  ------------------
  |  |  101|    118|#define LIBSPDM_MAX_SPDM_MSG_SIZE 0x1200
  ------------------
   83|    118|                                          LIBSPDM_TEST_TRANSPORT_HEADER_SIZE,
  ------------------
  |  |   27|    118|#define LIBSPDM_TEST_TRANSPORT_HEADER_SIZE  (2 + 8 + \
  |  |   28|    118|                                             LIBSPDM_TEST_SEQUENCE_NUMBER_COUNT)
  |  |  ------------------
  |  |  |  |   16|    118|#define LIBSPDM_TEST_SEQUENCE_NUMBER_COUNT 2
  |  |  ------------------
  ------------------
   84|    118|                                          LIBSPDM_TEST_TRANSPORT_TAIL_SIZE,
  ------------------
  |  |   30|    118|#define LIBSPDM_TEST_TRANSPORT_TAIL_SIZE    (LIBSPDM_TEST_MAX_RANDOM_NUMBER_COUNT + \
  |  |  ------------------
  |  |  |  |   17|    118|#define LIBSPDM_TEST_MAX_RANDOM_NUMBER_COUNT 32
  |  |  ------------------
  |  |   31|    118|                                             LIBSPDM_MAX_AEAD_TAG_SIZE + \
  |  |  ------------------
  |  |  |  |   75|    118|#define LIBSPDM_MAX_AEAD_TAG_SIZE 16
  |  |  ------------------
  |  |   32|    118|                                             (LIBSPDM_TEST_ALIGNMENT - 1))
  |  |  ------------------
  |  |  |  |   15|    118|#define LIBSPDM_TEST_ALIGNMENT 4
  |  |  ------------------
  ------------------
   85|    118|                                          libspdm_transport_test_encode_message,
   86|    118|                                          libspdm_transport_test_decode_message);
   87|    118|    libspdm_register_device_buffer_func(spdm_context,
   88|    118|                                        LIBSPDM_MAX_SENDER_RECEIVER_BUFFER_SIZE,
  ------------------
  |  |   93|    118|#define LIBSPDM_MAX_SENDER_RECEIVER_BUFFER_SIZE LIBSPDM_RECEIVER_BUFFER_SIZE
  |  |  ------------------
  |  |  |  |   78|    118|#define LIBSPDM_RECEIVER_BUFFER_SIZE (0x1200 + \
  |  |  |  |   79|    118|                                      LIBSPDM_TRANSPORT_ADDITIONAL_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    118|#define LIBSPDM_TRANSPORT_ADDITIONAL_SIZE    (LIBSPDM_TEST_TRANSPORT_HEADER_SIZE + \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|    118|#define LIBSPDM_TEST_TRANSPORT_HEADER_SIZE  (2 + 8 + \
  |  |  |  |  |  |  |  |   28|    118|                                             LIBSPDM_TEST_SEQUENCE_NUMBER_COUNT)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   16|    118|#define LIBSPDM_TEST_SEQUENCE_NUMBER_COUNT 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    118|                                              LIBSPDM_TEST_TRANSPORT_TAIL_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|    118|#define LIBSPDM_TEST_TRANSPORT_TAIL_SIZE    (LIBSPDM_TEST_MAX_RANDOM_NUMBER_COUNT + \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|    118|#define LIBSPDM_TEST_MAX_RANDOM_NUMBER_COUNT 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    118|                                             LIBSPDM_MAX_AEAD_TAG_SIZE + \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    118|#define LIBSPDM_MAX_AEAD_TAG_SIZE 16
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   32|    118|                                             (LIBSPDM_TEST_ALIGNMENT - 1))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   15|    118|#define LIBSPDM_TEST_ALIGNMENT 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|    118|                                        LIBSPDM_MAX_SENDER_RECEIVER_BUFFER_SIZE,
  ------------------
  |  |   93|    118|#define LIBSPDM_MAX_SENDER_RECEIVER_BUFFER_SIZE LIBSPDM_RECEIVER_BUFFER_SIZE
  |  |  ------------------
  |  |  |  |   78|    118|#define LIBSPDM_RECEIVER_BUFFER_SIZE (0x1200 + \
  |  |  |  |   79|    118|                                      LIBSPDM_TRANSPORT_ADDITIONAL_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    118|#define LIBSPDM_TRANSPORT_ADDITIONAL_SIZE    (LIBSPDM_TEST_TRANSPORT_HEADER_SIZE + \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|    118|#define LIBSPDM_TEST_TRANSPORT_HEADER_SIZE  (2 + 8 + \
  |  |  |  |  |  |  |  |   28|    118|                                             LIBSPDM_TEST_SEQUENCE_NUMBER_COUNT)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   16|    118|#define LIBSPDM_TEST_SEQUENCE_NUMBER_COUNT 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    118|                                              LIBSPDM_TEST_TRANSPORT_TAIL_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|    118|#define LIBSPDM_TEST_TRANSPORT_TAIL_SIZE    (LIBSPDM_TEST_MAX_RANDOM_NUMBER_COUNT + \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   17|    118|#define LIBSPDM_TEST_MAX_RANDOM_NUMBER_COUNT 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    118|                                             LIBSPDM_MAX_AEAD_TAG_SIZE + \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    118|#define LIBSPDM_MAX_AEAD_TAG_SIZE 16
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   32|    118|                                             (LIBSPDM_TEST_ALIGNMENT - 1))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   15|    118|#define LIBSPDM_TEST_ALIGNMENT 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|    118|                                        spdm_device_acquire_sender_buffer,
   91|    118|                                        spdm_device_release_sender_buffer,
   92|    118|                                        spdm_device_acquire_receiver_buffer,
   93|    118|                                        spdm_device_release_receiver_buffer);
   94|       |
   95|    118|    spdm_test_context->scratch_buffer_size =
   96|    118|        libspdm_get_sizeof_required_scratch_buffer(spdm_context);
   97|    118|    spdm_test_context->scratch_buffer = (void *)malloc(spdm_test_context->scratch_buffer_size);
   98|    118|    libspdm_set_scratch_buffer (spdm_context,
   99|    118|                                spdm_test_context->scratch_buffer,
  100|    118|                                spdm_test_context->scratch_buffer_size);
  101|       |
  102|    118|    *State = spdm_test_context;
  103|    118|    return 0;
  104|    118|}
libspdm_unit_test_group_teardown:
  107|    118|{
  108|    118|    libspdm_test_context_t *spdm_test_context;
  109|       |
  110|    118|    spdm_test_context = *State;
  111|    118|    free(spdm_test_context->spdm_context);
  112|    118|    free(spdm_test_context->scratch_buffer);
  113|    118|    spdm_test_context->spdm_context = NULL;
  114|    118|    return 0;
  115|    118|}

libspdm_alignment_size:
   21|    118|{
   22|    118|    size_t alignment;
   23|    118|    size_t max_buffer_size;
   24|       |
   25|    118|    alignment = LIBSPDM_TEST_ALIGNMENT;
  ------------------
  |  |   15|    118|#define LIBSPDM_TEST_ALIGNMENT 4
  ------------------
   26|    118|    max_buffer_size = libspdm_get_max_buffer_size();
   27|       |
   28|       |    /* In the situation where max_buffer_size is not four-byte aligned, reserve sufficient size for the buffer_size */
   29|    118|    if ((size > max_buffer_size - alignment) && (size & (alignment - 1)) != 0) {
  ------------------
  |  Branch (29:9): [True: 45, False: 73]
  |  Branch (29:49): [True: 3, False: 42]
  ------------------
   30|      3|        size -= alignment;
   31|      3|    }
   32|       |
   33|    118|    if (((size) & (alignment - 1)) == 3) {
  ------------------
  |  Branch (33:9): [True: 17, False: 101]
  ------------------
   34|     17|        size += 1;
   35|     17|    }
   36|    118|    if (((size) & (alignment - 1)) == 2) {
  ------------------
  |  Branch (36:9): [True: 22, False: 96]
  ------------------
   37|     22|        size += 2;
   38|     22|    }
   39|    118|    if (((size) & (alignment - 1)) == 1) {
  ------------------
  |  Branch (39:9): [True: 24, False: 94]
  ------------------
   40|     24|        size += 3;
   41|     24|    }
   42|    118|    return size;
   43|    118|}
LLVMFuzzerTestOneInput:
  112|    118|{
  113|    118|    void *test_buffer;
  114|    118|    size_t max_buffer_size;
  115|       |
  116|       |    /* 1. Initialize test_buffer*/
  117|    118|    max_buffer_size = libspdm_get_max_buffer_size();
  118|    118|    test_buffer = allocate_zero_pool(max_buffer_size);
  119|    118|    if (test_buffer == NULL) {
  ------------------
  |  Branch (119:9): [True: 0, False: 118]
  ------------------
  120|      0|        return 0;
  121|      0|    }
  122|    118|    if (size == 0) {
  ------------------
  |  Branch (122:9): [True: 0, False: 118]
  ------------------
  123|      0|        printf("\033[1;33m file_size of the seed file is 0, so exit.\033[0m \n");
  124|      0|        free(test_buffer);
  125|      0|        return 0;
  126|      0|    }
  127|    118|    if (size > max_buffer_size) {
  ------------------
  |  Branch (127:9): [True: 41, False: 77]
  ------------------
  128|     41|        size = max_buffer_size;
  129|     77|    } else {
  130|     77|        libspdm_copy_mem(test_buffer, max_buffer_size, data, size);
  131|     77|    }
  132|    118|    size = libspdm_alignment_size(size);
  133|       |    /* 2. Run test*/
  134|    118|    libspdm_run_test_harness(test_buffer, size);
  135|       |    /* 3. Clean up*/
  136|    118|    free(test_buffer);
  137|    118|    return 0;
  138|    118|}

libspdm_get_max_buffer_size:
   16|    236|{
   17|    236|    return LIBSPDM_MAX_SPDM_MSG_SIZE;
  ------------------
  |  |  101|    236|#define LIBSPDM_MAX_SPDM_MSG_SIZE 0x1200
  ------------------
   18|    236|}
libspdm_test_requester_encap_digests:
   21|    118|{
   22|    118|    libspdm_test_context_t *spdm_test_context;
   23|    118|    libspdm_context_t *spdm_context;
   24|    118|    size_t request_size;
   25|    118|    size_t response_size;
   26|    118|    uint8_t response[LIBSPDM_MAX_SPDM_MSG_SIZE];
   27|    118|    uint8_t m_local_certificate_chain[LIBSPDM_MAX_CERT_CHAIN_SIZE];
   28|       |
   29|    118|    spdm_test_context = *State;
   30|    118|    spdm_context = spdm_test_context->spdm_context;
   31|    118|    spdm_context->connection_info.version = SPDM_MESSAGE_VERSION_11
  ------------------
  |  |  111|    118|#define SPDM_MESSAGE_VERSION_11 0x11
  ------------------
   32|    118|                                            << SPDM_VERSION_NUMBER_SHIFT_BIT;
  ------------------
  |  |  140|    118|#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
  ------------------
   33|    118|    spdm_context->connection_info.connection_state = LIBSPDM_CONNECTION_STATE_NEGOTIATED;
   34|    118|    spdm_context->local_context.capability.flags |= SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_CAP;
  ------------------
  |  |  234|    118|#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_CAP 0x00000002
  ------------------
   35|    118|    spdm_context->connection_info.algorithm.base_hash_algo = m_libspdm_use_hash_algo;
   36|    118|    spdm_context->local_context.local_cert_chain_provision[0] = m_local_certificate_chain;
   37|    118|    spdm_context->local_context.local_cert_chain_provision_size[0] =
   38|    118|        sizeof(m_local_certificate_chain);
   39|    118|    libspdm_set_mem(m_local_certificate_chain, sizeof(m_local_certificate_chain), (uint8_t)(0xFF));
   40|       |
   41|    118|    request_size = spdm_test_context->test_buffer_size;
   42|    118|    if (request_size > sizeof(spdm_get_digest_request_t)) {
  ------------------
  |  Branch (42:9): [True: 83, False: 35]
  ------------------
   43|     83|        request_size = sizeof(spdm_get_digest_request_t);
   44|     83|    }
   45|       |
   46|    118|    response_size = sizeof(response);
   47|    118|    libspdm_get_encap_response_digest(spdm_context, request_size,
   48|    118|                                      (uint8_t *)spdm_test_context->test_buffer,
   49|    118|                                      &response_size, response);
   50|    118|    libspdm_reset_message_mut_b(spdm_context);
   51|    118|}
libspdm_run_test_harness:
   59|    118|{
   60|    118|    void *State;
   61|       |
   62|    118|    libspdm_setup_test_context(&m_libspdm_requester_encap_digests_test_context);
   63|       |
   64|    118|    m_libspdm_requester_encap_digests_test_context.test_buffer = test_buffer;
   65|    118|    m_libspdm_requester_encap_digests_test_context.test_buffer_size = test_buffer_size;
   66|       |
   67|       |    /* Successful response */
   68|    118|    libspdm_unit_test_group_setup(&State);
   69|    118|    libspdm_test_requester_encap_digests(&State);
   70|    118|    libspdm_unit_test_group_teardown(&State);
   71|    118|}

